Esenda
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/json

Request Parameters

Pass an array of objects. Each object supports the following fields:

ParameterTypeRequiredDescriptionExample
shortcodeStringYesYour Esenda identifierexample_school
email_addressStringYesThe payer's email addressjohn@example.com
referenceStringYesPayment reference — must be unique, max 18 ASCII charactersabc123
descriptionStringYesThe payment purposeadmissions payment
amountIntegerYesPayment amount in the lowest denomination of client currency (e.g. pence)100
countryStringNoCountry code in ISO 3166-1 alpha-2 formatGB
payor_first_nameStringNoThe payor's first nameJohn
payor_last_nameStringNoThe payor's last nameSmith
address_line_1StringNoFirst line of the payor's address1 Test House
address_line_2StringNoSecond line of the payor's addressTest Street
cityStringNoThe payor's cityLondon
stateStringNoThe payor's state
postal_codeStringNoThe payor's postal codeLL33 0SN
custom_dataObjectNoAny additional data used to identify the transaction{"key": "value"}
return_urlStringNoURL to redirect the payor after completing paymenthttps://your-site.com
notification_urlStringNoURL for Esenda to POST a transaction status updatehttps://webhooks.com
link_expiry_dateStringNoExpiry date for the payment link — defaults to 48 hours after creation2024-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:

ParameterDescriptionValues
referenceIdUUID payment identifierUUID
paymentTypePayment method usedopen_banking, card, bank_transfer

On this page