• Precios
  • Blog
Iniciar sesiónAgendá una demo
Adjust balance POSTApply an Offer to a subscription PUTCancel subscription POSTChange plan POSTCreate a recovery payment link for a past due subscription POSTCreate subscription POSTGet active subscription GETGet subscription by ID GETList subscriptions GETPreview plan change POSTReactivate a past due or canceled subscription POSTRemove an Offer from a pending checkout DELETETop up balance POSTRevert scheduled cancellation POSTUpdate payment method POST
DocumentaciónRecursosConstruir con AIAPI ReferenceWebhooks

Update payment method

Creates a hosted checkout session for the customer to update the subscription's default payment method.

POST
/subscriptions/{id}/payment-method/update

Creates a hosted checkout session for the customer to update the subscription's default payment method.

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Path Parameters

id*string

Header Parameters

Idempotency-Key?string

Unique key used to safely retry this write for 24 hours without applying it twice.

Length1 <= length <= 200

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/subscriptions/string/payment-method/update" \  -H "Content-Type: application/json" \  -d '{}'
{  "checkoutUrl": "string",  "object": "checkout_session",  "livemode": true}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}

Revert scheduled cancellation POST

Revert a scheduled cancellation and return the updated subscription. Only works before cancellation takes effect.

Advance test clock POST

Starts a durable run that moves the test clock forward and processes every billing deadline due before the target time. Poll GET /test-clock for progress and terminal results. Sandbox only.

successUrl?string
Formaturi