Api key provided on integrations tab in Easyflow platform.
Cancel subscription
Cancels a subscription of the business now. There is no request body.
- The API key must have write access to subscriptions, and its user must be a collaborator of the business sent in
business-id. Only the business that owns the subscription can cancel it. - The cancellation takes effect immediately. Nothing is refunded.
- Easyflow sends the
subscription.canceledwebhook once. Canceling again returnscanceledand sends nothing. - Pending and charged recurrences are canceled with it (a charge in progress is canceled, a paid recurrence is not touched), and Easyflow sends one
subscriptionRecurrence.canceledwebhook for each of them. - A subscription that is already
expiredis not changed, and the response bringsexpired. - Up to 30 requests per minute for each user (all API keys of the same user share the limit). Above that, the API returns
429with theRetry-Afterheader.
Headers
x-api-keystringrequiredx-api-secretstringrequiredApi Secret provided on integrations tab in Easyflow platform.
business-idstringrequiredIdentifier of the business the request refers to. The user of your API key must be linked to this business, as explained in The business identifier. A value that is not a business identifier returns
400withInvalid param: [businessId], and a business that the user is not linked to returns403.
Path parameters
subscriptionIdstring · uuidrequiredID of the subscription.
Responses
200The subscription is canceled, or it was already canceled or expired.
The subscription is canceled, or it was already canceled or expired.
Content typeapplication/jsonobject
statusCodeintegerdataobjectShow child attributesHide child attributes
subscriptionIdstring · uuidID of the subscription.
statusstringcanceled, also when the subscription was already canceled, orexpiredwhen the subscription had already finished.
400The subscription does not exist, is not a valid ID or belongs to another business (message Invalid param: [subscriptionId] in all cases).
The subscription does not exist, is not a valid ID or belongs to another business (message Invalid param: [subscriptionId] in all cases).
Content typeapplication/jsonobject
messagestringInvalid param: []
errorstringBad Request
statusCodeinteger400
errorCodestringCode that identifies the error. Present only on some errors.
401The credential is missing or invalid, or the business-id header is missing (message BusinessId is required).
The credential is missing or invalid, or the business-id header is missing (message BusinessId is required).
Content typeapplication/jsonobject
messagestringInvalid field
errorstringUnauthorized
statusCodeinteger401
403The API key has no write access to subscriptions, or its user is not a collaborator of the business sent in business-id.
The API key has no write access to subscriptions, or its user is not a collaborator of the business sent in business-id.
Content typeapplication/jsonobject
messagestringForbidden resource
errorstringForbidden
statusCodeinteger403
429More than 30 requests in a minute for the user (all API keys of the same user share the limit). The message is Too many requests, retry after the Retry-After seconds. Wait the number of seconds in the Retry-After header before sending a new request.
More than 30 requests in a minute for the user (all API keys of the same user share the limit). The message is Too many requests, retry after the Retry-After seconds. Wait the number of seconds in the Retry-After header before sending a new request.
Content typeapplication/jsonobject
statusCodeintegerHTTP status code.
messagestringExplanation of the error.
500If an unexpected condition occurs and the server cannot process the request, the API will return the following error response. This response has no error field.
If an unexpected condition occurs and the server cannot process the request, the API will return the following error response. This response has no error field.
Content typeapplication/jsonobject
statusCodeintegerHTTP status code.
messagestringExplanation of the error.