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.

For more information about working with subscriptions, see the Subscriptions tutorial.

📘

Need help setting up your plans?

If you need assistance with creating billing plans, please contact Merchant Support.


📘

Tip

You can test out a request that hits our sandbox in real-time. Follow the instructions here to use the "Try It!" feature on the right side.

Request Content

Send a plan object, with the following:

PropertyTypeRequired
chargeFrequencystringrequired
gracePeriodDaysintegeroptional
trialPeriodDaysintegeroptional
initialChargeAmountdecimaloptional
namestringrequired
currencystringrequired
maxNumberOfChargesintegeroptional
recurringChargeAmountdecimalrequired
chargeOnPlanSwitchbooleanoptional

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

To test out a basic API request, click the "Try It!" button in the right-hand column to test using the default, pre-populated sample values. To test with your own values, edit the parameter fields below. You'll see them populate in the right-hand column and you can click the "Try It!" button to submit your test request and see a response.

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