Subscriptions Admin API
Replace a customer's subscription
POST
/api/v1/customers/{uid}/subscription/update
Ends the customer's current subscription and subscribes it to plan_uid, in one step:
assigning a plan with force. Every check is made before anything ends.
Parameters
uid
string
required
path
The customer's uid.
Request body application/x-www-form-urlencoded
plan_uid
string
required
disable_billing
boolean
Activate the subscription without an invoice to pay.
Default:
0Responses
200
The plan was assigned.
401
The token is missing or wrong (
Unauthenticated.), or its user may not act on
this object (Unauthorized). Without the Accept: application/json header, a
missing or wrong token answers with a redirect to the sign-in page instead.
404
No customer or no plan has this uid, or the plan is not active.
500
The plan could not be assigned; the message says why, and nothing changed.
Replace a customer's subscription
1
2
3
4
5
curl -X POST 'https://your-domain/api/v1/customers/6adaabb568fda/subscription/update' \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
--data-urlencode 'plan_uid=6adaabb0c9e12' \
--data-urlencode 'disable_billing=1'
Response
{
"status": 1,
"message": "Assigned Awesome Solutions plan to Standard successfully.",
"customer_uid": "6adaabb568fda",
"plan_uid": "6adaabb0c9e12"
}