View subscriptions using the API
Steps
1. List subscriptions
List the subscriptions by calling GET /subscriptions using any filter needed. Check the pagination to understand how list of resources work.
Response
200 OK
{
"cursor": "Q3VyaW9zaXR5IEtpbGxlZCB0aGUgQ2F0Cg==",
"data": [
{
"id": "sub_4ehg1mkv3mvt3256vcn8dspb4h",
[...]
},
{
"id": "sub_4ve0983428h1a56b52sm9v98df",
[...]
},
[...]
]
}
2. Get subscription details
From the previous response, you can get the internal subscription id
and get more details about that specific
subscription by calling GET
/subscriptions/{subscription_id}.
Response
200 OK
{
"type": "custom",
"id": "sub_4ehg1mkv3mvt3256vcn8dspb4h",
"status": "active",
"name": "Monthly SAAS subscription",
"version": "20240702153523123",
"billing_cycle": {
[...]
},
"invoice_details": {
[...]
},
[...]
}