Payments are made as part of a pay run. A Pay Run may have 1 or more payables associated with it, payables may be grouped. This provides a uniform way to make single or batch payments.
Creating a Pay Run
In order to create a Pay Run you will need to perform a POST - Create pay run request.
A pay run needs to contain a valid payerBankAccountId
, corresponding to one of the bank accounts available via GET - Organisation Bank Accounts. Pay runs should also contain beneficiary bank account details for each constituent payable.
Example payload
{
"partnerEntityId": "Your-PayRun-ID1",
"partnerClientId": "Your-Unique-ID",
"scheduledExecutionDate": "2023-02-01",
"payerBankAccountId": "Bank-Account-ID",
"payables": [
{
"partnerEntityId": "Your-Payable-ID1",
"amount": {
"currencyCode": "GBP",
"amountInMinorUnits": 1275
},
"reference": "My-Ref-1234",
"beneficiaryAccount": {
"accountRoutingName": "Test Company 1 LTD",
"country": "GB",
"sortCode": "12-34-56",
"accountNumber": "12345678"
}
},
{
"partnerEntityId": "Your-Payable-ID2",
"amount": {
"currencyCode": "GBP",
"amountInMinorUnits": 2005
},
"reference": "My-Ref-1235",
"beneficiaryAccount": {
"accountRoutingName": "Test Company 1 LTD",
"country": "GB",
"sortCode": "12-34-56",
"accountNumber": "12345678"
}
},
{
"partnerEntityId": "Your-Payable-ID3",
"amount": {
"currencyCode": "GBP",
"amountInMinorUnits": 1050
},
"reference": "My-Ref-1235",
"beneficiaryAccount": {
"accountRoutingName": "Test Company 2 LTD",
"country": "GB",
"sortCode": "65-43-21",
"accountNumber": "87654321"
}
}
],
"groups": [
{
"partnerEntityId": "Your-Group-ID",
"paymentIds": [
"Your-Payment-ID1",
"Your-Payment-ID2"
],
"reference": "Group-Ref-1"
}
]
}
Response
You will receive back a 201
response with a PayRunId
value. You'll need this for initiating payment and tracking statuses.
Making a Payment
To initiate the payment of a pay run you must call the checkout endpoint with the PayRunId
returned above. This will initialise a new payment workflow and return the final checkout URL to which the user must be redirected, allowing the payer to begin the Open Banking payment workflow. For specific details on the endpoint see GET - Checkout.
A returnUrl
may be set and specifies where the user will be sent following completion of the pay run.
An example URI with a custom domain would look like: https://payments.example.com/pay-runs/checkout/{payRunId}?returnUrl=https://www.example.com
If the returnUrl
is not set then it must be set on the final checkout URL returned from the Checkout endpoint.