Creating a Subscription with an Existing Plan
You can shows how to create a subscription with a standard plan.
The start date must be in coordinated universal time (UTC) in this format:
YYYY-MM-DDThh:mm:ssZ. The T separates the date and the time. The Z indicates UTC. For example,
2023-08-11T22:47:57Z
indicates August 11, 2023, at 22:47:57 (10:47:57PM).
For subscriptions created on the start date, set the time to the current
time and day in your time zone.Required Fields
These fields are required for creating a subscription with an existing plan:
- paymentInformation.customer.id
- subscriptionInformation.name
- subscriptionInformation.planId
- Required when you are using a standard plan.
- subscriptionInformation.startDate
Optional Field
- subscriptionInformation.originalTransactionId
- Including this field ensures better authorization rates and Strong Customer Authentication (SCA) compliance where necessary.
Related Information
REST Example: Creating a Subscription with an Existing Plan
This example shows how to create a subscription with an existing plan.
Request
1234567891011{"subscriptionInformation": { "planId":"1619214515", "name": "Daily Gym Subscription", "startDate": "2023-04-15T17:01:42Z", "originalTransactionId”: “016153570198200" }, "paymentInformation": { "customer": { "id": "C09F227C54F94951E0533F36CF0A3D91" } }}
Response to a Successful Request
1234567891011121314151617181920{"_links": { "self": { "href": "/rbs/v1/subscriptions/1619214690", "method": "GET" }, "update": { "href": "/rbs/v1/subscriptions/1619214690", "method": "PATCH" }, "cancel": { "href": "/rbs/v1/subscriptions/1619214690/cancel", "method": "POST" } }, "id": "1619214690", "status": "COMPLETED", "subscriptionInformation": { "code": "AWC-47", "status": "PENDING" }}
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": "subscriptionInformation.startDate", "reason": "INVALID_DATA" } ]}