Skip to content

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

ParameterTypeDescription
idstringThe recurring charge ID, prefixed with arch_.

Behavior

  • status stays active and period_ends_at does not change.
  • canceled_at is set to the end of the current period.
  • The scheduled job sets status to canceled when period_ends_at is 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

json
[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

StatusReason
404The charge does not exist, or it does not belong to your app and the current store.
422The charge is not active, so it cannot be canceled.
422The charge is already scheduled for cancellation.

Webhooks

app.charge_updated fires twice for an at-period-end cancellation:

  1. On cancellationstatus: "active", a future period_ends_at, and canceled_at set.
  2. At period endstatus: "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.