Skip to main content

Subscriptions Fetch API

The following endpoint retrieves the details of all Subscriptions created

/subscriptions

Query parameters#

Following are the parameters to be sent in the request body:

Fieldis required?Description
fromoptionalinteger Timestamp (in Unix format) from when the Subscriptions should be fetched
tooptionalinteger Timestamp (in Unix format) up till when Subscriptions are to be fetched
skipoptionalinteger The number of subscriptions to be skipped. The default value is 0. This can be used for pagination, in combination with count
limitoptionalinteger Number of subscriptions to be fetched. Default value is 25. This can be used for pagination, in combination with the skip parameter
searchoptionalstring find subscriptions matching text with Durianpay Subscription ID.

Example#

curl -u <YOUR_SECRET_KEY> \
-X GET https://api.durianpay.id/v1/subscriptions?limit=50&skip=10 \
-H "content-type: application/json"'

Response#

{
"data": {
"subscription": [
{
"id": "sub_7HAtpFqE7g0944",
"status": "wait_for_payment",
"charge_type": "manual",
"name": "Plan/Package Name",
"started_at": "2021-10-01T12:58:38.210535Z",
"billing_period": "monthly",
"billing_period_count": 1,
"customer": {
"id": "cus_g0tw6z7sDF4506",
"email": "jude.casper@durianpay.i",
"mobile": "+628978678511",
"given_name": "Jude",
"middle_name": "",
"sur_name": "Casper"
}
}
],
"count": 1
}
}