Creating a Plan
Create a plan to define the billing schedule, which includes the amount, frequency,
and billing cycles for a subscription. A subscription's plan duration (number of billing
cycles) cannot exceed 12 months. The interval between subscription payments cannot
exceed 12 months.
IMPORTANT
If a subscription is to use a one-time plan
instead of a standard plan, you create the one-time plan when you create the
subscription. The plan details are embedded in the subscription request.
When you create a plan, the system assigns an ID to the plan. Use the plan ID to
request these actions:
- Creating a subscription
- Retrieving a plan
- Amending a plan
- Activating a plan
- Deactivating a plan
- Deleting a plan
Follow these steps to create a plan:
- Send the request to the recurring billing endpoint:
ADDITIONAL INFORMATION
POST https://<url_prefix>/rbs/v1/plansADDITIONAL INFORMATION
Use one of these URL prefixes:- Test:apitest.cybersource.com
- Production:api.cybersource.com
- Production in India:api.in.cybersource.com
- Check the response message to make sure that the request was successful. A 200-level HTTP response code indicates success.For information about response codes, see Transaction Response Codes.
Required Fields for Creating a Plan
Include these fields in your request to create a plan:
- orderInformation.amountDetails.billingAmount
- orderInformation.amountDetails.currency
- planInformation.billingCycles.total
- Required for a plan with a defined plan period.
- planInformation.billingPeriod.length
- planInformation.billingPeriod.unit
- planInformation.name
Optional Fields for Creating a Plan
- orderInformation.amountDetails.setupFee
- planInformation.code
- planInformation.description
- planInformation.status
REST Examples: Creating a Plan
Request
{ "planInformation": { "billingPeriod": { "unit": "w", "length": "1" }, "billingCycles": { "total": "4" }, "code":"1619310018", "name": "Test plan", "description": "Description", "status":"active" }, "orderInformation": { "amountDetails": { "billingAmount": "7", "currency": "USD", "setupFee": "0" } } }
Successful Response
{ "_links": { "self": { "href": "/rbs/v1/plans/1619212820", "method": "GET" }, "update": { "href": "/rbs/v1/plans/1619212820", "method": "PATCH" }, "deactivate": { "href": "/rbs/v1/plans/1619212820/deactivate", "method": "POST" } }, "id": "1619212820", "status": "COMPLETED", "planInformation": { "code": "1619310018", "status": "ACTIVE" } }
Error Response
{ "status": "INVALID_REQUEST", "reason": "INVALID_DATA", "message": "One or more fields in the request contains invalid data.", "details": [ { "field": "planInformation.code", "reason": "DUPLICATE" } ] }