Cancel Subscription API#
Description#
This API endpoint allows you to cancel a customer's subscription.Request Parameters#
Path Parameters:#
companyId (string, required): The unique identifier of the company.
countryId (string, required): The unique identifier of the country.
customerIdentifier (string, required): The unique identifier of the customer.
Authorization (string, required): The authorization token in the format Bearer <your_token>.
Content-Type (string, required): The content type of the request, should be application/json.
Body Parameters:#
subscription_tsid (string, required): The unique identifier of the subscription to be canceled.
when (string, required): Defines when to cancel the subscription (IMMEDIATE, END_OF_CYCLE).
Request Example#
Response#
Error Responses#
Unauthorized (401)#
{
"success": false,
"message": "Unauthorized access. Invalid token."
}
Not Found (404)#
{
"success": false,
"message": "Subscription not found."
}
Bad Request (400)#
{
"success": false,
"message": "Invalid request parameters."
}
Notes#
The when parameter determines whether the cancellation is immediate or deferred.
Ensure that the correct subscription_tsid is provided to avoid errors.
Authentication is required using a valid Bearer token.
Request
Provide your bearer token in the Authorization
header when making requests to protected resources. Example:Authorization: Bearer ********************
Body Params application/json
{
"subscription_tsid": "CSU-0JTAGV2KWBHEW",
"when": "END_OF_CYCLE"
}
Request Code Samples
curl --location --request POST 'https://sandbox.api.stykite.com/v1/company//country//customer//cancel_subscription' \
--header 'authorization: Bearer' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"subscription_tsid": "CSU-0JTAGV2KWBHEW",
"when": "END_OF_CYCLE"
}'
Responses
application/json Modified at 2025-02-14 09:09:04