Create Payment Request
POST {{base_url}}/banking/v2/pay/payment-request
The 'Create Payment Request' endpoint can be used to create request to pay link which will be powered by tomato pay web payment journey with pre-filled creditor and payment details.
On clicking the web app, the user can make a payment by selecting their bank.
Attributes
Field | Type | Description |
---|---|---|
creditor | JSON object | Creditor information |
creditor -> accountId | string | Unique identifier for the bank account (this is provided by Retrieve Bank Accounts endpoint) |
currency | string | Account currency |
amount | integer | Payment amount |
reference | string | Transaction reference |
paymentType | string | Payment type {DOMESTIC} |
usage | string | {SINGLE/MULTI} Configure the request to take either single or multiple payments |
isProtected | boolean | If set to true, retrieve endpoints will mask bank account details. |
purpose | string | {INVOICE, INSTANT_PAYMENTS, ECOMM, OTHERS} Purpose for which the payment is being taken |
Error Messages
Condition | Response Status | Response Body |
---|---|---|
No request body | 400 Bad Request | {error: "Missing/Invalid json”} |
No currency in the request body | 400 Bad Request | {error: Missing/invalid currency} |
No amount in the request body | 400 Bad Request | {error: Missing/invalid amount} |
Reference greater than 35 characters in the request body | 400 Bad Request | {error: The reference field has a maximum of 18 chars} |
Invalid type | 400 Bad Request | {error: "Missing/Invalid type. Must be DOMESTIC |
No creditor in the request body | 400 Bad Request | {error: One of the following is mandatory: \[creditor, creditorAccountId\]} |
Server error | 500 Internal server error |
Request Body
{"creditor"=>{"accountId"=>"6f440597-5af7-45f9-bf0d-0abbea113abd"}, "currency"=>"GBP", "amount"=>"0.01", "reference"=>"test reference", "paymentType"=>"DOMESTIC", "usage"=>"SINGLE", "status"=>"ACTIVE", "isProtected"=>false, "purpose"=>"OTHERS"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
X-Api-Key | string | ||
X-Partner-Id | string | ||
Authorization | string | ||
X-Company-Id | string |