Create subscription
Use this method to assign a customer to a payment plan.
Note: This method is part of our Repeat Payments feature. To help you understand how this method works with our Payment plans endpoints, go to Repeat Payments.
When you create a subscription you need to provide a unique subscriptionId that you use to run follow-on actions:
- Retrieve Subscription - View the details of the subscription.
- Update Subscription - Update the details of the subscription.
- Deactivate Subscription - Stop taking payments for the subscription.
- Re-activate Subscription - Start taking payments again for the subscription.
- Pay Manual Subscription - Manually collect a payment for the subscription.
The request includes the following settings:
- paymentPlanId - Unique identifier of the payment plan that the merchant wants to use.
- paymentMethod - Object that contains information about the secure token, which represents the customer’s card details or bank account details.
- startDate - Date that you want to start to take payments.
You can also update the settings that the subscription inherited from the payment plan, for example, you can change the amount for each payment. If you change the settings for the subscription, it doesn’t change the settings in the payment plan that it’s linked to.
Path parameters
Headers
Bearer authentication of the form Bearer <token>, where token is your auth token.
Unique identifier that you generate for each request. You must use the UUID v4 format for the identifier. For more information about the idempotency key, go to Idempotency.
Request
Format: YYYY-MM-DD
Subscription’s start date.
Object that contains information about the cost of each payment.
Note: Send this object only if the value for type is automatic
.
Format: YYYY-MM-DD
Subscription’s end date.
Note: If you provide values for both length and endDate,
our gateway uses the value for endDate to determine when the subscription should end.
Total number of billing cycles. To indicate that the subscription should run indefinitely, send a value of 0
.
This value replaces the length inherited from the payment plan.
Note: If you provide values for both length and endDate,
our gateway uses the value for endDate to determine when the subscription should end.
Response
Format: YYYY-MM-DD
Subscription’s start date.
How the merchant takes the payment from the customer’s account.
manual
– The merchant manually collects payments from the customer.automatic
– The terminal automatically collects payments from the customer.
Object that contains information about the cost of each payment.
Note: Send this object only if the value for type is automatic
.
Format: YYYY-MM-DD
Subscription’s end date.
Note: If you provide values for both length and endDate,
our gateway uses the value for endDate to determine when the subscription should end.
Total number of billing cycles. To indicate that the subscription should run indefinitely, send a value of 0
. This value replaces the length inherited from the payment plan.
Note: If you provide values for both length and endDate, our gateway uses the value for endDate to determine when the subscription should end.