Change subscription

Switch a subscription to a different plan.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

Switch an existing subscription to a different plan (upgrade or downgrade). plan_id and subscription_id are required; address_id and source_id are optional. Proration, payment behavior, and the billing-cycle anchor are handled by the server. Returns the customer resource with a fresh JWT.

Example:

curl --request POST \
  --url 'https://www.pelcro.com/api/v1/sdk/subscription/change?site_id=1232' \
  --header 'Authorization: Bearer <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{ "subscription_id": 4055, "plan_id": 4052 }'

Notes

  • Protected — requires the customer's JWT.
  • FormRequest validation failures are 400; downstream/business failures return 404 with a friendly message.
Query Params
int32
required

The unique identifier of the site associated with your account.

Body Params
int32
required

The unique identifier for subscription

int32
required

The unique identifier for the new plan to change subscription to

int32

Must be provided only if product.address_required is true

int32
Defaults to 1

Quantity for this subscription, always 1 by default.

int32

The unique identifier of an existing chargeable payment method already attached to the customer, which will be used to attempt payments for this subscription.

string
enum
Defaults to stripe

The optional payment gateway, one of stripe, braintree, vantiv, tap or cybersource. Always defaults to stripe.

Allowed:
string

The single-use token that represents the payment method details. Typically generated using the payment gateway's tools and libraries. This payment method will be used to attempt payments for the subscription.

string | null

Legacy Stripe card token. Prefer payment_gateway + gateway_token or source_id.

string

An optional coupon code to apply a discount to the subscription. If you associated a customer segment to the coupon, a validation will be performed. Therefore, it is recommended to validate against eligible coupons for the customer first.

Responses

Language
Credentials
Query
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json