Commet
  • Precios
Iniciar SesiónRegistrarse
Adjust balance POSTCancel 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 subscription POSTTop 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

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

successUrl?string

Response Body

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 '{}'
{  "success": true,  "data": {    "checkoutUrl": "string",    "object": "subscription",    "livemode": true  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}

Revert scheduled cancellation POST

Revert a scheduled cancellation. Only works when canceledAt is set but status is not yet 'canceled'.

Advance test clock POST

Moves the test clock forward, by a number of days (advanceDays) or to an absolute instant (frozenTime). The clock can only move forward. Sandbox only.