Skip to content

Unsubscribe a customer

There are two endpoints. Both cancel immediately: the subscription status becomes UNSUBSCRIBED, renewals are disabled and a CANCELLATION webhook is sent for each subscription cancelled.

Unsubscribe all subscriptions of a customer

Section titled “Unsubscribe all subscriptions of a customer”

Cancels every subscription of the customer in your account. Use this one with the customerId you receive in the checkout response and in webhooks.

Name Type Description
customerId integer The customer (buyer) whose subscriptions are cancelled.
Terminal window
curl -X POST "https://api.creditcore.io/api/unsubscribe/all/5812" \
-H "Authorization: Bearer $CREDITCORE_API_TOKEN"
200 OK
{ "success": true, "message": "Unsubscription success" }

The response is success: true even if the customer has no subscriptions, or if some of them couldn’t be cancelled. Subscriptions that were already cancelled are skipped and don’t trigger a new webhook.

Cancels a single subscription.

Name Type Description
subscriptionId integer The subscription to cancel (the id returned by Get a customer). This is not the customerId.
Terminal window
curl -X POST "https://api.creditcore.io/api/unsubscribe/5812" \
-H "Authorization: Bearer $CREDITCORE_API_TOKEN"

Always 200 OK. Check success:

Success
{ "success": true, "message": "Unsubscription success" }
Already cancelled
{ "success": true, "message": "Already unsubscribed" }
Failure
{ "success": false, "message": "membership not found: 5812" }
Field Type Description
success boolean true if the subscription is cancelled (now or before).
message string Result description. On failure, the reason.

Authorization: Bearer <API token>, required on both endpoints. Only subscriptions of your account can be cancelled.