In order to unsubscribe user from Centili platform you must use HTTPS POST method in application/json format, sent to the following URL with parameters described below:
https://api.centili.com/payments/v3/subscriptions/{subscriptionid}/cancel
POST opt-out request
URL: https://api.centili.com/payments/v3/subscriptions/5006180200/cancel
Method: POST
Content type: application/json
- The response you will receive:
HTTP/1.1 200 OK
Content-Type: application/json
{
"clientData":{
"clientUserId": "c43b7e44-609d-4dde-be33-xxxxxxxx",
"clientReference": null
},
"subscriptionId": "500618020220",
"transactionId": "1764170157220"
}
Parameters:
Parameter | Description | Example | Required as |
---|---|---|---|
subscriptionid | Unique identifier of subscription in Centili system. If subscriptionID is used than userid parameter can be skipped. | 1234567 | optional |
Possible server responses
Server response | Meaning | Possible Error messages |
---|---|---|
HTTP 202 Accepted | User has been successfully unsubscribed. | |
HTTP 400 invalid request | Unsubscribe request is invalid or cannot be resolved. | -Bad request |
HTTP 406 Not Acceptable | Opt-out transaction already exists. | There is already an outgoing opt-out process for this user. |
HTTP 500 Server error. | Some unexpected internal server error has occured. | Server error. |
Example of response for bad request:
{
"status": "INVALID_REQUEST",
"errorMessage": "Subscription does not exists."
}
Updated about a month ago