• 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

Change plan

Upgrade or change billing interval immediately, optionally applying an Offer. Scheduled changes do not accept offers.

POST
/subscriptions/{id}/change-plan

Upgrade or change billing interval immediately, optionally applying an Offer. Scheduled changes do not accept offers.

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

application/json

curl -X POST "https://example.com/subscriptions/string/change-plan" \  -H "Content-Type: application/json" \  -d '{}'
{  "outcome": "requires_checkout",  "requiresCheckout": true,  "checkoutUrl": "string",  "offerApplication": {    "id": "string",    "offerId": "string",    "name": "string",    "currency": "string",    "subtotal": -9007199254740991,    "discountAmount": -9007199254740991,    "total": -9007199254740991,    "phases": [      {        "type": "free_trial",        "durationDays": 1,        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z"      }    ],    "appliesTo": {      "type": "plan_price",      "id": "string"    }  },  "object": "plan_change",  "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"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}

Cancel subscription POST

Cancel immediately or at period end and return the updated subscription.

Create a recovery payment link for a past due subscription POST

Generates a hosted, signed recovery link that lets the customer pay the outstanding renewal charge for a past_due subscription. Unlike reactivate, which charges server-to-server, this returns a link the merchant can deliver through their own email, SMS, or dashboard. The link carries a self-contained signed token and stays valid until the charge is paid or the subscription is no longer past due.

newPlanId?string
Length1 <= length
newBillingInterval?string

Value in

  • "weekly"
  • "monthly"
  • "quarterly"
  • "yearly"
successUrl?string
Formaturi
offerId?string
Length1 <= length