Initiate Subscription Cancelation
Initate a subscription cancelation
In order to cancel a subscription/unsubscribe a user from Centili platform using Centili Payment API, you need to send an HTTP POST request with Content-Type: application/json composed of parameters with associated values.
Before initiating a cancel subscription request you will need to obtain an access token
Subscription cancel by id
If you have subscriptionId of a subscription you want to cancel, send a POST request to the following URL:
https://capi.centili.com/payments/v3/subscriptions/{subscriptionid}/cancel
Subscription cancel by id request
https://capi.centili.com/payments/v3/subscriptions/{subscriptionId}/cancel HTTP/1.1
Host: capi.centili.com:443
Content type: application/json
Authorization: bearer token
Request parameters
Parameter | Description | Example | Required as |
---|---|---|---|
subscriptionid | Unique identifier of subscription in Centili system. | 6000557067 | mandatory |
Subscription cancel by msisdn
If you have service key and msisdn of a subscription you want to cancel, send a POST request to the following URL:
https://capi.centili.com/payments/v3/subscriptions/cancel/by-msisdn
Subscription cancel by msisdn request
https://capi.centili.com/payments/v3/subscriptions/cancel/by-msisdn HTTP/1.1
Host: capi.centili.com:443
Content type: application/json
Authorization: bearer token
{
"serviceKey": "2ea0e6c989b433d6c591633f91c67e07",
"msisdn": "381644150105"
}
Request body
Parameter | Description | Example | Required as |
---|---|---|---|
serviceKey | Centili issued service key, unique for every payment service. Consists of alphanumeric characters and counts up to 32 characters. | 2ea0e6c989b433d6c591633f91c67e07 | mandatory |
msisdn | Customer mobile phone number. NOTE: The number must be in E.164 format, excluding the plus ("+") character. | 381644150105 | mandatory |
Subscription cancel response
Once a request is received, Centili will synchronously respond with an appropriate HTTP response and a list of parameters and values in JSON format:
200
Subscription cancel transaction created
HTTP/1.1 200 OK
Content-Type: application/json
{
"transactionId": "17000002453",
"subscriptionId": "6000557067",
"clientData": {
"clientUserId": null,
"clientReference": null
}
}
Response parameters:
Parameter | Description | Example |
---|---|---|
transactionId | Unique identifier of a transaction in Centili system. | 17000002453 |
subscriptionId | Unique identifier of a subscription in Centili system. | 6000557067 |
clientData | Client related parameters. See (https://dev.centili.com/docs/subscription-renew#client-data) | { "clientUserId": "usrId1983", "clientReference": "appID1" } |
Client data
Parameter | Description | Example |
---|---|---|
clientUserId | Identification of the customer. | usrId1983 |
clientReference | Unique identification parameter under your system (pass-through variable). | appID1 |
4xx client error / 5xx server error
400 - Subscription cannot be canceled - check message for details.
401 - Invalid credentials
404 - Subscription not found
429 - Number of attempts over the max retry limit, request can not be retried.
500 - Request can not be processed at the current time
HTTP/1.1 404 Not Found
Content-Type: application/json
{
"code": "NOT_FOUND",
"message": "Subscription does not exist"
}
Paramter | Description | Example |
---|---|---|
code | Error response code | NOT_FOUND |
message | Error response message | Subscription does not exist |
Updated about 1 year ago