Change plan & cancel

Changing plan is a new subscription that replaces the current one; cancelling answers at once and finishes in the background.

Change plan

Create the new subscription with "replaces": the current subscription id. When the new one becomes active the broker cancels the old one right away; if the customer abandons the checkout, nothing changes.

POST https://pay.contagorda.com/api/v1/subscriptions
{ "amount": "99.00", "currency": "BRL", "interval": "month", "replaces": "<current subscription id>", … }

Cancel

POST https://pay.contagorda.com/api/v1/subscriptions/:id/cancel
{ "at_period_end": true }

at_period_end defaults to true; send false to end it now. The call answers 202 Accepted right away:

202 Accepted
{
  "id": "…",
  "status": "active",
  "cancel_requested_at": "2026-09-23T21:17:22Z",
  "cancel_at": "2026-10-23T00:00:00Z",
  "links": { "self": "https://pay.contagorda.com/api/v1/subscriptions/…" }
}
  1. 1status answers "does the customer have access?": it stays active until the subscription really ends.
  2. 2cancel_at says when ("your plan ends on …"); it returns to null if the customer takes the cancellation back.
  3. 3Webhooks: subscription.canceling when the request is taken, subscription.canceled when it ends.
  4. 4A cancellation scheduled on the gateway's own dashboard sends no subscription.canceling: it arrives as subscription.updated with cancel_at set.

Take a cancellation back

POST https://pay.contagorda.com/api/v1/subscriptions/:id/resume

Until cancel_at arrives, the customer can keep the plan: the same subscription keeps renewing on the same day and card, with no new checkout and no second charge. The call answers 202 Accepted with the subscription, cancel_at back to null, and the app hears subscription.resumed. A cancellation that ends the subscription now cannot be taken back.

Are you sure?

Keyboard shortcuts

⌘ KSearch and navigate⌘ JOpen and close the Workbenchg hHomeg pPaymentsg cCustomersg sSubscriptionsg aAppsg gGateways?This listEscClose