Esenda
Hosted Checkout

Payment Request

Create a hosted checkout payment request

Once authenticated, make a request to start a new transaction. This generates a payment link to redirect the user to and a request_id to track the payment status.

Production: POST https://api.esenda.com/v1/partner/payment-links/one-time-use

Sandbox: POST https://api-demo.esenda.com/v1/partner/payment-links/one-time-use

Headers

Accept-Language: <LANGUAGE>   (optional, default en-GB)
Authorization:   Bearer <ACCESS_TOKEN>
Content-Type:    application/json

Request Parameters

ParameterTypeRequiredDescriptionExample
shortcodeStringYesYour Esenda identifierexample_school
email_addressStringYesThe payer's email addressjohn@example.com
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-24

Payload Example

{
  "shortcode": "example_school",
  "email_address": "john@example.com",
  "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-24"
}

Responses

200 — Success

Store the request_id and redirect the user to payment_link.

{
  "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

Example:

https://your-site.com?referenceId=b768c458-1f83-41c9-8147-6ac4ad153dfa&paymentType=card

On this page