# GET /checkoutpage/{{product_id}} — Get Checkout Page By Product Id

> Product: **Pabbly Subscription Billing** (v1)
> Base URL: `https://payments.pabbly.com/api/v1`
> Auth: Basic via `Authorization` header
> Canonical: `/subscription-billing/checkout-pages/get-checkout-page-by-product-id`

The GET request API which can be used to get the links of all the checkout pages associated to a product. You will need to add the product Id in the API link and fire it. There is no form data in this call. In response you will get the plan name, plan code,plan Id and the checkout page link of the plan.

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| product_id | string | Yes |  |

**Response (200)** — Get Checkout Page By Product Id:

```json
{
    "status": "success",
    "message": "Checkout Page data",
    "data": [
        {
            "plan_active": "true",
            "bump_offer": {},
            "createdAt": "2020-03-03T11:45:52.240Z",
            "updatedAt": "2020-03-03T11:45:52.240Z",
            "id": "5e5e4370aeec8333ded366f8",
            "product_id": "5e3d13bedb854627602966bf",
            "plan_name": "paid Trial Plan",
            "plan_code": "paid-trial-plan",
            "price": 50,
            "billing_period": "m",
            "billing_period_num": "1",
            "billing_cycle": "lifetime",
            "billing_cycle_num": null,
            "trial_period": 10,
            "setup_fee": 0,
            "plan_description": "",
            "checkout_page": "http://payments.pabbly.com/subscribe/5e5e4370aeec8333ded366f8/paid-trial-plan"
        },
        {
            "plan_active": "true",
            "bump_offer": {
                "plan_id": null,
                "title_label": null,
                "tag_line": null,
                "description": null
            },
            "currency_code": "INR",
            "currency_symbol": "₹",
            "redirect_url": "https://www.pabbly.com/",
            "createdAt": "2020-03-03T11:45:33.097Z",
            "updatedAt": "2020-03-03T11:45:33.097Z",
            "id": "5e5e435daeec8333ded366f7",
            "product_id": "5e3d13bedb854627602966bf",
            "plan_name": "plan",
            "plan_code": "planabc",
            "price": 10,
            "billing_period": "m",
            "billing_period_num": "1",
            "billing_cycle": "lifetime",
            "billing_cycle_num": "2",
            "trial_period": 2,
            "setup_fee": 2,
            "plan_description": "",
            "checkout_page": "http://payments.pabbly.com/subscribe/5e5e435daeec8333ded366f7/planabc"
        },
        {
            "plan_active": "false",
            "bump_offer": {
                "plan_id": null,
                "title_label": null,
                "tag_line": null,
                "description": null
            },
            "redirect_url": null,
            "createdAt": "2020-02-07T07:37:57.868Z",
            "updatedAt": "2020-02-07T07:37:57.868Z",
            "id": "5e3d13d5db854627602966c0",
            "product_id": "5e3d13bedb854627602966bf",
            "plan_name": "Recurring montly plan",
            "plan_code": "recurring-montly-plan",
            "price": 50,
            "billing_period": "m",
            "billing_period_num": "1",
            "billing_cycle": "lifetime",
            "billing_cycle_num": null,
            "trial_period": 0,
            "setup_fee": 0,
            "plan_description": "",
            "checkout_page": "http://payments.pabbly.com/subscribe/5e3d13d5db854627602966c0/recurring-montly-plan"
        }
    ]
}
```

**Code examples:**

_cURL_

```curl
curl https://payments.pabbly.com/api/v1/checkoutpage/{{product_id}} \
  -u {{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}
```

_Ruby_

```ruby
require 'net/http'
require 'json'

uri = URI('https://payments.pabbly.com/api/v1/checkoutpage/{{product_id}}')
request = Net::HTTP::Get.new(uri)
request.basic_auth '{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(request)
end

data = JSON.parse(response.body)
```

_Python_

```python
import requests
from requests.auth import HTTPBasicAuth

response = requests.get(
    'https://payments.pabbly.com/api/v1/checkoutpage/{{product_id}}',
    auth=HTTPBasicAuth('{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'),
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://payments.pabbly.com/api/v1/checkoutpage/{{product_id}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, '{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}');

$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
```

_Java_

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;

String credentials = Base64.getEncoder().encodeToString("{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}".getBytes());

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
    .uri(URI.create("https://payments.pabbly.com/api/v1/checkoutpage/{{product_id}}"))
    .header("Authorization", "Basic " + credentials)
    .GET();

HttpRequest request = builder.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

_Node.js_

```node
const credentials = Buffer.from('{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}').toString('base64');

const response = await fetch('https://payments.pabbly.com/api/v1/checkoutpage/{{product_id}}', {
  method: 'GET',
  headers: {
    'Authorization': `Basic ${credentials}`,
  },
});

const data = await response.json();
```

_Go_

```go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://payments.pabbly.com/api/v1/checkoutpage/{{product_id}}", nil)
    req.SetBasicAuth("{{YOUR_API_KEY}}", "{{YOUR_SECRET_KEY}}")

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}
```

_.NET_

```dotnet
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}"));

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://payments.pabbly.com/api/v1/checkoutpage/{{product_id}}");
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {credentials}");

var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
```

---

**Other endpoints in Checkout pages:**

- [GET /hostedpage — Get Hosted Page Data](/subscription-billing/checkout-pages/get-hosted-page-data)

