Skip to main content

Subscription Fetch by ID API

The following endpoint retrieves the details of a single Subscription

/subscriptions/:id

Path parameters#

Fieldis required?Description
idmandatorystring Unique identifier of the Subscription to be retrieved

Query parameters#

Fieldis required?Description
expandoptionalstring Used to retrieve additional information about the Subscription. Supported values are: customer,order. Example: /subscriptions/sub_jrmFNNJu5F99?expand=order&expand=customer

Example#

curl -u <YOUR_SECRET_KEY> \
-X DELETE https://api.durianpay.id/v1/subscriptions/sub_jrmFNNJu5F9959 \
-H "content-type: application/json"'

Response#

{
"data": {
"id": "sub_vUoR0w6c6j3912",
"plan": {
"id": "sub_plan_WdFvTrtP5Z6646",
"name": "Plan/Package Name",
"billing_period": "daily",
"billing_period_count": 1,
"grace_period": "annually",
"grace_period_count": 24,
"price": "20000.00",
"subscription_ref_id": "merchant_sub_ref_id"
},
"charge_type": "manual",
"status": "expired",
"started_at": "2021-09-30T12:58:38.210535Z",
"next_due_date": "2021-09-29T12:58:38.210535Z",
"billing_cycle_count": 10,
"amount": "40000.00",
"active_order_id": "",
"link": "https://links.durianpay.id/subscription-link/n7Hmh8"
}
}