Cancel a Recurring Charge
Cancels an active recurring charge owned by your application. Cancellation is at period end: the seller is not billed for the next renewal, but the charge stays usable until the current billing period ends.
Endpoint: https://api.youcan.shop/billing/apps/charges/recurring/{id}
Method: DELETE
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The recurring charge ID, prefixed with arch_. |
Behavior
statusstaysactiveandperiod_ends_atdoes not change.canceled_atis set to the end of the current period.- The scheduled job sets
statustocanceledwhenperiod_ends_atis reached. - The charge does not renew after the current period.
WARNING
The response returns status: "active" right after you cancel. This is expected — the status only becomes canceled at period_ends_at. Use the canceled_at field to detect a charge that is scheduled for cancellation.
Response
[200]
{
"type": "recurring",
"id": "arch_01234567890abcdef",
"store_id": "...",
"name": "Monthly Subscription",
"status": "active",
"plans": [
{
"interval": 30,
"price": {
"amount": "19.99",
"currency": "USD"
}
}
],
"test": false,
"trial_days": 7,
"created_at": 1640995200,
"period_ends_at": 1643673600,
"canceled_at": 1643673600
}Returns the updated AppRecurringCharge object.
Errors
| Status | Reason |
|---|---|
404 | The charge does not exist, or it does not belong to your app and the current store. |
422 | The charge is not active, so it cannot be canceled. |
422 | The charge is already scheduled for cancellation. |
Webhooks
app.charge_updated fires twice for an at-period-end cancellation:
- On cancellation —
status: "active", a futureperiod_ends_at, andcanceled_atset. - At period end —
status: "canceled".
Canceling on uninstall
Uninstalling an app schedules its active recurring charges for cancellation at period end — the same behavior as this endpoint. To stop a renewal as soon as a seller uninstalls, call this endpoint from your app.uninstalled webhook handler.