Skip to content
payrocdevelopers

Create payment plan

Browse API reference

POST/processing-terminals/{processingTerminalId}/payment-planscreatePaymentPlan

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.

Parameters

NameInTypeDescription
Idempotency-KeyRequiredheaderstring

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.

processingTerminalIdRequiredpathstring

Unique identifier that we assigned to the terminal.

Request body

application/json · required
  • currencystringrequired
    Currency of the transaction. The value for the currency follows the ISO 4217 standard.AEDAFNALLAMDANGAOAARSAUD+163 more
  • customFieldNamesstring[]
    Array of custom fields that you can use in subscriptions linked to the payment plan.
  • descriptionstring
    Description of the payment plan.0–128 chars
  • frequencystringrequired
    Indicates how often the merchant or the terminal collects a payment from the customer.weeklyfortnightlymonthlyquarterlyyearly
  • lengthintegerint32
    Number of payments for the payment plan. To indicate that the payment plan should run indefinitely, send a value of 0.≥ 0
  • namestringrequired
    Name of the payment plan.5–128 chars
  • onDeletestringrequired
    Indicates what happens to existing subscriptions if the merchant deletes the payment plan. complete Stops existing subscriptions. continue Continues existing subscriptions.completecontinue
  • onUpdatestringrequired
    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.updatecontinue
  • paymentPlanIdstringrequired
    Unique identifier that the merchant assigns to the payment plan.1–48 chars
  • typestringrequired
    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.manualautomatic
  • recurringOrderobject
    Object that contains information about the cost of each payment. Note: Send this object only if the value for type is automatic.
    • amountintegerint64
      Total amount before surcharges. The value is in the currency's lowest denomination, for example, cents.
    • descriptionstring
      Description of the transaction.1–1024 chars
    • breakdownobject
      Object that contains information about the taxes that apply to the transaction.
      • subtotalintegerint64required
        Total amount for the transaction before tax. The value is in the currency's lowest denomination, for example, cents.
      • taxesobject[]
        Array of tax objects.+2 more fields at deeper levels — see the full spec
  • setupOrderobject
    Object that contains information about the initial cost that a customer pays to set up the subscription.
    • amountintegerint64
      Total amount before surcharges. The value is in the currency's lowest denomination, for example, cents.≤ 999999999999
    • descriptionstring
      Description of the transaction.1–1024 chars
    • breakdownobject
      Object that contains information about the taxes that apply to the transaction.
      • subtotalintegerint64required
        Total amount for the transaction before tax. The value is in the currency's lowest denomination, for example, cents.
      • taxesobject[]
        Array of tax objects.+2 more fields at deeper levels — see the full spec

Responses

Successful request. We created the payment plan.

201 Created · application/json
{
  "currency": "USD",
  "customFieldNames": [
    "yourCustomField"
  ],
  "description": "Monthly Premium Club subscription",
  "frequency": "monthly",
  "length": 12,
  "name": "Premium Club",
  "onDelete": "complete",
  "onUpdate": "continue",
  "paymentPlanId": "PlanRef8765",
  "processingTerminalId": "1234001",
  "recurringOrder": {
    "amount": 4999,
    "breakdown": {
      "subtotal": 4347,
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    },
    "description": "Monthly Premium Club subscription"
  },
  "setupOrder": {
    "amount": 4999,
    "breakdown": {
      "subtotal": 4347,
      "taxes": [
        {
          "name": "Sales Tax",
          "rate": 5
        }
      ]
    },
    "description": "Initial setup fee for Premium Club subscription"
  },
  "type": "automatic"
}
Response schema · 23 of 29 fields
  • currencystringrequired
    Currency of the transaction. The value for the currency follows the ISO 4217 standard.AEDAFNALLAMDANGAOAARSAUD+163 more
  • customFieldNamesstring[]
    Array of custom fields that you can use in subscriptions linked to the payment plan.
  • descriptionstring
    Description of the payment plan.0–128 chars
  • frequencystringrequired
    Indicates how often the merchant or the terminal collects a payment from the customer.weeklyfortnightlymonthlyquarterlyyearly
  • lengthintegerint32
    Number of payments for the payment plan. To indicate that the payment plan should run indefinitely, send a value of 0.≥ 0
  • namestringrequired
    Name of the payment plan.5–128 chars
  • onDeletestringrequired
    Indicates what happens to existing subscriptions if the merchant deletes the payment plan. complete Stops existing subscriptions. continue Continues existing subscriptions.completecontinue
  • onUpdatestringrequired
    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.updatecontinue
  • paymentPlanIdstringrequired
    Unique identifier that the merchant assigns to the payment plan.1–48 chars
  • processingTerminalIdstring
    Unique identifier of the terminal that the payment plan is assigned to.4–50 chars
  • typestringrequired
    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.manualautomatic
  • recurringOrderobject
    Object that contains information about the cost of each payment. Note: Send this object only if the value for type is automatic.
    • amountintegerint64
      Total amount before surcharges. The value is in the currency's lowest denomination, for example, cents.
    • descriptionstring
      Description of the transaction.1–1024 chars
    • breakdownobject
      Object that contains information about the taxes that apply to the transaction.
      • subtotalintegerint64required
        Total amount for the transaction before tax. The value is in the currency's lowest denomination, for example, cents.
      • taxesobject[]
        Array of tax objects.+3 more fields at deeper levels — see the full spec
  • setupOrderobject
    Object that contains information about the initial cost that a customer pays to set up the subscription.
    • amountintegerint64
      Total amount before surcharges. The value is in the currency's lowest denomination, for example, cents.≤ 999999999999
    • descriptionstring
      Description of the transaction.1–1024 chars
    • breakdownobject
      Object that contains information about the taxes that apply to the transaction.
      • subtotalintegerint64required
        Total amount for the transaction before tax. The value is in the currency's lowest denomination, for example, cents.
      • taxesobject[]
        Array of tax objects.+3 more fields at deeper levels — see the full spec

Used in workflows

Search documentation

API reference169
Guides118
Knowledge38
legal1
Solutions32
Workflows74
↑↓highlight↵openView all search results

Menu

Theme

Sign out

Your saved plans remain in your organization. This browser’s private draft and account view will be cleared.

Talk to an engineer