Create Plan

The Create Plan request enables you to set up a subscription billing plan and define the plan's settings, such as the charge frequency, amount, currency, trial period, initial charge amount, and so on.

If you need assistance with creating billing plans, please contact Merchant Support. For more information about working with subscriptions, see the Subscriptions tutorial .

๐Ÿ“˜

Plan Limit

You can create up to 40,000 plans. If you exceed this limit, you receive a MAX_NUMBER_PLANS_EXCEEDED error.


๐Ÿ“˜

Send a test request

Go to API Explorer to send a test request to our sandbox environment and receive a response in real time.

Request Content

Send a plan object, with the following:

PropertyTypeRequired
chargeFrequencystringrequired
chargeOnPlanSwitchbooleanoptional
currencystringrequired
gracePeriodDaysintegeroptional
initialChargeAmountdecimaloptional
maxNumberOfChargesintegeroptional
namestringrequired
recurringChargeAmountdecimalrequired
trialPeriodDaysintegeroptional

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains the plan object.
The planId appears in the response body and the location header.

Back to Top


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/plans \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "chargeFrequency": "MONTHLY",
    "name": "Gold Plan",
    "currency": "USD",
    "recurringChargeAmount": 29.99
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/plans \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "chargeFrequency": "MONTHLY",
    "gracePeriodDays": 10,
    "trialPeriodDays": 14,
    "initialChargeAmount": 100,
    "name": "Gold Plan",
    "currency": "USD",
    "maxNumberOfCharges": 12,
    "recurringChargeAmount": 29.99,
    "chargeOnPlanSwitch": true
}'

Response Examples

{
    "chargeFrequency": "MONTHLY",
    "name": "Gold Plan",
    "planId": 2111110,
    "currency": "USD",
    "recurringChargeAmount": 29.99,
    "status": "ACTIVE"
}
{
    "chargeFrequency": "MONTHLY",
    "gracePeriodDays": 10,
    "trialPeriodDays": 14,
    "initialChargeAmount": 100,
    "name": "Gold Plan",
    "planId": 2111111,
    "currency": "USD",
    "maxNumberOfCharges": 12,
    "recurringChargeAmount": 29.99,
    "chargeOnPlanSwitch": true,
    "status": "ACTIVE"
}

Back to Top


API Explorer

BlueSnap provides a sandbox environment so you can test basic requests with this endpoint. You can view the request in the API Explorer console and its response directly below the console.

The console includes a sample request with predefined parameter values. To send a request with custom values, edit the parameter fields below. As you edit the fields, your custom values display in the request in the console.

Click the Try it! button below the request example when you are ready to send your request.

Language
Authorization
Header
Click Try It! to start a request and see the response here!