Esenda

Orders list

Retrieve a paginated list of orders

Retrieve a cursor-paginated list of orders, optionally filtered by creation date and store. Orders are scoped to your partner account and store (when provided).

Endpoint

GET /v2/partner/orders/{shortcode}/list

Use the production or sandbox base URL from API conventions.

Headers

HeaderRequiredValue
AuthorizationYesBearer <ACCESS_TOKEN>
Content-TypeYesapplication/json
Accept-LanguageNoResponse language. Defaults to en-GB.

Path parameters

ParameterTypeRequiredDescriptionExample
shortcodeStringYesThe organisation's shortcode.example-school

Query parameters

ParameterTypeRequiredDescriptionExample
created-fromStringNoFilters to orders created on or after this date, in YYYY-MM-DD format. Inclusive from midnight UTC.2026-03-15
created-toStringNoFilters to orders created on or before this date, in YYYY-MM-DD format. Inclusive to 23:59:59 UTC.2026-03-15
store-idStringNoFilters to orders in a specific store. If not provided and the organisation has only one store, that store will be used.a7881587-55e5-4a39-b75f-cfc5b39de5c3
limitIntegerNo (default: 10, max: 100)Maximum number of orders to return10
cursorStringNoOpaque cursor identifying the position from which to continue retrieving orders. Cannot be combined with created-from or created-to.eyJkYXRlX2NyZWF0ZWQiOi...

Example request

GET /v2/partner/orders/{shortcode}/list?store-id=a7881587-55e5-4a39-b75f-cfc5b39de5c3&created-from=2026-03-01&created-to=2026-03-31&limit=10

Pagination

This endpoint uses cursor-based pagination. If more results are available, the response contains a next_cursor value. Pass this as the cursor query parameter on the next request to retrieve the following page.

The cursor encodes the original date filters, so created-from and created-to must not be repeated when paginating. Providing either alongside a cursor returns a validation error. Only limit can be combined with cursor.

A null next_cursor means there are no further results.

Response

{
  "next_cursor": "eyJkYXRlX2NyZWF0ZWQiOi...",
  "data": [
    {
      "order_id": "001a7b06-6ca9-4c05-8d6a-df5d9d9db7e3",
      "store_id": "a7881587-55e5-4a39-b75f-cfc5b39de5c3",
      "amount": 100,
      "status": "completed",
      "description": "Order for product XYZ",
      "reference": "PENCILS",
      "external_id": null,
      "line_items": [],
      "refunds": [],
      "custom_data": {
        "additionalProp1": "prop"
      },
      "payments": [
        {
          "payment_id": "cb03882b-25a0-45e8-b6f1-aa5cd303f88d",
          "amount": 100,
          "payment_method": "open_banking",
          "status": "failed",
          "failure_reason": "INSUFFICIENT_FUNDS",
          "date_created": "2025-10-24T14:46:39.264381Z",
          "date_modified": "2025-10-24T14:46:39.264381Z"
        }
      ],
      "date_created": "2025-10-24T14:46:39.264381Z",
      "date_modified": "2025-10-24T14:46:39.264381Z"
    }
  ]
}

Response fields

Top-level fields

FieldTypeDescription
next_cursorString | nullPass as the cursor query parameter to retrieve the next page. null when there are no further results.
dataArrayOrders returned by the request, most recently created first.

Order object

FieldTypeDescription
order_idStringUnique identifier for the order.
store_idStringThe store this order belongs to.
amountIntegerOrder amount in minor units (pence).
statusStringCurrent status of the order. Possible values: created, completed, expired, refunded, partially_refunded.
descriptionString | nullDescription of the order.
referenceString | nullReference for the order. Deprecated; use external_id.
external_idString | nullThe partner's order identifier, as sent on the checkout session.
line_itemsArrayThe order's line items. See line-item object.
refundsArrayRefunds on the order. See refund object.
custom_dataObjectCustom data associated with the order.
paymentsArrayPayment attempts on the order, not including refunds. Empty if no payments exist. See payment object.
date_createdStringUTC timestamp when the order was created.
date_modifiedStringUTC timestamp when the order was last modified.

reference is deprecated. It's still returned, and will be phased out by the end of 2026. Use external_id instead.

Line-item object

FieldTypeDescription
line_item_idStringesenda's identifier for the line item. Use it for line-item refunds.
external_idStringAs sent on the checkout session.
descriptionStringAs sent on the checkout session.
amountIntegerAmount in minor units (pence).
amount_refundedIntegerTotal successfully refunded on this line item so far, in pence. 0 if none.
statusStringSame values as the order status.
payout_route_idStringThe payout route the line item is paid into, as sent on the checkout session.
fee_amountInteger | nullThis line item's share of the esenda fee. null until the payment is settled and paid out. See how fees are allocated.
payout_idString | nullThe payout the line item was settled in. null until paid out.

Refund object

The order's successful refunds, oldest first. An empty array when the order has no refunds. Refunds that are pending or failed aren't included; use the refunds response to track those.

FieldTypeDescription
refund_idStringRefund identifier.
amountIntegerTotal refund amount in pence.
reasonString | nullRefund reason, if provided.
date_createdStringISO 8601 timestamp when the refund was created.
line_itemsArrayThe line items refunded, each with line_item_id and the amount refunded, in pence.

Payment object

FieldTypeDescription
payment_idStringUnique identifier for the payment.
amountIntegerPayment amount in pence.
payment_methodStringPayment method used for the payment. Possible values: card, open_banking, bacs, bank_transfer.
statusStringCurrent status of the payment. Possible values: success, failed, cancelled, refunded, partially_refunded, accepted, processing.
failure_reasonString | nullFailure reason, if available. Not present on all failed payments. See failure reasons for known values.
date_createdStringUTC timestamp when the payment was created.
date_modifiedStringUTC timestamp when the payment was last modified.

How fees are allocated to line items

The esenda fee for a payment is shared across its line items in proportion to their amounts. Each share is rounded down to the penny, and any remainder goes to the largest line item.

The allocation is calculated when the payment is captured. esenda fees aren't returned on refunds, so fee_amount doesn't change after a refund.

Example order

This example shows only the new order fields. One line item has been refunded in full, so the order is partially_refunded. Its fee_amount stays at 150.

{
  "order_id": "ord_7d41",
  "external_id": "INV-10432",
  "status": "partially_refunded",
  "line_items": [
    {
      "line_item_id": "li_8f2a",
      "external_id": "INV-10432-1",
      "description": "Tuition",
      "amount": 115000,
      "amount_refunded": 0,
      "status": "completed",
      "payout_route_id": "8a1f3c52-6b0e-4f0e-9d4f-2f1c7f5b9a10",
      "fee_amount": 1725,
      "payout_id": "po_3k9d"
    },
    {
      "line_item_id": "li_8f2b",
      "external_id": "INV-10432-2",
      "description": "Year 9 trip",
      "amount": 10000,
      "amount_refunded": 10000,
      "status": "refunded",
      "payout_route_id": "7c2e9f4a-5b3d-4e8a-b5c6-3f1d2b3e4a5c",
      "fee_amount": 150,
      "payout_id": "po_3k9e"
    }
  ],
  "refunds": [
    {
      "refund_id": "rf_2c11",
      "amount": 10000,
      "reason": "Trip cancelled",
      "date_created": "2026-11-05T10:14:00Z",
      "line_items": [
        {
          "line_item_id": "li_8f2b",
          "amount": 10000
        }
      ]
    }
  ]
}

Failure reasons

The failure_reason field isn't guaranteed to be present, even on failed payments. The values below are known at the time of writing, and new ones may be added.

CategoryValue
Card: declined or restrictedCARD_DECLINED
RESTRICTED_CARD
CARD_BLOCKED
CARD_NOT_SUPPORTED
ISSUER_UNAVAILABLE
Card: validityINSUFFICIENT_FUNDS
EXPIRED_CARD
INVALID_CARD
INCORRECT_CVV
3D Secure and authorisationAUTHENTICATION_REJECTED_BY_CARD_ISSUER_3D_AUTH_FAILED
CANNOT_AUTHORISE_CARD_3D_AUTH_FAILED
AWAITING_3D_AUTHENTICATION
AUTHORISATION_CANCELLED
AUTHORISATION_NOT_PROVIDED
REJECTED
FraudSUSPECTED_FRAUD
VERIFICATION_DECLINED
TransactionTRANSACTION_NOT_PERMITTED
TRANSACTION_NOT_FOUND
TRANSACTION_TIMED_OUT
EXPIRED_PAYMENT
PAYMENT_LIMIT_EXCEEDED
EXCESSIVE_SURCHARGE
AccountCLOSED_ACCOUNT
RECURRING_TOKEN_REVOKED

On this page