REST Example: Creating a Fully Customized Subscription with a One-Time Plan

Light Dark
Example Request
1234567891011121314151617181920212223242526
{"subscriptionInformation": { "name": "SubName Testing", "startDate": "2023-04-18T17:01:42Z", "originalTransactionId”: “016153570198200" }, "planInformation": { "billingCycles": { "total":"5" }, "billingPeriod": { "length": "3", "unit":"D" } }, "orderInformation": { "amountDetails": { "billingAmount": "1.21", "setupFee": "1.44", "currency":"USD" } }, "paymentInformation": { "customer": { "id": "C09F227C54F94951E0533F36CF0A3D91" } }}
Example Response to a Successful Request
1234567891011121314151617181920
{"_links": { "self": { "href": "/rbs/v1/subscriptions/1619214861", "method": "GET" }, "update": { "href": "/rbs/v1/subscriptions/1619214861", "method": "PATCH" }, "cancel": { "href": "/rbs/v1/subscriptions/1619214861/cancel", "method": "POST" } }, "id": "1619214861", "status": "COMPLETED", "subscriptionInformation": { "code": "AWC-49", "status": "PENDING" }}
Example Error Response to a Failed Request
123456789
{"status": "INVALID_REQUEST", "reason": "INVALID_DATA", "message": "One or more fields in the request contains invalid data.", "details": [ { "field": "planInformation.billingPeriod.length", "reason": "MAX_LENGTH" } ]}