This page lists the subscription status values the API returns and the webhook events ChaChing sends when automatic payments fail, when they are retried, and when a customer reaches a failed-payment outcome. For the business behavior of each outcome and the settings that control it, see Handle failed subscription payments.
Every request on this page outside the /platform routes authenticates with your account's secret key in the cc-api-key header, or with a platform key in cc-api-key plus the account's id in the Chaching-Account header (see Platforms).
The status field of a subscription returned by GET /subscriptions and GET /subscriptions/{id}, and of every subscription webhook payload, is one of these values:
| Value | Meaning |
|---|---|
active | The subscription has started, and it is not on hold, cancelled, or expired. |
trial | The subscription is in its trial period and is not paused. |
scheduled | The subscription starts on a future date. |
paused | The subscription is on hold for a reason other than the Blocked as unpaid outcome, for example a pause requested through the API or the dashboard. |
unpaid | The subscription is on hold because its customer is in the Blocked as unpaid outcome. |
cancelled | The subscription is cancelled, or its cancellation is scheduled. A cancellation requested through the API or the dashboard reads cancelled at once and takes effect at the end of the period already billed; when nothing was billed yet, it takes effect immediately, or on the start date for a subscription that has not started. A later payment does not restore a subscription cancelled by the Cancelled outcome. |
expired | The subscription reached its end date. |
pausedandunpaidare both holds, and a subscription on hold is not billed. A subscription on hold can readscheduled,cancelled, orexpiredinstead ofpausedorunpaid, and a subscription on hold for the Blocked as unpaid outcome can also readtrialinstead ofunpaid.- A subscription paused through the API during its trial period reads
paused, unless its customer is in the Blocked as unpaid outcome, and readstrialagain after it is resumed while the trial lasts. Itstrial_startandtrial_enddo not change. - Past due is not a status value. The Kept past due outcome does not change
status. - The status value
cancelledis spelled with twols. The webhook event namesubscription.canceledis spelled with one. DELETE /subscriptions/{id}on a subscription that is already cancelled, or has a cancellation scheduled, answers400witherror: SUBSCRIPTION_CANCELLED. On a subscription that has expired it answers400witherror: SUBSCRIPTION_EXPIRED. Neither sends a webhook. A subscription with anend_datethat has not reached it is cancelled normally, at the end of the period already billed.
ChaChing sends invoice.payment_failed for every failed automatic charge, including each scheduled retry, and invoice.payment_succeeded when an automatic charge or a retry succeeds. An automatic charge is one ChaChing's billing engine starts on its own, such as a subscription renewal and its retries.
- A declined automatic charge follows the account's retry schedule: while retries remain, the next retry is scheduled the configured number of days after the previous attempt.
- An automatic charge that fails for a reason other than a decline, such as a processing error at the payment gateway or a result that cannot be confirmed, can follow the retry schedule, be retried at other times, or not be retried, depending on the error.
- The outcome day is the sum of the retry intervals plus one day, and an invoice's age is counted from its invoice date. A subscription renewal invoice that is charged automatically counts toward the outcome from its invoice date. The outcome depends on invoice age, not on retries: a customer with an older unpaid renewal invoice can reach the outcome before the retries of a newer invoice end.
- An invoice created with
collection_method: "send_invoice"does not count toward the outcome while no payment on it has been attempted, even after itsdue_datehas passed. The invoice payload carries that date indue_dateand itscollection_method. An invoice created withsend_invoicebefore the value was recorded readscharge_automatically. After a payment on such an invoice fails, the invoice can count once itsdue_datehas passed, with its age counted from its invoice date, so a failed payment on an invoice that is past itsdue_dateand at least as old as the outcome day can apply the outcome right away. - In the common case of a customer whose only unpaid invoice is a subscription renewal invoice, charged automatically on its invoice date and declined, the default schedule (1, 3, 5, 7) schedules retries on days 1, 4, 9, and 16, and the outcome is applied on day 17.
attempt_countis present on every invoice event. Oninvoice.payment_succeededandinvoice.payment_failedfor an automatic charge, it is the number of attempts made on that charge. On every other invoice event, it is the number of payments recorded on the invoice.next_payment_attemptis present only oninvoice.payment_succeededandinvoice.payment_failedfor an automatic charge. Its value is the Unix timestamp (seconds) of the next scheduled retry, ornullwhen no retry is scheduled.next_payment_attemptis absent frominvoice.payment_succeededandinvoice.payment_failedfor a payment started from the dashboard, the hosted payment page, or the API, from every other invoice event, and from invoice API responses.- An
invoice.payment_failedevent whosenext_payment_attemptisnullmeans no retry is left for that charge. It does not mean an outcome was applied, because the outcome day is counted separately.
The outcome is evaluated per customer, not per subscription.
Subscription events for an outcome are sent per subscription item, not per subscription. A subscription with two items produces two events of the same type with the same subscription id. Handle them idempotently by subscription id: processing the second event of the same type for the same subscription must leave the same result as processing the first.
| Account outcome | Webhook events | Subscription status |
|---|---|---|
| Cancelled | One subscription.canceled for each subscription item the outcome cancels, with reason: "dunning" and initiated_by: "system". No other event is sent for the outcome. | cancelled |
| Blocked as unpaid | One subscription.paused for each item of every subscription of the customer that has not ended, including a subscription whose cancellation is scheduled but not yet effective, with reason: "dunning" and initiated_by: "system". | unpaid; a subscription can read trial, scheduled, cancelled, or expired instead |
| Kept past due | None. | Not changed by the outcome |
- The late-payment warning sends no subscription webhook. A customer's payment plans can report it with
payment_plan.past_due; see Payment Plans. subscription.resumedwithreason: "dunning"andinitiated_by: "system"can be sent when a hold from the Blocked as unpaid outcome ends, and only to subscription items that receivedsubscription.pausedfor that hold. A hold can also end without anysubscription.resumed, so do not rely on it to learn that a hold ended.- A subscription paused through the API or the dashboard before the hold also receives
subscription.pausedfor the hold. A subscription that is paused when the hold ends can receivesubscription.resumed, but it stays paused and is not billed until it is resumed. A pause or resume request made while the customer is in an outcome is rejected; see Subscription Changes During an Outcome. - After an
invoice.payment_succeededfor a customer whose subscriptions are on hold, wait a short time, then re-read the subscription withGET /subscriptions/{id}to learn whether the hold ended. The hold is re-evaluated separately from the payment event, so a read made immediately on receipt can show the state from before the payment. - A pause, resume, or cancellation requested through the API or the dashboard carries
reason: "requested"andinitiated_by: "merchant". subscription.canceled,subscription.pausedandsubscription.resumedare not sent for a subscription that belongs to a payment plan; follow the plan'spayment_plan.*events instead.
While a customer is in any of the three outcomes, a well-formed POST /subscriptions, PATCH /subscriptions/{id}, POST /subscriptions/{id}/pause, or POST /subscriptions/{id}/resume request for that customer is rejected with HTTP 409 and a body whose statusCode is 409 and whose message is Account is blocked pending payment. A request rejected this way does not change the customer's subscriptions. DELETE /subscriptions/{id} is not rejected for this reason, and the late-payment warning does not cause this response.
The subscription write operations can also answer 409 ACCOUNT_INVOICING_SUSPENDED and SUBSCRIPTION_UPDATE_INCOMPLETE. POST /subscriptions/{id}/pause answers 400 SUBSCRIPTION_ALREADY_PAUSED for a subscription that is already paused, and POST /subscriptions/{id}/resume answers 400 SUBSCRIPTION_NOT_PAUSED for one that is not. A 500 with error SUBSCRIPTION_READ_AFTER_WRITE_FAILED means the change was applied but the subscription could not be read back; read it again with GET /subscriptions/{id} instead of repeating the write. Pause, resume and cancel answer the Subscription object as read right after the change; its status reflects the change within a few seconds, so read the subscription again to confirm it.
Collect or void the customer's outstanding invoices first. The outcome is re-evaluated separately from a payment, so a request made immediately after the customer pays can still be rejected; wait a short time, then repeat it.
The API exposes no field that states whether a customer is in an outcome, and the failed-payment indicator the dashboard shows for a customer is not available through the API or in webhook payloads. Treat a customer as in an outcome while any of the customer's outstanding invoices is at least as old as the outcome day, counted from its invoice date.
ChaChing sends emails to the customer, with a copy to the account's first super admin user when the account has one, for failed automatic charges and retries and for applied outcomes. No email is sent for the late-payment warning, when the customer pays, or for a payment started from the dashboard, the hosted payment page, or the API. The subjects, the content, and when a customer receives no email are listed in Handle failed subscription payments.
| State | How to detect it |
|---|---|
| An automatic charge failed and a retry is scheduled | invoice.payment_failed with a non-null next_payment_attempt |
| No retry is left for a charge | invoice.payment_failed with next_payment_attempt set to null; this alone does not mean an outcome was applied |
| Subscriptions cancelled for non-payment | subscription.canceled with reason: "dunning", per subscription item; status is cancelled |
| Subscriptions on hold for non-payment | subscription.paused with reason: "dunning", per subscription item; status is unpaid, or can be trial, scheduled, or cancelled |
| Subscriptions past due | No event and no status value; the outcome does not change status |
| The customer paid | invoice.payment_succeeded; after a short delay, re-read the subscription to learn whether a hold ended. subscription.resumed with reason: "dunning" is not sent for every hold that ends; see Events for Failed-Payment Outcomes |
| Late-payment warning | For a customer who holds a payment plan, payment_plan.past_due for each plan that changes to past_due, whose status then reads past_due. The subscription API and the subscription webhooks do not expose it |
| Invoice labeled uncollectible | Not exposed by the API or webhooks |
| Invoice written off | invoice.written_off; the Invoice object reads collection_status: written_off |
The retry schedule and the outcomes are configured in the dashboard, on the Invoices & Subscriptions settings page, and through the API with GET /revenue-recovery and PUT /revenue-recovery. The dashboard page and the API write the same settings, so a change made through one is visible in the other. See Invoices & Subscriptions.
GET /revenue-recovery returns the account's current settings. The publishable key works only on the ChaChing hosted checkout pages; every API operation outside /platform answers it 403 SECRET_API_KEY_REQUIRED. Send no Authorization header (see API Basics).
Response:
{
"payment_retries": [1, 3, 5, 7],
"subscription_state_on_payment_failure": "cancel",
"invoice_state_on_payment_failure": "uncollectible",
"outcome_day": 17
}| Field | Meaning |
|---|---|
payment_retries | The retry schedule. Each value is the number of days after the previous attempt at which the next retry is scheduled. |
subscription_state_on_payment_failure | What happens to the customer's subscriptions when the outcome applies: cancel (Cancelled), unpaid (Blocked as unpaid), past-due (Kept past due). |
invoice_state_on_payment_failure | What happens to the unpaid invoices of a customer whose subscriptions the outcome cancels: uncollectible (Labelled uncollectible), past-due (Left open as past due). |
outcome_day | The sum of payment_retries plus one: the day, counted from the invoice date of the customer's oldest unpaid invoice that counts, on which the outcome is applied. |
Which invoices count, and how the days are counted, is described in Handle failed subscription payments.
GET /revenue-recovery returns 404 for an account that has no settings yet.
PUT /revenue-recovery replaces all three settings at once. Every field is required, and a request that omits one is rejected with 400.
Request body:
{
"payment_retries": [2, 4, 8],
"subscription_state_on_payment_failure": "unpaid",
"invoice_state_on_payment_failure": "past-due"
}The response body has the same shape as GET /revenue-recovery, with outcome_day recomputed from the schedule you sent — 15 for the request above.
payment_retriesholds at least one value, and every value is an integer of0or greater.payment_retriesholds at most 10 values. A request with more is rejected with400.subscription_state_on_payment_failureis one ofcancel,unpaid,past-due.invoice_state_on_payment_failureis one ofpast-due,uncollectible.- On an account with Payment Plans enabled, or holding a payment plan that has not ended,
payment_retriesmust sum to at least 7 andsubscription_state_on_payment_failurecannot beunpaid; a request that breaks either rule is rejected with400:REVENUE_RECOVERY_UNPAID_NOT_ALLOWED_WITH_PAYMENT_PLANSforunpaid,REVENUE_RECOVERY_RETRY_SUM_BELOW_PLAN_MINIMUMfor a schedule that sums to less than 7. See Payment Plans. outcome_dayis read-only. A request body that carries it is rejected with400.- A rejected request changes nothing: the settings stay as they were.
The settings apply to your whole account — every subscription and every payment plan — and there are no per-customer settings. Saved settings also apply to customers who already have unpaid invoices: shortening the schedule moves the outcome day earlier, and a customer with an unpaid invoice already at least as old as the new outcome day can reach the outcome soon after you save; lengthening it moves the outcome day later, and a customer already on hold or past due can be released before paying. Subscriptions that were already cancelled stay cancelled. You can change subscription_state_on_payment_failure at any time; customers already in the previous outcome move to the new outcome on the next evaluation. For the full guidance, see Handle failed subscription payments.
For the full request and response schemas, see the API Reference.
For every field of the webhook payloads, see Webhooks.