Create Subscription

Create subscription.

 

Request Path Parameters
Parameter Type Required Description
org_id number Yes The unique identifier of your organization

 

Request Body Parameter
Attribute Type Required Description
started_at string Yes When subscription started
company number Yes The unique identifier of the company
quantity number Yes
plan number Yes The unique identifier of the plan
canceled_at No When the subscription canceled
reason number No The unique identifier of the reason

Example Request & Response


$ curl https://api.custerem.com/<org_id>/subscriptions/ \
-X POST \
-H 'Authorization: X-API-KEY <Your API Key>' \
-H 'Content-Type: application/json' \
-d '{
    "started_at": "2022-04-09 09:20",
    "company": 38,
    "quantity": 2,
    "plan": 5
}'

 

201 Created

{
    "started_at": "2022-04-09T09:20:00Z",
    "canceled_at": null,
    "plan": 5,
    "company": 38,
    "quantity": 2
}

 

400 Bad Request

{
    "plan": [
        "This field is required."
    ],
    "company": [
        "This field is required."
    ],
    "quantity": [
        "This field is required."
    ]
}