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.
Request Content
Send a plan object, with the following:
chargeFrequency
string required
gracePeriodDays
integer optional
trialPeriodDays
integer optional
initialChargeAmount
decimal optional
name
string required
currency
string required
maxNumberOfCharges
integer optional
recurringChargeAmount
decimal required
chargeOnPlanSwitch
boolean optional
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.
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"
}
Example Descriptions
Create Plan: basic
This example shows a basic Create Plan request, containing the minimum required fields for a new plan.
Create Plan: all settings
This example shows a Create Plan request with all available plan settings, including a trial period of 14 days, an initial charge of $100, charge on switch enabled, a max limit of 12 charges, and a grace period of 10 days.
Back to Top
API Explorer
To test out a call, enter the request content below and then click Try it!
Tip: Use the JSON code below as a starting point. You can enter different parameters to see how your test scenario would work. The request headers, including authorization, are already built in for you in this test area, so you should not include them here.
{
"chargeFrequency": "MONTHLY",
"gracePeriodDays": 10,
"trialPeriodDays": 14,
"initialChargeAmount": 100,
"name": "Gold Plan",
"currency": "USD",
"maxNumberOfCharges": 12,
"recurringChargeAmount": 29.99,
"chargeOnPlanSwitch": true
}