Create Payment Method Session
Create a short-lived session that lets this Subscription's customer update their payment method through the embeddable update element, without your page ever touching card data. Call it from your backend, then hand only the sessionToken to the embed script on your page — the secret key must never reach the browser. The token works only for this one Subscription and expires 15 minutes after it is minted; it is also retired as soon as an update completes, though a browser that never reports back leaves it usable until it expires — the 15 minutes is the guarantee. Mint a fresh token per attempt rather than storing one. Minting is rate-limited per Subscription; exceeding the limit returns 429. The Subscription must be in a state whose payment method can still be used for a future charge (active, trialing, past_due, unpaid or paused); other states return 400. Returns 403 when the embedded payment-method update feature is not enabled for your workspace.
Authorization
Public key Secret key In: header
In: header
Path Parameters
Subscription identifier - the initial order number, exactly as returned in subscription.id. Omit the leading # the dashboard shows: a #-prefixed value passes validation but resolves to nothing. Payment-provider subscription ids are not accepted.
^#?([0-9A-Za-z]{12,32}|[0-9]+)(-[0-9]+)?$Request Body
application/json
POST /v0/subscriptions/:subscriptionIdOrNumber/paymentMethodSession Request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/v0/subscriptions/ABC123DEF456/paymentMethodSession" \ -H "Content-Type: application/json" \ -d '{}'{ "status": "success", "data": { "sessionToken": "string", "expiresAt": -1.7976931348623157e+308, "url": "string" }}End Subscription Trial PATCH
End a Subscription's trial immediately and start the paid subscription. The Subscription must be in trialing status. The first Invoice is created and charged right away using the payment method on file. The outcome (emails, webhooks, orders) is identical to the trial ending naturally. Safe to retry: the same trial is only ever invoiced and charged once. Once the trial has ended, a repeat returns 400.
Calculate product price including tax POST
Return an indicative price for an offer including the tax that applies to a customer in the given country. Intended for storefront display (e.g. showing gross prices on a product page). The result is a **quote**, not a settled charge: the authoritative tax is always recomputed at checkout from full billing details. Amounts are returned in the smallest currency unit (e.g. 1099 = 10.99 in a 2-decimal currency). For business (B2B) buyers, pass customerType=company with taxId + taxNumber. The VAT-ID is checked against the EU VIES registry, and the quote matches what checkout will charge: a verified EU VAT-ID on a cross-border sale returns 0% (reverse charge); anything else — including a verified VAT-ID from the seller entity's own country, where domestic VAT is due — returns the standard destination rate. vatVerification and reverseChargeApplied tell you which happened and why.