Billing that charges once, in the right currency
Billing requests take a key so a retry charges only once, and checkouts use the customer's currency. Plans published before Stripe was connected can be bought, failed plan credit grants are retried, and a scheduled downgrade keeps what was paid for until it takes effect.
Added
1- BillingA retried billing request no longer charges twice. You can send an optional Idempotency-Key header with a checkout, plan change, add-on or credit pack purchase, cancel, resume, pause, coupon or billing portal call. A retry with the same key reaches Stripe only once. Keys are scoped to your organization and the caller, and the console sends one per click. Reusing a key for a different request answers 409 IDEMPOTENCY_KEY_REUSED.
Improved
2- BillingBehaviour change: a price made for one customer's deal can no longer be bought by someone who learns its id. Checkout from your app now accepts only a plan version that a pricing group sells or has sold, in a group that is not archived. Any other id answers Plan version not found. The console's checkout link still sends any published version.
- BillingYou can now test usage resets, credit expiry and plan change previews with Stripe test clocks. With Stripe test keys, they follow a subscription's Stripe test clock, which is Stripe's simulated time for tests.
Fixed
7- BillingA retried usage call can no longer bill your customer's overage twice. Two usage reports sent at the same time with the same idempotency key, which marks them as one report, now count once. Before, both could move the counter.
- BillingPlans and credit packs published before you connected Stripe can now be bought. Their missing prices are created by saving your Stripe keys, by the new Sync with Stripe button on Subscriptions > Plans, or by a checkout. Stripe Checkout shows the plan's name without its version. A checkout made while prices are still being created answers 409 STRIPE_CATALOG_SYNCING.
- BillingCheckouts now charge in the right currency when none is named. A plan checkout or plan change with no currency uses the customer's billed currency. Failing that, it uses the first of your billing currencies the plan is priced in. It never simply takes the plan's first listed price, which sent some USD visitors to a EUR checkout. A plan priced in none of them answers 400 PLAN_CURRENCY_UNAVAILABLE.
- BillingMore billing calls now say plainly when Stripe is not connected. In an organization that has not connected Stripe, add-on purchases, plan change previews and the coupon routes also answer 409 STRIPE_NOT_CONNECTED. Before, a recurring add-on purchase answered 500. Plan & Billing in such an app shows no invoices, instead of an error about missing Stripe credentials.
- CreditsCustomers no longer go without plan credits when a grant fails. Plan credits that fail to be granted are now stored and retried automatically. That covers checkout, an upgrade, the monthly reset, a downgrade and a move to a free plan. The new credit.plan_grant_failed webhook and Slack notice say whether a grant is retrying, resolved or needs a person.
- BillingA scheduled downgrade no longer takes away what the workspace paid for straight away. The workspace keeps its quotas and monthly credits until the downgrade takes effect. Before, they dropped at once. A plan change now ends only plan credits set to reset, not those set to top up.
- BillingA trial started without a card now sends the trial expired email when it runs out. It sends the subscription.trial_expired event, where it used to send subscription.canceled and no email.