Hosted Checkout
Multi Payment Requests
Create multiple payment requests in a single hosted checkout
Once authenticated, make a request to create multiple transactions at once. This generates a collection of payment links and a request_id per item.
Production: POST https://api.esenda.com/v1/partner/payments/{shortcode}/payment-links
Sandbox: POST https://api-demo.esenda.com/v1/partner/payments/{shortcode}/payment-links
Headers
Accept-Language: <LANGUAGE> (optional, default en-GB)
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/jsonRequest Parameters
Pass an array of objects. Each object supports the following fields:
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
shortcode | String | Yes | Your Esenda identifier | example_school |
email_address | String | Yes | The payer's email address | john@example.com |
reference | String | Yes | Payment reference — must be unique, max 18 ASCII characters | abc123 |
description | String | Yes | The payment purpose | admissions payment |
amount | Integer | Yes | Payment amount in the lowest denomination of client currency (e.g. pence) | 100 |
country | String | No | Country code in ISO 3166-1 alpha-2 format | GB |
payor_first_name | String | No | The payor's first name | John |
payor_last_name | String | No | The payor's last name | Smith |
address_line_1 | String | No | First line of the payor's address | 1 Test House |
address_line_2 | String | No | Second line of the payor's address | Test Street |
city | String | No | The payor's city | London |
state | String | No | The payor's state | |
postal_code | String | No | The payor's postal code | LL33 0SN |
custom_data | Object | No | Any additional data used to identify the transaction | {"key": "value"} |
return_url | String | No | URL to redirect the payor after completing payment | https://your-site.com |
notification_url | String | No | URL for Esenda to POST a transaction status update | https://webhooks.com |
link_expiry_date | String | No | Expiry date for the payment link — defaults to 48 hours after creation | 2024-07-26 |
Payload Example
[
{
"shortcode": "example_school",
"email_address": "john@example.com",
"reference": "abc",
"description": "admissions payment",
"amount": 100,
"country": "GB",
"payor_first_name": "John",
"payor_last_name": "Smith",
"address_line_1": "somestreet",
"address_line_2": "someplace",
"city": "London",
"state": "unsure",
"postal_code": "LL33 0SN",
"custom_data": {
"additionalProp1": "prop",
"additionalProp2": "PROP"
},
"return_url": "https://your-site.com",
"notification_url": "https://webhooks.com",
"link_expiry_date": "2024-07-26"
}
]Responses
200 — Success
The response is keyed by each item's reference. Store each request_id and redirect users to their respective payment_link.
{
"abc": {
"payment_link": "https://epay.esenda.com/shortcode/b768c458-1f83-41c9-8147-6ac4ad153dfa",
"request_id": "6c6b77ba-fc4a-4a18-a1d9-5b2cdc2f8cdf"
}
}400 — Bad Request
{
"error": "Bad request",
"message": "No organisation with shortcode {GBC-1234}"
}Return URL Parameters
After payment, if a return_url was supplied, the user is redirected there with these query parameters:
| Parameter | Description | Values |
|---|---|---|
referenceId | UUID payment identifier | UUID |
paymentType | Payment method used | open_banking, card, bank_transfer |