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.

Try it in the API Explorer

Request Content

plan container    required, contains the following properties (see plan):
     name string    required
     recurring-charge-amount decimal    required
     currency string    required
     charge-frequency string    required
     trial-period-days integer    optional
     initial-charge-amount decimal   optional
     charge-on-plan-switch boolean    optional
     max-number-of-charges integer    optional
     grace-period-days integer    optional

Response Details

If successful, the response HTTP status code is 200 OK.
The response body contains the plan resource, which includes the plan-id.
The plan-id also appears in the location header.


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/plans \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<plan xmlns="http://ws.plimus.com">
   <name>Gold Plan</name>
   <recurring-charge-amount>29.99</recurring-charge-amount>
   <currency>USD</currency>
   <charge-frequency>MONTHLY</charge-frequency>
</plan>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/plans \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<plan xmlns="http://ws.plimus.com">
   <name>Gold Plan</name>
   <recurring-charge-amount>29.99</recurring-charge-amount>
   <currency>USD</currency>
   <charge-frequency>MONTHLY</charge-frequency>
   <trial-period-days>14</trial-period-days>
   <initial-charge-amount>100</initial-charge-amount>
   <charge-on-plan-switch>true</charge-on-plan-switch>
   <max-number-of-charges>12</max-number-of-charges>
   <grace-period-days>10</grace-period-days>
</plan>'

Response Examples

HTTP/ 1.1 200 OK

<plan xmlns="http://ws.plimus.com">
   <plan-id>2111110</plan-id>
   <name>Gold Plan</name>
   <recurring-charge-amount>29.99</recurring-charge-amount>
   <currency>USD</currency>
   <charge-frequency>MONTHLY</charge-frequency>
   <status>ACTIVE</status>
</plan>
HTTP/ 1.1 200 OK

<plan xmlns="http://ws.plimus.com">
   <plan-id>2111111</plan-id>
   <name>Gold Plan</name>
   <recurring-charge-amount>29.99</recurring-charge-amount>
   <currency>USD</currency>
   <charge-frequency>MONTHLY</charge-frequency>
   <trial-period-days>14</trial-period-days>
   <initial-charge-amount>100</initial-charge-amount>
   <charge-on-plan-switch>true</charge-on-plan-switch>
   <max-number-of-charges>12</max-number-of-charges>
   <grace-period-days>10</grace-period-days>
   <status>ACTIVE</status>
</plan>

Back to Top


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 XML portion of the request below and then click Try it!

📘

Tip:

Copy the XML portion from one of the example requests above, or use the XML code below as a starting point. You can enter different parameter values 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.

<plan xmlns="http://ws.plimus.com">
   <name>Gold Plan</name>
   <recurring-charge-amount>29.99</recurring-charge-amount>
   <currency>USD</currency>
   <charge-frequency>MONTHLY</charge-frequency>
   <trial-period-days>14</trial-period-days>
   <initial-charge-amount>100</initial-charge-amount>
   <charge-on-plan-switch>true</charge-on-plan-switch>
   <max-number-of-charges>12</max-number-of-charges>
   <grace-period-days>10</grace-period-days>
</plan>
Language
Credentials
:
Click Try It! to start a request and see the response here!