Create payment plan

Use this method to create a payment schedule that you can assign customers to.

Note: This method is part of our Repeat Payments feature. To help you understand how this method works with our Subscriptions endpoints, go to Repeat Payments.

When you create a payment plan you need to provide a unique paymentPlanId that you use to run follow-on actions:

The request includes the following settings:

  • type - Indicates if our gateway or the merchant collects payments. If the merchant manually collects payments, integrate with the Pay Manual Subscription method.
  • recurringOrder - Amount of each payment if the gateway automatically collect payments.
  • setupOrder - Setup fee that our gateway immediately collects from the customer’s payment method.
  • onUpdate and onDelete - Indicates what happens to associated subscriptions if the merchant updates or deletes the payment plan.

Path parameters

processingTerminalIdstringRequired>=4 characters<=50 characters
Unique identifier that we assigned to the terminal.

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

Idempotency-KeystringRequired

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

This endpoint expects an object.
paymentPlanIdstringRequired>=1 character<=48 characters
Unique identifier that the merchant assigns to the payment plan.
namestringRequired>=5 characters<=128 characters
Name of the payment plan.
currencyenumRequired

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

typeenumRequired

Indicates 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.
Allowed values:
frequencyenumRequired
Indicates how often the merchant or the terminal collects a payment from the customer.
Allowed values:
onUpdateenumRequired

Indicates whether any changes that the merchant makes to the payment plan apply to existing subscriptions.

  • update - Changes apply to existing subscriptions.
  • continue - Changes don’t apply to existing subscriptions.
Allowed values:
onDeleteenumRequired

Indicates what happens to existing subscriptions if the merchant deletes the payment plan.

  • complete - Stops existing subscriptions.
  • continue - Continues existing subscriptions.
Allowed values:
descriptionstringOptional>=0 characters<=128 characters
Description of the payment plan.
setupOrderobjectOptional
Object that contains information about the initial cost that a customer pays to set up the subscription.
recurringOrderobjectOptional

Object that contains information about the cost of each payment.
Note: Send this object only if the value for type is automatic.

lengthintegerOptional>=0Defaults to 0

Number of payments for the payment plan.

To indicate that the payment plan should run indefinitely, send a value of 0.

customFieldNameslist of stringsOptional
Array of custom fields that you can use in subscriptions linked to the payment plan.

Response

Successful request. We created the payment plan.
paymentPlanIdstring>=1 character<=48 characters
Unique identifier that the merchant assigns to the payment plan.
namestring>=5 characters<=128 characters
Name of the payment plan.
currencyenum

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

typeenum

Indicates 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.
Allowed values:
frequencyenum
Indicates how often the merchant or the terminal collects a payment from the customer.
Allowed values:
onUpdateenum

Indicates whether any changes that the merchant makes to the payment plan apply to existing subscriptions.

  • update - Changes apply to existing subscriptions.
  • continue - Changes don’t apply to existing subscriptions.
Allowed values:
onDeleteenum

Indicates what happens to existing subscriptions if the merchant deletes the payment plan.

  • complete - Stops existing subscriptions.
  • continue - Continues existing subscriptions.
Allowed values:
processingTerminalIdstring or null>=4 characters<=50 characters
Unique identifier of the terminal that the payment plan is assigned to.
descriptionstring or null>=0 characters<=128 characters
Description of the payment plan.
setupOrderobject or null
Object that contains information about the initial cost that a customer pays to set up the subscription.
recurringOrderobject or null

Object that contains information about the cost of each payment.
Note: Send this object only if the value for type is automatic.

lengthinteger or null>=0Defaults to 0

Number of payments for the payment plan.

To indicate that the payment plan should run indefinitely, send a value of 0.

customFieldNameslist of strings or null
Array of custom fields that you can use in subscriptions linked to the payment plan.

Errors