Update subscription
Via the API, you can amend a subscription for a given user.
Endpoint Url
| Environment | Url |
|---|---|
| Sandbox | https://partners-sandbox.ftmtapi.com/subscription/update |
| Prod | https://partners.ftmtapi.com/subscription/update |
Request
| Field | Type | Description | Required | Format |
|---|---|---|---|---|
email | string | The email address of the user (unique ID). | Yes | |
paymentPlan | number | The periodicity of the subscription (months) | No | 1, 6 or 12 |
planStartDate | string | When is the program supposed to start | No | YYYY-MM-DD |
subscriptionStatus | string | The status of the subscription | No | active, cancelled or paused |
Payload example
const payload = {
email: 'jane@doe.com',
paymentPlan: 6,
planStartDate: '2023-12-30',
}
Response
Response is always in JSON format.
{
"message": "update request received",
"email": "jane@doe.com"
}
Example call when you want to change the subscription plan
const axios = require('axios');
const res = await axios({
url: 'https://partners.ftmtapi.com/subscription/update',
method: 'post',
data: {
email: 'jane@doe.com',
paymentPlan: 12,
},
headers: {
Authorization: 'Bearer <YOUR_API_KEY>',
'Fitmate-Version': '2023-10-04',
}
});