Subscriptions Admin API

Subscribe a customer to a plan

POST /api/v1/subscriptions

Gives the customer a new subscription to the plan. The subscription waits for its first invoice to be paid, unless disable_billing is true. The same as assigning a plan without force.

Request body application/x-www-form-urlencoded
customer_uid string required
plan_uid string required
disable_billing boolean
Activate the subscription without an invoice to pay.
Default: 0
Responses
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.
Subscribe a customer to a plan
1 2 3 4 5 6
curl -X POST 'https://your-domain/api/v1/subscriptions' \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  --data-urlencode 'customer_uid=6adaabb568fda' \
  --data-urlencode 'plan_uid=6adaabb0c9e12' \
  --data-urlencode 'disable_billing=1'
1 2 3 4 5
$client = new Acelle\Client('https://your-domain/api/v1', 'YOUR_API_TOKEN');
$client->subscription()->create([
    'customer_uid' => '6adaabb568fda',
    'plan_uid' => '6adaabb0c9e12',
]);
Response
{
    "status": 1,
    "message": "Assigned Awesome Solutions plan to Standard successfully.",
    "customer_uid": "6adaabb568fda",
    "plan_uid": "6adaabb0c9e12"
}