API conventions
Shared conventions for the esenda partner API
These conventions apply to every partner API endpoint.
Base URLs
| Environment | Base URL |
|---|---|
| Production | https://api.esenda.com |
| Sandbox | https://api-demo.esenda.com |
Partners
Each partner integration has its own esenda partner account, with one client ID and secret. Orders, refunds and payouts are scoped to the partner account.
Organisations
Each customer, such as a school, is an esenda organisation, identified by its shortcode. esenda sets the shortcode, and it's passed in the path of every organisation call. Organisation applications are the exception, because they're submitted before the organisation is connected to your account.
Partner access
A partner can act for an organisation only after the organisation completes onboarding and authorises that partner. The organisation can revoke that access at any time. To ask esenda to onboard an organisation or connect it to your account, submit an organisation application.
An organisation can authorise several partners. Each partner sees only its own orders, refunds and payouts.
Amounts
Amounts are integers in minor units (pence). Settlement is in GBP.
Timestamps and dates
Timestamps are ISO 8601. Dates are YYYY-MM-DD.
Pagination
List endpoints paginate the same way as the orders list.
Idempotency
Refund requests carry an Idempotency-Key header. Repeating a request with the same key returns the original result.
Webhooks
Webhooks are signed with HMAC SHA-512 in the X-Hmac-Signature header. esenda retries a webhook up to 5 times and expects a 200 OK response.