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.
Path parameters
Section titled “Path parameters”| Name | Type | Description |
|---|---|---|
customerId |
integer | The customer (buyer) whose subscriptions are cancelled. |
Request
Section titled “Request”curl -X POST "https://api.creditcore.io/api/unsubscribe/all/5812" \ -H "Authorization: Bearer $CREDITCORE_API_TOKEN"Response
Section titled “Response”{ "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.
Unsubscribe one subscription
Section titled “Unsubscribe one subscription”Cancels a single subscription.
Path parameters
Section titled “Path parameters”| Name | Type | Description |
|---|---|---|
subscriptionId |
integer | The subscription to cancel (the id returned by Get a customer). This is not the customerId. |
Request
Section titled “Request”curl -X POST "https://api.creditcore.io/api/unsubscribe/5812" \ -H "Authorization: Bearer $CREDITCORE_API_TOKEN"Response
Section titled “Response”Always 200 OK. Check success:
{ "success": true, "message": "Unsubscription success" }{ "success": true, "message": "Already unsubscribed" }{ "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. |
Authentication
Section titled “Authentication”Authorization: Bearer <API token>, required on both endpoints. Only subscriptions of your account can be cancelled.