Create Plan

Create Plan.

 

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

 

Request Body Parameter
Attribute Type Required Description
name string Yes Name of the plan
currency string Yes e.g usd
amount number Yes
interval string Yes e.g month or yearly
trial_duration number No Number of trial days
trial_duration_unit string No e.g day

Example Request & Response


$ curl https://api.custerem.com/<org_id>/plans/ \
-X POST \
-H 'Authorization: X-API-KEY <Your API Key>' \
-H 'Content-Type: application/json' \
-d '{
    "name": "pro_plan",
    "currency": "usd",
    "amount": 29,
    "interval": "month",
    "trial_duration": 20,
    "trial_duration_unit": "day"
}'

 

201 Created

{
    "name": "pro_plan",
    "currency": "usd",
    "amount": 29,
    "interval": "month",
    "trial_duration": 20,
    "trial_duration_unit": "day"
}

 

400 Bad Request

{
    "name": [
        "This field is required."
    ],
    "currency": [
        "This field is required."
    ],
    "amount": [
        "This field is required."
    ],
    "interval": [
        "This field is required."
    ]
}