Skip to content
payrocdevelopers

Pay manual subscription

Browse API reference

POST/processing-terminals/{processingTerminalId}/subscriptions/{subscriptionId}/paypaySubscription

Use this method to manually collect a payment linked to a subscription. You can manually collect a payment only if the merchant chose not to let our gateway automatically collect each payment.

To manually collect a payment, you need the subscriptionId of the subscription that's linked to the payment. You sent the subscriptionId in the request of the Create Subscription method.

Note: If you don't have the subscriptionId, use our List Subscriptions method to search for the subscription.

The request includes an order object that contains information about the amount that you want to collect.

In the response, our gateway returns information about the payment and a paymentId. You can use the paymentId in follow-on actions with the Payments endpoints or Bank Transfer Payments endpoints.

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.

subscriptionIdRequiredpathstring

Unique identifier that the merchant assigned to the subscription.

Request body

application/json · required
  • customFieldsobject[]
    Array of customField objects.
    • namestringrequired
      Name of the custom field.1–56 chars
    • valuestringrequired
      Value for the custom field.1–100 chars
  • operatorstring
    Operator who initiated the request.0–50 chars
  • orderobjectrequired
    Object that contains information about the initial cost that a customer pays to set up the subscription.
    • amountintegerint64
      Total amount for the transaction. The value is in the currency's lowest denomination, for example, cents.<br/> <br/>Important: Do not add the surcharge to the amount parameter in the request. If the transaction is eligible for surcharging, our gateway adds the surcharge to the amount in the request, and then returns the updated amount in the response.≤ 999999999999
    • descriptionstring
      Description of the transaction.1–1024 chars
    • orderIdstring
      Unique identifier that the merchant assigns to the transaction.1–24 chars
    • breakdownobject
      Object that contains information about the surcharge and 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.
      • surchargeobject
        Object that contains information about the surcharge that we applied to the transaction.+1 more fields at deeper levels — see the full spec
      • taxesobject[]
        Array of tax objects.+2 more fields at deeper levels — see the full spec

Responses

Successful request. We have processed the payment for the subscription.

201 Created · application/json
{
  "currentState": {
    "nextDueDate": "2024-08-02",
    "outstandingInvoices": 2,
    "paidInvoices": 1,
    "status": "active"
  },
  "customFields": [
    {
      "name": "yourCustomField",
      "value": "abc123"
    }
  ],
  "payment": {
    "amount": 4999,
    "currency": "USD",
    "dateTime": "2024-07-02T15:30:00Z",
    "link": {
      "href": "https://api.payroc.com/v1/bank-transfer-payments/M2MJOG6O2Y",
      "method": "GET",
      "rel": "self"
    },
    "paymentId": "M2MJOG6O2Y",
    "responseCode": "A",
    "responseMessage": "Transaction approved",
    "status": "ready"
  },
  "processingTerminalId": "1234001",
  "secureToken": {
    "customerName": "Sarah Hazel Hopper",
    "link": {
      "href": "https://api.payroc.com/v1/processing-terminals/1234001/secure-tokens/MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
      "method": "GET",
      "rel": "self"
    },
    "secureTokenId": "MREF_abc1de23-f4a5-6789-bcd0-12e345678901fa",
    "status": "notValidated",
    "token": "296753123456"
  },
  "subscriptionId": "SubRef7654"
}
Response schema · 31 fields
  • currentStateobjectrequired
    A snapshot of the subscription's current state.
    • nextDueDatestringdate
      Date that the merchant collects the next payment.
    • outstandingInvoicesintegerint32
      Number of payments until the end of the subscription. Our gateway returns a value for outstandingInvoices only if the subscription has an end date or a fixed number of billing cycles.≥ 0
    • paidInvoicesintegerint32required
      Number of payments that the merchant has collected.≥ 0
    • statusstringrequired
      Status of the Subscription. 'active' - Subscription is active. 'completed' - Subscription has reached the end date or the total number of billing cycles. 'cancelled' - Merchant deactivated the subscription. 'suspended' - Subscription is suspended. For example, if the customer misses payments.activecompletedsuspendedcancelled
  • customFieldsobject[]
    Array of customField objects.
    • namestringrequired
      Name of the custom field.1–56 chars
    • valuestringrequired
      Value for the custom field.1–100 chars
  • paymentobjectrequired
    Object that contains information about a payment.
    • amountintegerint64required
      Amount of the payment. This value is in the currency’s lowest denomination, for example, cents.
    • currencystringrequired
      Currency of the transaction. The value for the currency follows the ISO 4217 standard.AEDAFNALLAMDANGAOAARSAUD+163 more
    • dateTimestringdate-timerequired
      Date and time that the payment was processed.
    • linkobject
      Object that contains HATEOAS links for the resource.
      • hrefstringrequired
        URL of the target resource.
      • methodstringrequired
        HTTP method that you need to use with the target resource.
      • relstringrequired
        Indicates the relationship between the current resource and the target resource.
    • paymentIdstringrequired
      Unique identifier of the payment.10–10 chars
    • responseCodestringrequired
      Response from the processor. A The processor approved the transaction. D The processor declined the transaction. E The processor received the transaction but will process the transaction later. P The processor authorized a portion of the original amount of the transaction. R The issuer declined the transaction and indicated that the customer should contact their bank. C The issuer declined the transaction and indicated that the merchant should keep the card as it was reported lost or stolen.ADEPRC
    • responseMessagestring
      Response description from the processor.1–48 chars
    • statusstringrequired
      Current status of the payment.readypendingdeclinedcompletereferralpickupreversalreturned+3 more
  • processingTerminalIdstringrequired
    Unique identifier of the terminal that the subscription is linked to.
  • secureTokenobjectrequired
    Object that contains information about the secure token.
    • customerNamestringrequired
      Customer's name.1–50 chars
    • linkobject
      Object that contains HATEOAS links for the resource.
      • hrefstringrequired
        URL of the target resource.
      • methodstringrequired
        HTTP method that you need to use with the target resource.
      • relstringrequired
        Indicates the relationship between the current resource and the target resource.
    • secureTokenIdstringrequired
      Unique identifier that the merchant assigned to the secure token.1–200 chars
    • statusstringrequired
      Status of the customer's bank account. The processor performs a security check on the customer's bank account and returns the status of the account. Note: Depending on the merchant's account settings, this feature may be unavailable.notValidatedcvvValidatedvalidationFailedissueNumberValidatedcardNumberValidatedbankAccountValidated
    • tokenstringrequired
      Token that the merchant can use in future transactions to represent the customer's payment details. The token: Begins with the six-digit identification number 296753. Contains up to 12 digits. Contains a single check digit that we calculate using the Luhn algorithm.12–19 chars
  • subscriptionIdstringrequired
    Unique identifier that the merchant assigned to the subscription.

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