Subscriptions

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:

The request includes the following settings:

  • paymentPlanId - Unique identifier of the payment plan that the merchant wants to use. If you don't have the paymentPlanId, use our List Payment Plans method to search for the payment plan.
  • 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.

post/processing-terminals/{processingTerminalId}/subscriptions

Path parameters

processingTerminalIdstring required

Unique identifier that we assigned to the terminal.

Headers

Authorizationstring required

Bearer authentication

Idempotency-Keystring uuid required

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 body

subscriptionIdstring required

Unique identifier that the merchant assigns to the subscription.

paymentPlanIdstring required

Unique identifier that the merchant assigned to the payment plan.

namestring

Name of the subscription. This value replaces the name inherited from the payment plan.

descriptionstring

Description of the subscription. This value replaces the description inherited from the payment plan.

startDatestring date required

Format: YYYY-MM-DD
Subscription's start date.

endDatestring date

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.

lengthinteger

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.

pauseCollectionForinteger

Number of billing cycles that the merchant wants to pause payments for. For example, if the merchant wants to offer a free trial period.

Response

Successful request. We created the subscription.

subscriptionIdstring required

Unique identifier that the merchant assigned to the subscription.

processingTerminalIdstring required

Unique identifier of the terminal that the subscription is linked to.

namestring required

Name of the subscription.

descriptionstring

Description of the subscription.

currency'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LTL' | 'LVL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STD' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'USS' | 'UYI' | 'UYU' | 'UZS' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL' required

Currency of the transaction. The value for the currency follows the ISO 4217 standard.

startDatestring date required

Format: YYYY-MM-DD
Subscription's start date.

endDatestring date

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.

lengthinteger

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.

type'manual' | 'automatic' required

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.
frequency'weekly' | 'fortnightly' | 'monthly' | 'quarterly' | 'yearly' required

Indicates how often the merchant or the terminal collects a payment from the customer.

pauseCollectionForinteger

Number of billing cycles that the merchant wants to pause payments for. For example, if the merchant wants to offer a free trial period.

Changes