Admoji does not include a hosted cancellation page, but you can build one on your own site with the Open API and tell its cancellations apart from the ones your agents make.
Step 1: Find the Customer's Subscriptions
GET https://openapi.admoji.com/api/v2/open/recurrings/{customerId} returns the customer's recurring subscriptions with their RecurringID.
Step 2: Cancel the Subscriptions
POST https://openapi.admoji.com/api/v2/open/recurrings/deactivate
$ curl -X POST 'https://openapi.admoji.com/api/v2/open/recurrings/deactivate' \
-H "Authorization: ApiKey secret_492796e421a34666a5695d53cd311111" \
-H "Content-Type: application/json" \
-d '{
"CustomerID": 16342842,
"RecurringIDs": [2727073]
}'
Leave out
RecurringIDsto cancel every subscription of the customer.If the customer has no subscriptions, the call fails with Customer has no recurrings.
If you have a Recurring Cancellation autoresponder set up, the customer receives it.
/recurrings/deactivate, not /customers/mark-cancelled. Mark-cancelled flags the whole customer as cancelled and reports the same cause as the CRM button, so you lose the distinction between your page and your agents.Step 3: Identify the Cancellations from Your Page
Every cancellation sends a RecurringDeactivated webhook. Its Cause field tells you where the cancellation came from:
OpenApiCancel— cancelled through/recurrings/deactivate, which is your page.ManualCancel— an agent cancelled the subscription from the CRM.MarkCancelled— the customer was marked as cancelled, from the CRM or through/customers/mark-cancelled.ContinuityReport— cancelled in a batch from the Continuity report.ChargebackorMarkChargeback— cancelled because of a chargeback, through the API or from the CRM.Decline— dropped after the last failed retry. This is not a customer cancellation.
{
"EventType": "RecurringDeactivated",
"Cause": "OpenApiCancel",
"CustomerID": 16342842,
"DeactivatedRecurrings": [{ "RecurringID": 2727073 }],
"CustomerRecurrings": [{ "RecurringID": 2727073, "Amount": 19.99, "Product": "Monthly Plan", "IsActive": true }]
}
DeactivatedRecurrings. The IsActive flag inside CustomerRecurrings belongs to the product, not to the subscription, so it can still read true right after a cancellation.OpenApiCancel. To mark the cancellations from your page on their own, add a customer note in the same flow with POST https://openapi.admoji.com/api/v2/open/customers/notes/{customerId}.Related articles