Cancel subscription
Via the API, you can request a cancellation for a given user.
Endpoint Url
| Environment | Url |
|---|---|
| Sandbox | https://partners-sandbox.ftmtapi.com/subscription/cancel |
| Prod | https://partners.ftmtapi.com/subscription/cancel |
Request
| Field | Type | Description | Required | Format |
|---|---|---|---|---|
email | string | The email address of the user (unique ID). | Yes | |
cancellationDate | date | The date for the cancellation (last day of service) | Yes | YYYY-MM-DD |
cancellationReason | string | The reason for the cancellation | No | free text |
Payload example
const payload = {
email: 'jane@doe.com',
cancellationReason: 'I have reached my weight loss goal',
cancellationDate: '2023-10-30',
}
Response
Response is always in JSON format.
{
"message": "Subscription request cancelled successfull",
"email": "jane@doe.com",
"identifier": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
}
Full example of a call made with axios
const axios = require('axios');
const res = await axios({
url: 'https://partners.ftmtapi.com/subscription/cancel',
method: 'post',
data: {
email: 'jane@doe.com',
cancellationReason: 'I have reached my weight loss goal',
cancellationDate: '2023-10-30',
},
headers: {
Authorization: 'Bearer <YOUR_API_KEY>',
'Fitmate-Version': '2023-08-22',
}
});