Guides
Failed renewals and retries
What happens when a renewal is declined. The retry schedule (+1, +3, +7 days by default, at most 8 retries), hard declines that are never retried and block the card, the per-card attempt ceilings, the final action, and what your app should do at each step.
When a renewal charge is declined, ZeroPoint retries it on a schedule, never more often than the card networks allow, and then takes the merchant's final action. Your app tells the customer and offers a way to pay with another card. ZeroPoint sends no email to your customers.
In this release the schedule runs when you advance a test clock; nothing renews or retries on real time yet (Test your billing with test clocks and failure injection).
Three outcomes, and only one is a decline
A charge is captured, declined, or unknown. Only a proven decline starts the steps below. An unknown outcome (a timeout, an answer that cannot be confirmed) is a hold: the invoice stays open with collection_status: reconciling, the subscription keeps its status with payment_hold set, nothing is counted and nothing is retried until the outcome is proven (Subscriptions and invoices). A duplicate_transaction answer (the processor's duplicate screen) is never counted as a decline and never retried automatically.
The schedule
- Before it you receive
invoice.upcoming(3 days before the renewal, by default; the merchant'supcoming_days, 0 for none) and acustomer.subscription.updatedwhoselatest_invoicenames the new renewal invoice. The renewal is declined. The invoice staysopen, the subscription becomespast_due, and you receivepayment.failed,invoice.payment_failedwithattempt_count(1),next_payment_attempt(Unix seconds) andlast_payment_error(code,decline_codewhen the issuer gave one), thencustomer.subscription.updated.latest_invoiceon the subscription names that open invoice (it is set when the renewal invoice is created, as on Stripe);GET /v1/invoicesfiltered bysubscriptionandstatus: open(MCPlist_invoices) lists it too. - Retries run at the first decline plus 1 day, plus 3 days and plus 7 days (the default
retry_offsets_sis[86400, 259200, 604800]). Offsets count from the first decline, not from the previous retry, and two charges of one invoice are always at least 1 day apart, also after downtime or a long hold. Each declined retry sendspayment.failedandinvoice.payment_failed;attempt_countrises by one per retry slot, and also by one for each declined manual payment of the invoice (POST /v1/invoices/{invoice_id}/payor the portal's Pay now), which never uses up a retry slot. - A retry that is captured pays the invoice (
invoice.paid,invoice.payment_succeeded), moves the period forward and returns the subscription toactive. The billing anchor does not move. - The last retry that is declined ends it at once. In the same change you receive the final
invoice.payment_failedwithnext_payment_attempt: null, and the merchant's final action runs:cancel(default):invoice.marked_uncollectible(the invoice isuncollectible) andcustomer.subscription.deleted(the subscription iscanceled). By the time these events reach you, the invoice can no longer be paid.unpaid: no more retries; the subscription isunpaidand the invoice stays payable until its period ends (the customer's Pay now in the portal,POST /v1/invoices/{invoice_id}/pay, MCPpay_invoice; a captured payment makes the subscriptionactiveagain), then it is marked uncollectible and the subscription canceled.
With the defaults, a declined renewal therefore ends 7 days after the first decline, at the third retry. Send your last-chance notice on the retry before the last one: the invoice.payment_failed whose next_payment_attempt is the last slot (the +3 day failure with the default schedule).
An invoice is never charged after its period has ended: there are no catch-up charges for a period the customer did not get.
payment_intent on an invoice is the pay_... id of the newest attempt that resolved with a payment. It changes with every attempt (older Stripe versions kept one intent per invoice), it can name a payment that is final and failed, and it is null while the first attempt is still in flight. To recover, pay the invoice again (POST /v1/invoices/{invoice_id}/pay, MCP pay_invoice, or the portal) with a new card; never confirm the named payment. On a held invoice (collection_status: reconciling) the named payment can read failed while money may still stand: read the invoice's own status, not the payment's, before charging another card.
GET /v1/billing_settings (MCP get_billing_settings) shows a merchant's ladder and final action. POST /v1/billing_settings changes final_action (cancel or unpaid) freely, and the schedule anywhere within the merchant's limit, in either direction:
retry_offsets_s: the limit is the default ladder's (at most 3 retries, no wait shorter than 1 day) unless ZeroPoint set another for the merchant. A list with more retries than the limit, or whose shortest wait (the first offset, or the gap between two offsets) is shorter than the limit's, answers400 parameter_invalidnaming the limit. Anything inside it is accepted, so after[172800, 345600]the default[86400, 259200, 604800]can be set again. Offsets are strictly increasing, and the last comes before the shortest billing interval in use ends: with monthly prices, within 28 days.min_retry_gap_s(the least time between two charges of one invoice, 1 day by default): at least the merchant's limit (1 day unless ZeroPoint set more), up to 7 days, and back down to the limit.- ZeroPoint support sets a merchant's limit, tighter or looser (up to 8 retries, each from 1 hour to 60 days after the first decline, the last within 28 days).
subscription_guard(productby default;off,price,productorcustomer): a customer you identify may not start a second live subscription to the same price, the same product, or (undercustomer) anything at this merchant, and unless it isoffevery subscription checkout must name the buyer (Sell a subscription in five calls, step 0, has the request and the refusals; Hosted checkout has the full rules).
Both routes name the merchant the way every route does: merchant_id (query on GET, body on POST), or the ZeroPoint-Account header (Stripe-Account is accepted too). Both at once must name the same merchant, else 400 parameter_invalid. With neither, a platform with one merchant in the key's mode uses it, and one with more answers 400 parameter_invalid naming both ways. POST needs an Idempotency-Key.
Billing settings
GET /v1/billing_settings answers every field below; POST answers the same object after the change. You set the fields marked "you"; the others are shown so your code can read them, are set only by ZeroPoint support, and a POST that sends one answers 400 parameter_invalid.
| Field | Who sets it | What it does |
|---|---|---|
object, merchant_id, livemode | billing_settings, the merchant, and whether it is a live merchant | |
timezone | you | IANA time zone, default UTC. Renewal dates, and the dates the checkout page and the portal show the customer, are days in this zone. A subscription keeps the zone it was created with |
retry_offsets_s | you, within the limit | Seconds after the first failed renewal at which to retry, default [86400, 259200, 604800] |
min_retry_gap_s | you may raise it | The least time between two charges of one invoice, default 86400 |
final_action | you | cancel (default) or unpaid, run when the last retry fails |
upcoming_days | you | Days before a renewal that invoice.upcoming is sent, 0 to 30, default 3; 0 turns it off |
portal | you | Switches for the hosted portal: cancel, update_card, invoice_history (all true by default), and keep_plan (undo a scheduled downgrade; when not set it follows cancel) |
subscription_guard | you | off, price, product or customer. See above. Default product |
ended_period_grace_s | ZeroPoint | How long after a renewal period ends its invoice may still be charged. Default 0: never after the period ends |
duplicate_spacing_s | ZeroPoint | Retries never send two charges of one amount on one card closer together than this, so the processor's duplicate check does not refuse them. Default 3600 |
duplicate_screen_action | ZeroPoint | What happens when the processor refuses a renewal as a duplicate: hold (default; the invoice waits for ZeroPoint to check it) or retry_after (retried once duplicate_retry_s has passed) |
duplicate_retry_s | ZeroPoint | The wait for retry_after, default 3600 |
reversal_action | ZeroPoint | record_only, the only value: a refund or void of an invoice payment is recorded and never cancels or changes the subscription |
incomplete_expiry_s | ZeroPoint | How long a subscription created with POST /v1/subscriptions stays incomplete waiting for its first payment before it becomes incomplete_expired. Default 82800 (23 hours) |
min_proration_cents | ZeroPoint | A plan-change charge below this is not charged now; it is added to the next renewal. Default 50 |
customer_emails | ZeroPoint | Reserved for a later release and normally {}. It has no effect: ZeroPoint sends no email to your customers, so renewal reminders, receipts and failed-payment emails are yours to send (from invoice.upcoming, invoice.paid and invoice.payment_failed) |
renewals_paused | ZeroPoint | true while ZeroPoint support has paused this merchant's billing: no renewal is charged and no new subscription starts until it is lifted |
Hard declines: never retried, and the card is blocked
Some declines can never be approved: lost_card, stolen_card, pickup_card, invalid_account, revocation_of_authorization and the like. On a hard decline:
- that card is never sent again for the invoice. A lost, stolen or closed card is blocked for every subscription at the merchant; a revoked authorization blocks that subscription (the table below has every code).
last_payment_error.requires_new_payment_methodistrueanddecline_codenames the reason.POST /v1/invoices/{invoice_id}/payand the portal's Pay now on that invoice answer402 payment_method_blockedwith nothing sent. For a lost, stolen or closed card, a new subscription or an upgrade on that card answers the same. Saving the same card again does not unblock it.- The payment method itself does not show the block: it still reads
status: active, because a card blocked for one subscription or invoice can still be good for others. Read the block from the invoice (last_payment_error.requires_new_payment_methodanddecline_code) or from the402 payment_method_blockedanswer, and ask the customer for another card. - The schedule keeps running, as on Stripe:
next_payment_attemptstays set andattempt_countcounts retry slots (and declined manual payments), but a slot is skipped while the card is blocked. A different card saved as the default is charged at the next slot.
Never show lost_card, stolen_card or pickup_card to the cardholder. Say the card was declined and ask for another card.
How far a block reaches
The decline code decides the scope of the block, and a block is matched by the card itself (brand, last four and expiry at the merchant), not by the pm_... id, so saving the same card again under a new id is still blocked:
| Scope | Decline codes | What is refused |
|---|---|---|
| card | lost_card, stolen_card, pickup_card, incorrect_number, invalid_account (closed account), revocation_of_all_authorizations | This card at this merchant: every invoice, every subscription, new subscriptions and upgrades, scheduled retries and Pay now |
| subscription | revocation_of_authorization, stop_payment_order | This card for the subscription that caught it (every invoice of it) |
| invoice | transaction_not_allowed, restricted_card | This card for that one invoice |
How a block is lifted
- A different card ends the problem for the customer: save it, make it the subscription's
default_payment_method, then pay the open invoice now (pay_invoice, or the portal) or wait for the next retry slot. The old card stays blocked. - In the sandbox you cannot rehearse "save a different card" with
tok_visa: everytok_visacard is the same card (Visa 0010, 12/2034), and a block is matched by the card, so a card-scope hard decline (lost_card,stolen_card, the first row of the table above) on onetok_visacard of a test merchant blocks everytok_visacard of that merchant, other customers' and newly saved ones included (402 payment_method_blockedon their renewals, onPOST /v1/subscriptionsand on the checkout confirm helper). After a hard-decline rehearsal, calllift_card_block(below) on the card before any other test at that merchant. - A block never expires and is never lifted by time or by saving the card again. In live mode only the ZeroPoint operator can lift one (contact support with the invoice id).
- In test mode,
lift_card_block(POST /v1/test_helpers/payment_methods/{payment_method_id}/lift_card_block) lifts every block of a test card, so a hard-decline rehearsal does not leave the sandbox's approving card blocked for every later test at that merchant. It charges nothing: apast_duesubscription stayspast_due, and its invoice open, until the next retry or Pay now. A live key or a live merchant's card is refused.
Per-card attempt ceilings
Counted per card across every invoice and subscription of one merchant, scheduled retries and manual payments alike:
- 24 hours: at most 10 sends that did not capture (declined, refused, unknown or still processing). A captured payment never counts.
- 30 days: the card's first decline at the merchant is the original; after it, at most 15 reattempts that did not capture. So the original plus 15 reattempts can be declined in 30 days.
A scheduled retry over a ceiling is skipped: the slot is used up with no charge and no event, attempt_count still rises, and the schedule moves on to the next slot. A skipped last slot takes the final action on schedule, with the final invoice.payment_failed (next_payment_attempt: null). So a card at its ceiling gets fewer real charges, but the subscription ends when it would have anyway. Manual payments have their own cap: at most 3 unpaid sends of one card per invoice in 24 hours, 10 per card in 30 days, 60 seconds apart; past it, POST /v1/invoices/{invoice_id}/pay answers 429 invoice_pay_limit with Retry-After.
What your app does
Read billing_reason on every invoice.payment_failed first: only subscription_cycle (a renewal, or one of its retries) is the dunning described on this page. A declined plan change (subscription_update) and a declined first payment (subscription_create) also carry next_payment_attempt: null, and the subscription has not ended.
| Event | Do |
|---|---|
invoice.payment_failed with next_payment_attempt set | Email the customer: the payment failed, we will retry on that date, update your card here (your account page, which opens the portal). When next_payment_attempt is the last slot, make this the last-chance notice |
invoice.payment_failed with last_payment_error.requires_new_payment_method: true | Ask for another card now; retries on this card will not succeed |
customer.subscription.updated to past_due | Show a banner. Keep or limit access: your grace policy |
invoice.paid | Clear the banner. Access stays or returns |
invoice.payment_failed with next_payment_attempt: null and billing_reason: subscription_cycle | The plan has ended (final action cancel) or stopped retrying (unpaid); customer.subscription.deleted or .updated arrives in the same change. Do not send a pay link with the default cancel: the invoice is already uncollectible |
invoice.payment_failed with billing_reason: subscription_update | A plan change was declined. The plan is unchanged, invoice.voided follows and nothing is owed. Tell the customer the change did not go through. Not a renewal failure: the table above does not apply |
invoice.payment_failed with billing_reason: subscription_create | The first payment of POST /v1/subscriptions was declined. The subscription is incomplete; ask for another card and pay latest_invoice within 23 hours, at least 60 seconds after the decline |
customer.subscription.deleted | Revoke access |
A change of payment_hold only | Nothing. A charge is being confirmed |
Paying now instead of waiting
When the customer has a new card, let them pay at once. Either send them to the portal (Pay now on the open invoice), or from your server:
MCP: pay_invoice with invoice_id, request_key and payment_method. It answers 200 only with the invoice paid; any other outcome is an error that names the invoice and the payment. A decline here never uses up a scheduled retry. Every final answer is kept under the key: after the customer changes the card, send a new key. An unknown outcome (502 processor_unavailable, 409 invoice_reconciling) is never a decline: retry the same request with the same key, never a new one. To make the new card the default for future renewals, also POST /v1/subscriptions/{subscription_id} with default_payment_method.
Rehearse it
fail_next_charges (POST /v1/test_helpers/payment_methods/{payment_method_id}/fail_next_charges) makes a test card's next billing charges decline without reaching the processor: a soft decline (card_declined) or a hard one (lost_card, stolen_card, revocation_of_authorization, stop_payment_order, transaction_not_allowed), which carries the same processor code as the real decline and so blocks the card in its scope, sets requires_new_payment_method and sends the same events. Lift the block afterwards with lift_card_block. With a test clock you can run subscribe, renew, decline, three retries and the final action in seconds: Test your billing with test clocks and failure injection.