# GET /hostedpage — Get Hosted Page Data

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

A very important API for the developers and majorly used in getting data from the hosted page. Get the data from the thank you page link. Example – https://www.inkthemes.com/?hostedpage=8ebdaa43b300805b078e66c014ed8625%3A9f42ed7e8275debf7df823bdd1a6cd070b8c2df97c23ae6bcf3f2d469967cee6ab8e614867af1f57df39449308469cb74051b16b5 Data in bold is the hosted page data In response you will get the “Success or Failed” and the respective message along with all the important details about the customer and the purchased subscription.

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| hostedpage | string | Yes | Get the data from the thank you page link. |

**Response (200)** — Get Hosted Page Data:

```json
{
    "status": "success",
    "message": "Valid hosted page data",
    "data": {
        "user": {
            "verified": "1",
            "currency": "USD",
            "createdAt": "2020-12-24T07:10:28.779Z",
            "updatedAt": "2021-04-27T04:33:11.261Z",
            "first_name": "Pankaj",
            "last_name": "Singh",
            "email": "ravi1795@gmail.com",
            "address_line1": "",
            "address_line2": "",
            "city": "Bhopal",
            "state": "Karnataka",
            "country": "India",
            "zip_code": "462022",
            "phone": "09981812850",
            "mobile": "",
            "facebook_url": "",
            "twitter_url": "",
            "time_zone": "",
            "date_format": "",
            "ip_address": "157.34.78.94",
            "currency_symbol": "$"
        },
        "customer": {
            "billing_address": {
                "street1": "Avinash Nagar Bhopal",
                "city": "Bhopal",
                "state": "Madhya Pradesh",
                "state_code": "MP",
                "zip_code": "462022",
                "country": "BY"
            },
            "shipping_address": {},
            "id": "602371d969573d214b87f231",
            "is_affiliate": true,
            "createdAt": "2021-02-10T05:40:41.092Z",
            "updatedAt": "2021-04-28T10:20:58.094Z",
            "first_name": "Ravi",
            "last_name": "Yadav",
            "email_id": "ravi1795@inboxkitten.com",
            "credit": null
        },
        "product": {
            "createdAt": "2021-01-14T12:33:33.771Z",
            "updatedAt": "2021-01-14T12:33:33.771Z",
            "id": "60003a1d9a0fb154a5e8ec22",
            "product_name": "API TEST",
            "description": "",
            "redirect_url": ""
        },
        "subscription": {
            "plan": {
                "plan_active": "true",
                "createdAt": "2021-03-03T06:45:40.091Z",
                "updatedAt": "2021-04-27T05:18:42.238Z",
                "id": "603f30941601ac5017c94d47",
                "product_id": "60003a1d9a0fb154a5e8ec22",
                "plan_name": "plan21",
                "plan_code": "plan21",
                "price": 100,
                "billing_period": "m",
                "billing_period_num": "1",
                "billing_cycle": "lifetime",
                "billing_cycle_num": "",
                "trial_period": 0,
                "setup_fee": 0,
                "plan_description": ""
            },
            "setup_fee": 0,
            "payment_terms": "",
            "currency_symbol": "$",
            "payment_method": "6089370cb5ab0014e196ef0e",
            "taxable": true,
            "gateway_type": "test",
            "gateway_id": "6082a9887478a02be738160c",
            "createdAt": "2021-04-28T10:20:58.112Z",
            "updatedAt": "2021-04-28T10:21:00.396Z",
            "id": "6089370ab5ab0014e196ef0b",
            "customer_id": "602371d969573d214b87f231",
            "product_id": "60003a1d9a0fb154a5e8ec22",
            "plan_id": "603f30941601ac5017c94d47",
            "amount": 100,
            "email_id": "ravi1795@inboxkitten.com",
            "status": "live",
            "quantity": 1,
            "starts_at": "2021-04-28T10:20:58.585Z",
            "activation_date": "2021-04-28T10:21:00.000Z",
            "expiry_date": "2121-04-28T10:20:58.585Z",
            "trial_days": 0,
            "trial_expiry_date": "",
            "next_billing_date": "2021-05-28T10:21:00.000Z",
            "last_billing_date": "2021-04-28T10:21:00.000Z",
            "canceled_date": null
        },
        "plan": {
            "plan_active": "true",
            "createdAt": "2021-03-03T06:45:40.091Z",
            "updatedAt": "2021-04-27T05:18:42.238Z",
            "id": "603f30941601ac5017c94d47",
            "product_id": "60003a1d9a0fb154a5e8ec22",
            "plan_name": "plan21",
            "plan_code": "plan21",
            "price": 100,
            "billing_period": "m",
            "billing_period_num": "1",
            "billing_cycle": "lifetime",
            "billing_cycle_num": "",
            "trial_period": 0,
            "setup_fee": 0,
            "plan_description": ""
        },
        "invoice": {
            "quantity": 1,
            "product_id": "60003a1d9a0fb154a5e8ec22",
            "setup_fee": 0,
            "currency_symbol": "$",
            "credit_note": {
                "total_tax": "0.00",
                "status": "success",
                "new_plan_total": 100,
                "credit_applied": []
            },
            "tax_apply": {
                "tax_id": "",
                "exempt_tax": [],
                "total_amount": 100,
                "total_tax": "0.00"
            },
            "createdAt": "2021-04-28T10:20:58.134Z",
            "updatedAt": "2021-04-28T10:21:00.404Z",
            "id": "6089370ab5ab0014e196ef0c",
            "customer_id": "602371d969573d214b87f231",
            "subscription_id": "6089370ab5ab0014e196ef0b",
            "status": "paid",
            "invoice_id": "INV-729",
            "payment_term": "",
            "due_amount": 0,
            "due_date": "2021-04-28T10:20:58.585Z",
            "subscription": {
                "plan": {
                    "plan_active": "true",
                    "createdAt": "2021-03-03T06:45:40.091Z",
                    "updatedAt": "2021-04-27T05:18:42.238Z",
                    "id": "603f30941601ac5017c94d47",
                    "product_id": "60003a1d9a0fb154a5e8ec22",
                    "plan_name": "plan21",
                    "plan_code": "plan21",
                    "price": 100,
                    "billing_period": "m",
                    "billing_period_num": "1",
                    "billing_cycle": "lifetime",
                    "billing_cycle_num": "",
                    "trial_period": 0,
                    "setup_fee": 0,
                    "plan_description": ""
                },
                "setup_fee": 0,
                "payment_terms": "",
                "currency_symbol": "$",
                "payment_method": "6089370cb5ab0014e196ef0e",
                "taxable": true,
                "gateway_type": "test",
                "gateway_id": "6082a9887478a02be738160c",
                "createdAt": "2021-04-28T10:20:58.112Z",
                "updatedAt": "2021-04-28T10:21:00.396Z",
                "id": "6089370ab5ab0014e196ef0b",
                "customer_id": "602371d969573d214b87f231",
                "product_id": "60003a1d9a0fb154a5e8ec22",
                "plan_id": "603f30941601ac5017c94d47",
                "amount": 100,
                "email_id": "ravi1795@inboxkitten.com",
                "status": "live",
                "quantity": 1,
                "starts_at": "2021-04-28T10:20:58.585Z",
                "activation_date": "2021-04-28T10:21:00.000Z",
                "expiry_date": "2121-04-28T10:20:58.585Z",
                "trial_days": 0,
                "trial_expiry_date": "",
                "next_billing_date": "2021-05-28T10:21:00.000Z",
                "last_billing_date": "2021-04-28T10:21:00.000Z",
                "canceled_date": null
            }
        }
    }
}
```

**Code examples:**

_cURL_

```curl
curl https://payments.pabbly.com/api/v1/hostedpage?hostedpage={{hostedpage}} \
  -u {{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}
```

_Ruby_

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

uri = URI('https://payments.pabbly.com/api/v1/hostedpage?hostedpage={{hostedpage}}')
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/hostedpage?hostedpage={{hostedpage}}',
    auth=HTTPBasicAuth('{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'),
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://payments.pabbly.com/api/v1/hostedpage?hostedpage={{hostedpage}}');
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/hostedpage?hostedpage={{hostedpage}}"))
    .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/hostedpage?hostedpage={{hostedpage}}', {
  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/hostedpage?hostedpage={{hostedpage}}", 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/hostedpage?hostedpage={{hostedpage}}");
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 /checkoutpage/{{product_id}} — Get Checkout Page By Product Id](/subscription-billing/checkout-pages/get-checkout-page-by-product-id)

