{"object":"doc","slug":"coming-from-stripe","title":"Coming from Stripe","summary":"Point the official Stripe SDK at ZeroPoint by changing the base URL and the key. Which billing calls work today, which are refused by name and what to use instead, and the behaviour differences a ported app must handle.","tags":["guide","billing","stripe","migration","subscriptions"],"body":"# Coming from Stripe\n\nZeroPoint answers the Stripe API shapes for the flows below, so code written with the official Stripe SDK keeps working with two changes: the base URL and the key. ZeroPoint is not affiliated with or endorsed by Stripe, Inc. Stripe is a trademark of Stripe, Inc.\n\nProven against `stripe` 23.1.0 and 17.7.0 for Node and `stripe` 17.0.0 for Python, in test mode, by ZeroPoint's own acceptance run. Other versions are untested. Billing runs in test mode in this release ([Subscriptions and invoices](subscriptions.md)).\n\n## Point the SDK at ZeroPoint\n\nNode:\n\n```js\nimport Stripe from 'stripe';\nconst stripe = new Stripe(process.env.ZEROPOINT_KEY, {   // zp_test_...\n  host: 'api.zeropoint.example', port: 443, protocol: 'https',\n  timeout: 120000,\n});\n```\n\nPython:\n\n```python\nimport stripe\nstripe.api_key = os.environ[\"ZEROPOINT_KEY\"]\nstripe.api_base = \"https://api.zeropoint.example\"\n```\n\nUse your ZeroPoint host from the console. Keep the SDK's default retries. Pass `idempotencyKey` (Node) or `idempotency_key` (Python) yourself on every call that charges, refunds or changes a plan, one per order, and keep it with the order so a deliberate retry reuses it. A Stripe SDK sends its own random `Idempotency-Key` on a POST when you pass none (stripe-node sends none when you set `maxNetworkRetries: 0`), so the key requirement below never stops an SDK call: the SDK's key covers only its own network retries, and the same call made again by your code carries a new key and is a new request, run again (a partial refund sent twice this way is two refunds). A plain HTTP client must send the header itself. These calls require one and answer a request without it `400 idempotency_key_required`, never run: `POST /v1/subscriptions`, `POST /v1/subscriptions/{subscription_id}`, `POST /v1/invoices/{invoice_id}/pay`, `POST /v1/refunds`, `POST /v1/payments`, `POST /v1/payments/{payment_id}/cancel`, `POST /v1/payments/{payment_id}/refund`, `POST /v1/payments/{payment_id}/void`, `POST /v1/payment_methods`, `POST /v1/webhooks`, `POST /v1/webhooks/{webhook_id}/rotate-secret`, `POST /v1/billing_settings`, `POST /v1/merchants` and `POST /v1/merchants/{merchant_id}/terminals`. On checkout session create and expire, customer create and the catalog creates a key is optional; with one, a retry replays the first answer.\n\nChoose the merchant with the `stripeAccount` option (it sends `Stripe-Account: mch_...`), or leave it out when the platform has one merchant in that mode. An `acct_...` id is refused.\n\n## What changes in your Stripe code\n\nFor an app that already sells subscriptions through hosted Checkout with the Stripe SDK, call by call. \"Unchanged\" means the call, its fields and the fields you read back keep working once the SDK points here.\n\nBranch on the error code (`err.code` in stripe-node, `e.error.code` in stripe-python), never on the HTTP status. Through the Stripe SDK a refusal caused by the object's state arrives as HTTP 400, a `StripeInvalidRequestError`, so the SDK does not retry it; a plain HTTP client gets 409 for the same code. For example: `subscription_past_due`, `subscription_inactive`, `change_pending`, `not_settled_use_void`, `customer_has_subscriptions`, `subscription_exists`, `invoice_not_payable`, `scheduled_change_not_cancelable`, `already_voided`, `checkout_session_not_open`.\n\nCodes whose outcome is not known yet, or whose object is still moving, stay 409 for both, a `StripeAPIError`. For example: `checkout_outcome_unknown`, `subscription_create_unresolved`, `subscription_changed`, `test_clock_advancing`, and `invoice_payment_in_progress` and `checkout_session_busy` (with `Retry-After`: retry with the same key after the wait). One needs care: `change_not_applied` (409 for both) means the card was charged for a plan change but the plan did not change, because the subscription ended or its period ended before the payment was recorded. Do not charge again and do not retry the change under a new key: read the subscription again, tell the customer the plan did not change, and expect that payment to be voided or refunded, since it is flagged for that ([Errors](errors.md)).\n\n### `checkout.sessions.create` in subscription mode (`POST /v1/checkout/sessions`)\n\n| | |\n|---|---|\n| Runs unchanged | `mode: 'subscription'`, one recurring catalog `price` with `quantity: 1`, `success_url` (with `{CHECKOUT_SESSION_ID}`), `cancel_url`, `customer` or `customer_email` (not both), `client_reference_id`, `metadata`, `subscription_data.metadata`, `allow_promotion_codes` or one `discounts: [{promotion_code}]`, `expires_at`, `payment_method_types: ['card']`, `currency: 'usd'`; Stripe's defaults `billing_address_collection: 'auto'`, `locale: 'auto'`, `submit_type: 'auto'`, `payment_method_collection: 'always'` and `line_items[0][adjustable_quantity]: {enabled: false}` (accepted; they change nothing) |\n| Conditions | The key needs `checkout_sessions:write`, `payment_methods:write`, `subscriptions:write` and `catalog:read`. The price is monthly or yearly with `interval_count` 1. A promotion code that would make the first invoice $0 is refused (`400 parameter_unavailable`, `param` `discounts`) |\n| Change this | Send an `Idempotency-Key` (`idempotencyKey`) per purchase and reuse it on a retry. With more than one merchant, name it with `stripeAccount` (`mch_...`) |\n| Refused, `400 parameter_unknown` naming it | `billing_address_collection`, `locale` or `submit_type` other than `auto`; `adjustable_quantity` with `enabled: true`; `shipping_address_collection`, `shipping_options`, `consent_collection`, `custom_fields`; `phone_number_collection`, `tax_id_collection`, `invoice_creation` or `adaptive_pricing` with `enabled: true` (`enabled: false` is accepted). Remove them |\n| Refused, `400 parameter_unavailable` | `automatic_tax: {enabled: true}` (`{enabled: false}` is accepted); `subscription_data.trial_period_days` and every other `subscription_data` key except `metadata` (no trials yet) |\n| Refused, `400 parameter_invalid` | `payment_method_types` other than `['card']`; `ui_mode: 'embedded'` or anything but `hosted` or `hosted_page`; `customer_creation` in subscription mode (the session creates the customer, unless you send `customer`); `currency` other than `usd`; `quantity` other than 1 (`line_items[0][quantity]`); more than one line. `price_data` in subscription mode is `400 parameter_unavailable`: use a catalog `price` |\n| What comes back | A `checkout.session` with `id` (`cs_...`), `url` (send the buyer there; anyone holding it can open the page), `status: 'open'` and `payment_status: 'unpaid'`. `subscription`, `invoice` and `payment_method` stay null until the session completes, and `payment_intent` is always null in subscription mode, as at Stripe. `checkout_outcome_unknown` (409) means an earlier payment for the same `client_reference_id`, or the same `customer` or `customer_email` and plan, is still being confirmed, and `subscription_create_unresolved` (409) that a first payment for this buyer and plan is: do not open another session. `subscription_exists` (400 through the SDK, 409 to plain HTTP) means the buyer already holds a live subscription the merchant's guard matches, and names it: nothing was created; send the buyer to the portal |\n\nBy default a subscription checkout must name the buyer with `customer`, `client_reference_id` or `customer_email`; one that names none answers `400 customer_identity_required` and nothing is created. `client_reference_id` alone is enough. A merchant who needs anonymous subscription checkout has the platform set `subscription_guard` to `off` with `POST /v1/billing_settings`. A refusal is stored under its Idempotency-Key, so after changing the setting retry under a new key. How the buyer is matched and what else the guard refuses: [Hosted checkout](checkout.md) and [Errors](errors.md).\n\n### `checkout.sessions.retrieve` (`GET /v1/checkout/sessions/{session_id}`)\n\nUnchanged, including `expand` with `line_items`, `customer`, `subscription`, `invoice` and `payment_intent`. Any other `expand` path answers `400 parameter_unavailable`. On your success page read `status` and `payment_status`. Through the Stripe SDK, and on a `stripe_compatible_payload` endpoint, a payment that is still being confirmed reads `status: 'open'` and `payment_status: 'unpaid'`, with the real value in `zeropoint_payment_status: 'processing'`. Show \"confirming\" when `zeropoint_payment_status` is `processing`, never send the buyer to pay again, and wait for `checkout.session.completed`. (A plain HTTP client sees `payment_status: 'processing'` itself.)\n\n### `customers.*`\n\n`customers.create`, `.retrieve`, `.update` and `.list({email})` run unchanged; `metadata` on an update merges per key. `customers.del` is refused while the customer has a subscription that is not `canceled` or `incomplete_expired` (`customer_has_subscriptions`), an open checkout session, or a saved card still in use. `customers.search` is not served (`404 route_not_found`): use `customers.list({email})`. Your Stripe `cus_` ids do not exist here; each ZeroPoint customer is new.\n\n### `billingPortal.sessions.create` (`POST /v1/billing_portal/sessions`)\n\n| | |\n|---|---|\n| Runs unchanged | `customer` and `return_url`; `locale: 'auto'` |\n| Refused with `400` naming the field | `configuration`, `flow_data`, `on_behalf_of`, and any `locale` but `auto`. There is no deep link straight to the cancel page: send the customer to the portal's home |\n| What comes back | `url` works once, for 5 minutes (`expires_at`). Create it when the customer clicks, redirect at once, and never store it, log it or email it |\n| Not available | Plan switching. Build plan changes in your own app with `subscriptions.update`. The portal offers cancel, card change and invoice history as the merchant's `portal` settings allow; undo a cancel and paying an open invoice whenever they apply; and \"keep my plan\" for a cheaper plan scheduled on the same interval (not for annual to monthly) |\n\n### `subscriptions.update` for a plan change (`POST /v1/subscriptions/{subscription_id}`)\n\n| | |\n|---|---|\n| Change this | Pass your own `idempotencyKey` (`idempotency_key`) on `subscriptions.create` and `subscriptions.update`, one per change, and reuse it only to retry that change. The routes require a key: a plain HTTP request without one answers `400 idempotency_key_required`. A Stripe SDK sends a random key of its own when you pass none, so the call runs, and the same call made again by your code is a new change |\n| Upgrade, or monthly to annual | Send `items: [{id: 'si_...', price}]` with `proration_behavior: 'always_invoice'`; without it the answer is `400 proration_behavior_required`. The difference is charged now, and the plan switches only after that charge is captured: until then `pending_update` shows the new price and the customer keeps the old plan. A proven decline (`402`, `StripeCardError`) leaves the plan unchanged; an unknown outcome is `processor_unavailable` (502) or `invoice_reconciling` (409), a `StripeAPIError`: retry with the same key. A difference under the minimum charge (50 cents by default) switches the plan at once and adds the difference to the next renewal. A `past_due` or `unpaid` subscription answers `subscription_past_due`, one set to cancel at period end `subscription_inactive`, and a second change while one is being paid `change_pending` (each 400 through the SDK, 409 to plain HTTP). While an invoice payment is on the wire the answer is `invoice_payment_in_progress` (409 for both, `Retry-After`) |\n| Downgrade, or annual to monthly | A plain update with `items`. It is scheduled for the period end by itself: the answer is `200` with the items unchanged and `scheduled_change: {price, effective_at, blocked_by}`, and nothing is charged now (`blocked_by`, a ZeroPoint field, is `null` unless the duplicate guard would refuse the change at the renewal) |\n| Not available | Subscription Schedules: use the update above. `proration_behavior` other than `always_invoice` (`400 proration_behavior_unsupported`; a downgrade may leave it out) and `payment_behavior: 'allow_incomplete'` (`400 parameter_invalid`) are refused |\n\nShow the exact charge first with `POST /v1/invoices/create_preview`. Details: [Upgrades, downgrades and cancel](upgrades-downgrades-and-cancel.md).\n\n### `subscriptions.update({cancel_at_period_end})`\n\nUnchanged on an `active` subscription: it stays `active` until `current_period_end`, then ends with `customer.subscription.deleted`; `false` undoes it. Different on a `past_due`, `unpaid` or `incomplete` subscription: `true` cancels it now (there is no paid period to wait for), where Stripe waits for the period end. On an `incomplete` subscription whose first payment is still being confirmed, the cancel takes effect when that payment resolves. While a cancel is pending a scheduled downgrade reads `scheduled_change: null` and comes back if the cancel is undone, unless its date has passed meanwhile: then it is dropped.\n\n### Webhooks\n\nThere is no dashboard: register each endpoint once with `POST /v1/webhooks`, a JSON body with an `Idempotency-Key` and no `Stripe-Account` header (call it with `fetch`, not the SDK's `webhookEndpoints`), with `url`, `event_types` listing every billing type you handle (billing events are opt-in: an empty list gets payment events only), `stripe_signature_header: true` and `stripe_compatible_payload: true`. Keep the `whsec_` secret from that answer: it is shown once. `stripe.webhooks.constructEvent(rawBody, req.headers['stripe-signature'], whsec)` then works unchanged.\n\nOn invoices, `hosted_invoice_url`, `invoice_pdf` and `customer_email` do not exist: link to your own billing page and read the email from your own customer record. `id`, `number`, `customer`, `subscription`, `status`, `billing_reason`, `amount_due`, `amount_paid`, `currency`, `period_start`, `period_end`, `lines`, `next_payment_attempt`, `last_payment_error` and `payment_intent` (a `pay_...` id, null while the first attempt is in flight) are there. The upcoming invoice of `invoice.upcoming` has no `id`, `number`, `status`, `payment_intent` or `last_payment_error`. Gate entitlements on the subscription's `status`, never on `current_period_end`: the period moves only when a renewal is captured. Event by event: [Billing events reference](billing-events.md).\n\n### `refunds.create`\n\n`refunds.create({payment_intent, amount})` (`POST /v1/refunds`) is for a payment that has settled; `payment_intent` is the `pay_...` id on the invoice. Before settlement, void the payment instead (`POST /v1/payments/{payment_id}/void`): that is the rule, and ZeroPoint never turns one into the other. ZeroPoint does not check settlement before a refund: it sends the refund to the processor, and the sandbox processor accepts a refund of an unsettled sale (`200`, `succeeded`). Only when the processor rejects the refund as not settled is the answer `not_settled_use_void` (HTTP 400 through the Stripe SDK, 409 to a plain HTTP client); then explain it and get the merchant's approval before you void ([Refunds and voids](refunds-and-voids.md)). `metadata`, `refund_application_fee`, `reverse_transfer` and `instructions_email` are refused (`400 parameter_unknown` through the SDK, `parameter_invalid` to plain JSON): remove them. `charge` is not accepted (`400 parameter_unavailable`): there are no charge objects. A refund never cancels the subscription.\n\n### Not available today\n\n| Stripe | Closest path |\n|---|---|\n| Sales tax calculation (`automatic_tax`, tax rates) | The merchant handles tax; prices are charged as they are |\n| Wallets and bank payments on a subscription | A subscription is charged on a card typed into the hosted page; nothing else |\n| Emailed receipts, invoices, renewal reminders and dunning emails | ZeroPoint sends no email to your customers. Send your own from `invoice.upcoming`, `invoice.paid` and `invoice.payment_failed` ([Billing events reference](billing-events.md), Customer emails) |\n| Moving existing Stripe subscribers and their saved cards | Not possible: saved cards cannot leave Stripe. Keep existing subscribers on Stripe and send new signups to ZeroPoint |\n\n### Running Stripe and ZeroPoint side by side\n\nZeroPoint ids use the same prefixes as Stripe's: `cus_`, `sub_`, `price_`, `cs_`, `in_`, `evt_`, `pm_`, `prod_`. An id cannot tell you which provider it belongs to. Store the provider beside each customer and subscription in your own records when you create them, and route every call, portal link and webhook by that column, never by the id. Use separate webhook URLs (or `stripe_signature_header: false` on a URL Stripe still delivers to), so each payload is verified with its own provider's secret.\n\n## What works\n\n| Area | Calls |\n|---|---|\n| Catalog | `products.create`, `.retrieve`, `.update`; `prices.create` (monthly, yearly, one-time), `.retrieve`, `prices.list({lookup_keys})`; `coupons.create`; `promotionCodes.create`, `promotionCodes.list({code})` |\n| Customers and cards | `customers.create`, `.retrieve`, `.update` (metadata merges per key), `customers.list({email})` with paging and `autoPagingToArray`; `paymentMethods.list({customer, type: 'card'})`, `customers.listPaymentMethods`, `paymentMethods.detach` |\n| Checkout | `checkout.sessions.create` with `mode: 'payment'` or `mode: 'subscription'` (`subscription_data.metadata`), `.retrieve` (also `expand: ['line_items']`), `.listLineItems`, `.expire` |\n| Subscriptions | `subscriptions.create`, `.retrieve`, `.list({customer, status: 'all'})`, `.update` for `cancel_at_period_end` true or false, an upgrade with `proration_behavior: 'always_invoice'`, and a downgrade (applied at period end) |\n| Invoices | `invoices.retrieve`, `invoices.list({customer})` and `({subscription})` with paging, `invoices.pay`, `invoices.voidInvoice` |\n| Portal | `billingPortal.sessions.create` |\n| Payments and refunds | `paymentIntents.retrieve` and `.list` (read only: a `pay_...` payment in Stripe's PaymentIntent shape); `refunds.create({payment_intent, amount})`, full or partial, through `POST /v1/refunds` (it never voids; void an unsettled payment yourself, and `not_settled_use_void` comes back only when the processor rejects a refund as not settled) ([Refunds and voids](refunds-and-voids.md)) |\n| Expand | `expand` on subscriptions, invoices, prices and checkout sessions, on reads and on the writes that return them (`subscriptions.create`, `.update`, `invoices.pay`, `checkout.sessions.create`), each with a fixed list of paths ([API conventions](api-conventions.md)) |\n| Webhooks | `webhooks.constructEvent` with the `Stripe-Signature` header, once the endpoint has `stripe_signature_header: true` |\n| Errors | `StripeCardError` for a proven decline (with `decline_code` only when the processor gave one), `StripeInvalidRequestError` for a bad or unknown parameter and a missing id, `StripeIdempotencyError` for a key reused with another body, `StripeAuthenticationError`, `StripeRateLimitError`, `StripeAPIError` for an unknown outcome |\n| Retries | A same-key retry after a 502, a lost answer or a dropped connection replays the first answer and never sends a second charge |\n\nSubscription checkout here checks for duplicates by customer record: reuse one `cus_` per user (Stripe code often creates a customer per checkout; here each new record is a new buyer to the duplicate guard), or send your user id as `client_reference_id` ([Sell a subscription in five calls](build-subscriptions.md), step 0).\n\nSaving a card is not a Stripe SDK call: the card is typed on ZeroPoint's hosted card form and saved with `POST /v1/payment_methods` ([Save a card](save-a-card.md)). Hosted Checkout in subscription mode saves it for you.\n\n## Refused by name, with what to use instead\n\nA parameter ZeroPoint does not support is refused with a `400` naming it in `param`; it is never silently ignored. Through a Stripe SDK the code is `parameter_unknown` (or `parameter_unavailable` where the table says so). A plain JSON client gets `parameter_invalid` for a body field the route does not have, except on checkout session create, which answers `parameter_unknown` to every client. A Stripe resource ZeroPoint does not serve answers `404 route_not_found` with a message that says what to use.\n\n| Stripe | Answer | Use instead |\n|---|---|---|\n| SetupIntents, Sources, card tokens, Elements, embedded checkout (`ui_mode` other than `hosted`) | Refused | Hosted Checkout (`session.url`), or the hosted card form and `POST /v1/payment_methods` |\n| Creating, confirming or capturing PaymentIntents (`/v1/payment_intents`) | Refused | Hosted Checkout, a saved-card payment (`POST /v1/payments` with `method: card_on_file`) or a subscription |\n| Charges | Refused | `GET /v1/payments`, `POST /v1/payments/{payment_id}/refund` |\n| `refunds.create` on an unsettled payment | Sent to the processor as a refund; `not_settled_use_void` only if the processor rejects it as not settled | `POST /v1/payments/{payment_id}/void` before settlement |\n| Subscription Schedules, subscription items on their own | Refused | `subscriptions.update` with `items`: a downgrade waits for the period end by itself |\n| `invoices.retrieveUpcoming` (`/v1/invoices/upcoming`) | Refused | `POST /v1/invoices/create_preview` with `subscription` |\n| `invoices.createPreview` with `subscription_details` (preview a plan change) | Supported for one item: `subscription_details.items[0]` (`id`, `price`), `proration_behavior`, `proration_date`. Other `subscription_details` fields are refused (`parameter_unknown` through a Stripe SDK, `parameter_invalid` to plain JSON) | The answer adds `plan_change` (`amount_due_now`, `effective_at`, `credit_not_kept`) and, when nothing is due now, `next_invoice`. A credit larger than the charge previews `total: 0` (Stripe shows a negative total and keeps the credit on the customer balance; ZeroPoint has no balance and does not keep it) |\n| `invoices.createPreview` for a new subscription (`customer` and `subscription_details.items`, no `subscription`) | Refused, `param` `subscription` (`parameter_missing` through a Stripe SDK, `parameter_invalid` to plain JSON) | Show the price from the catalog; the first invoice is the price less the promotion |\n| `invoices.listLineItems` (`/v1/invoices/{id}/lines`) | Not served (`404 route_not_found`) | `invoice.lines.data`: every line is on the invoice and `lines.has_more` is always `false`. `lines.url` keeps Stripe's shape only; nothing answers at it |\n| `discounts` on `subscriptions.create` | Refused | `promotion_code: promo_...` |\n| Tax rates, `automatic_tax: {enabled: true}` | Refused | The merchant handles tax |\n| Trials (`trial_period_days`, `trial_end`), `billing_cycle_anchor`, `pause_collection`, quantities above 1, a second item, metered or tiered prices, `collection_method: send_invoice` | Refused | Not available yet |\n| An upgrade without `proration_behavior`, or `proration_behavior` other than `always_invoice` | Refused | Send `always_invoice`: the difference is charged now (Stripe's default bills it on the next invoice) |\n| `payment_behavior: 'allow_incomplete'` on an update | Refused | Leave it out: the plan changes only after the payment is captured (Stripe's `pending_if_incomplete`) |\n| `expand` outside the routes and paths in [API conventions](api-conventions.md) | Refused (`parameter_unavailable`) | Retrieve the related object by its id |\n| Portal configurations | Refused | The portal's settings are the merchant's |\n| `/v1/webhook_endpoints` | Refused | `POST /v1/webhooks` |\n| Search endpoints | Refused | The list endpoint with its filters |\n| Payment Links, credit notes | Refused | A checkout session's `url`; a refund |\n| Connect (`acct_` ids, application fees, transfers) | Refused | `Stripe-Account: mch_...` |\n\nYour Stripe object ids (`cus_`, `price_`, `sub_`) do not exist here. Recreate the catalog with `import_stripe_catalog` ([Migrate your Stripe catalog](migrate-from-stripe-catalog.md)); lookup keys are kept, so `prices.list({lookup_keys})` keeps working, with one change when your platform has more than one merchant: send the merchant on the call, with the `stripeAccount` option (stripe-node `prices.list({lookup_keys: ['pro_monthly']}, {stripeAccount: 'mch_123'})`, stripe-python `stripe_account='mch_123'`; it sends `Stripe-Account: mch_123`). Each merchant can have its own price under the same lookup key, so a lookup that names no merchant and matches prices of more than one merchant is refused with `400 parameter_invalid` (`param` `merchant_id`) rather than listing them all. Saved Stripe cards cannot be moved: customers enter a card again, for example through a subscription-mode checkout link.\n\n## Webhooks\n\n- Deliveries carry the `ZeroPoint-Signature` header. The scheme is Stripe's, so `stripe.webhooks.constructEvent(rawBody, req.headers['zeropoint-signature'], whsec)` verifies a ZeroPoint delivery with the `whsec_` secret from `POST /v1/webhooks`. Set `stripe_signature_header: true` on the endpoint and each delivery also carries `Stripe-Signature` with the same value, so unchanged Stripe code verifies it; leave it off for a URL that still receives real Stripe deliveries ([Webhooks](webhooks.md)).\n- `stripe_compatible_payload: true` on the endpoint delivers a checkout session whose payment is still being confirmed with `payment_status: \"unpaid\"`, so a fulfilment handler copied from Stripe grants nothing early.\n- Billing events are opt-in: list the types on the endpoint ([Billing events reference](billing-events.md)).\n- `payment_intent` on an invoice or a session holds a ZeroPoint payment id (`pay_...`).\n\n## Behaviour a ported app must handle\n\n- **Gate access on `status`, not `current_period_end`.** The period moves only when a renewal is captured; Stripe moves it when the renewal invoice is created. A handler that compares `current_period_end` with now cuts access at the first declined renewal.\n- **An unknown outcome is never a decline.** It surfaces as `StripeAPIError` (502 `processor_unavailable`, or 409 `invoice_reconciling`), never `StripeCardError`. The SDK does not retry it on its own (`Stripe-Should-Retry: false`). Retry deliberately with the same key, or wait for the events; never charge again with a new key.\n- **Server guards hold whatever key arrives.** A second subscription create for the same customer and price while the first payment is unresolved answers `subscription_create_unresolved` (409); a second plan change while one is being paid answers `change_pending` (400 through the SDK); a second invoice payment while one is on the wire answers `invoice_payment_in_progress`. A partial refund sent twice with two keys is two refunds: keep your key.\n- **An upgrade is charged now** and switches only after the charge is captured; `pending_update` shows it meanwhile. A downgrade answers `200` with `scheduled_change` and the items unchanged. Stripe has no `scheduled_change`; its `blocked_by` (ZeroPoint) names the renewal's refusal code while the duplicate guard would keep the change from applying.\n- **`cancel_at_period_end: true` on a `past_due`, `unpaid` or `incomplete` subscription cancels it now.** Stripe waits for the period end.\n- **Discount shapes differ.** There is no `discount` (singular) on a subscription or an invoice. `discounts` is an array of inline objects (`coupon`, `promotion_code`, `start`, `end`), not an array of `di_...` ids. A `repeating` discount whose months have run out stays listed with its `end` (a past time), so check `end` before you show a discount as active. A `once` discount is used up by the first invoice and is not listed on the subscription at all, even in the answer to `subscriptions.create`: read it on that first invoice's `discounts`. A proration invoice lists no `discounts` and its lines have no `discount_amounts`: each proration line's amount already has the discount in it ([Upgrades, downgrades and cancel](upgrades-downgrades-and-cancel.md) has the rule).\n- **A $0 first invoice is refused.** A 100 percent off code on a subscription checkout answers `400 parameter_unavailable` (`param: discounts`) at create, and `promotion_code_not_applicable` when typed on the page; Stripe completes such a checkout with no charge. Use a code that leaves at least 1 cent to pay.\n- **A declined checkout leaves an `incomplete` subscription.** The first subscription-mode payment attempt creates the subscription as `incomplete`; when the card is declined the session stays open for another card and the subscription stays `incomplete`, so `subscriptions.list({customer, status: 'all'})` shows it. It becomes `active` when a later card is captured on that session, or `incomplete_expired` (with its first invoice void, no event) when the session expires. Grant nothing on `incomplete`.\n- **`cancel_at_period_end` keeps a scheduled downgrade, inactive.** Setting it hides `scheduled_change` (`null`: the subscription ends, nothing changes); undoing it brings the same change back; if the period ends cancelled, the change is discarded.\n- **Refunds never cancel a subscription**, and a cancel never refunds.\n- **ZeroPoint sends no email to your customers.** Turn your Stripe customer emails into your own, sent from the events (`invoice.upcoming`, `invoice.paid`, `invoice.payment_failed` by its `billing_reason`, as on Stripe).\n- **`invoices.pay` is limited per card:** at most 3 unpaid sends per invoice in 24 hours, 10 per card in 30 days, 60 seconds apart (`StripeRateLimitError`, not retried by the SDK).\n- **Retries follow the merchant's schedule** (+1, +3, +7 days by default), not Smart Retries, and a hard decline blocks the card ([Failed renewals and retries](failed-renewals-and-retries.md)).\n\n## Not yet\n\nCreating, confirming or capturing PaymentIntents. Error `param` uses Stripe's bracket form (`terminal_options[tip]`), except that a free `metadata` key is never echoed: `param` is `metadata`, not `metadata[note]`, by design. stripe-python callers: read our code from `e.error.code` when `e.code` is empty (a 409, 429 or 5xx), and after a cut connection re-read the object or retry with the same key ([API conventions](api-conventions.md), Stripe SDK callers). Test clocks use Stripe's paths (`POST /v1/test_helpers/test_clocks`) and take the SDK's form-encoded bodies, so `stripe.testHelpers.testClocks.create` and `.advance` work; they are not part of the acceptance run yet. A Stripe parameter ZeroPoint does not have (`trial_end`, `trial_period_days`, `pause_collection`, `cancel_at`, `collection_method`, tax rates and others) answers `400` naming it, with what to use instead (`parameter_unknown` through a Stripe SDK, `parameter_invalid` to plain JSON). Ending an injected hold (`POST /v1/test_helpers/invoices/{invoice_id}/resolve_hold`) has no outcome to choose: the attempt always ends not collected ([Test your billing with test clocks and failure injection](test-billing-with-test-clocks.md)).","updated":1795275945}