Skip to main content

Subscription Cancel by ID API

The following endpoint cancels a single Subscription

/subscriptions/:id/cancel

Path parameters#

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

Example#

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

Success Response#

{
"data": {
"id": "sub_vUoR0w6c6j3912",
"status": "expired",
"started_at": "2021-09-30T12:58:38.210535Z",
"cancelled_at": "2021-10-01T12:19:20.851102Z"
}
}

Error Response Code : 404#

{
"error": "subscription does not exists",
"error_code": "DPAY_INVALID_REQUEST"
}