Skip to content
payrocdevelopers

Partially update payment plan

Browse API reference

PATCH/processing-terminals/{processingTerminalId}/payment-plans/{paymentPlanId}updatePaymentPlan

Use this method to partially update a payment plan. Structure your request to follow the RFC 6902 standard.

To update a payment plan, you need its paymentPlanId, which you sent in the request of the Create Payment Plan method.

Note: If you don't have the paymentPlanId, use our List Payment Plans method to search for the payment plan.

You can update all of the properties of the payment plan except for the paymentPlanId.

The value you sent for the onUpdate parameter when you created the payment plan indicates what happens to the associated subscriptions when you update the plan:

  • update - Our gateway updates the subscriptions associated with the payment plan.
  • continue - Our gateway doesn't update the subscriptions associated with 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.

paymentPlanIdRequiredpathstring

Unique identifier that the merchant assigned to the payment plan.

Request body

application/json · required
  • Patch Add Operationobject
    A Patch Add Operation.
    • opstringrequired
      add operation.add
    • pathstringrequired
      Location where you want to add the value. The format for this value is JSON Pointer.
    • valueobjectrequired
      Value that you want to add to the resource.
  • Patch Remove Operationobject
    A Patch Remove Operation.
    • opstringrequired
      remove operation.remove
    • pathstringrequired
      Location of the value that you want to remove. The format for this value is JSON Pointer.
  • Patch Replace Operationobject
    A Patch Replace Operation.
    • opstringrequired
      replace operation.replace
    • pathstringrequired
      Location of the value that you want to replace. The format for this value is JSON Pointer.
    • valueobjectrequired
      Value that you want to use as the replacement.
  • Patch Move Operationobject
    A Patch Move Operation.
    • fromstringrequired
      Location of the value that you want to move. The format for this value is JSON Pointer.
    • opstringrequired
      move operation.move
    • pathstringrequired
      Location where you want to move the value to. The format for this value is JSON Pointer.
  • Patch Copy Operationobject
    A Patch Copy Operation.
    • fromstringrequired
      Location of the value that you want to copy. The format for this value is JSON Pointer.
    • opstringrequired
      copy operation.copy
    • pathstringrequired
      Location where you want to copy the value to. The format for this value is JSON Pointer.
  • Patch Test Operationobject
    A Patch Test Operation.
    • opstringrequired
      test operation.test
    • pathstringrequired
      Location of the value that you want to test. The format for this value is JSON Pointer.
    • valueobjectrequired
      Value that you want to compare with the current value at the path.

Responses

Successful request. We updated the payment plan.

200 OK · application/json
{
  "currency": "USD",
  "customFieldNames": [
    "yourCustomField",
    "loyaltyPoints"
  ],
  "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