Refunds
Refund a whole order or selected line items
Refund a whole order, or one or more of its line items in full or in part. An order can have more than one refund.
Endpoint
POST /v2/partner/orders/{shortcode}/{order_id}/refundsUse the production or sandbox base URL from API conventions.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
shortcode | String | Yes | The organisation's shortcode. |
order_id | UUID | Yes | The order to refund. |
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <ACCESS_TOKEN> |
Content-Type | Yes, with a body | application/json. Not needed for a whole-order refund sent with no body. |
Idempotency-Key | Yes | Unique per refund request, for example a UUID. Repeating a request with the same key returns the original refund rather than creating a new one. See idempotency. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
line_items | Array | No | The line items to refund, at least one, each listed once. Leave out to refund the whole order. See line items to refund. |
reason | String | No | Free text, up to 60 characters. |
Line items to refund
| Field | Type | Required | Description |
|---|---|---|---|
line_item_id | UUID | Yes | The line item to refund. |
amount | Integer | No | Amount in minor units (pence), at least 1. Defaults to the line item's remaining refundable amount. |
How refunds work
- With no
line_items, whatever is still refundable on every line item is refunded. Line items that are already fully refunded are left out. - With
line_items, only the line items listed are refunded, each for itsamountor what's left on it. A single request can refund several line items. - A line item can be refunded more than once, up to its amount in total.
- The order must be
completedorpartially_refunded, and must have line items. Orders created withoutline_itemscan't be refunded through the API. - Refunds through the API cover GBP card payments.
- A refund comes out of the payout route the line item was paid into, and shows as a deduction on that route's next payout.
- esenda fees aren't returned.
- The refund is requested from the payment provider, so it starts as
pending. The outcome is confirmed through theorder.updatedwebhook, which lists the order's successful refunds. - Repeating a request with the same
Idempotency-Keyreturns the original refund with200. A new refund returns201. Reusing a key for a different request returns422.
Examples
Refund a whole order
POST /v2/partner/orders/ABCSCH/001a7b06-6ca9-4c05-8d6a-df5d9d9db7e3/refunds
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json
Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7{
"reason": "Pupil left"
}Refund one or more line items
POST /v2/partner/orders/ABCSCH/001a7b06-6ca9-4c05-8d6a-df5d9d9db7e3/refunds
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json
Idempotency-Key: 16fd2706-8baf-433b-82eb-8c7fada847daThe first line item is refunded for 5000 pence. The second has no amount, so what's left on it is refunded.
{
"line_items": [
{
"line_item_id": "5b2e8f1a-3c4d-4e6f-8a9b-0c1d2e3f4a5b",
"amount": 5000
},
{
"line_item_id": "9d3c1e7b-6a52-4f08-b1d4-2e8a7c5f0b36"
}
],
"reason": "Trip partly cancelled"
}Response
Returns 201 Created with the refund object. A repeated request with the same Idempotency-Key returns 200 OK with the original refund.
| Field | Type | Description |
|---|---|---|
refund_id | String | Refund identifier. |
order_id | String | The order being refunded. |
amount | Integer | Total refund amount in minor units (pence). |
status | String | pending, refunded or refund_failed. |
reason | String | null | Refund reason, if provided. |
line_items | Array | The line items refunded, and how much on each. See refunded line item. |
date_created | String | ISO 8601 timestamp when the refund was created. |
Refunded line item
| Field | Type | Description |
|---|---|---|
line_item_id | String | The line item refunded. |
amount | Integer | Amount refunded on the line item, in pence. |
A whole-order refund has one entry for each line item that had something left to refund.
{
"refund_id": "cb03882b-25a0-45e8-b6f1-aa5cd303f88d",
"order_id": "001a7b06-6ca9-4c05-8d6a-df5d9d9db7e3",
"amount": 5000,
"status": "pending",
"reason": "Trip partly cancelled",
"line_items": [
{
"line_item_id": "5b2e8f1a-3c4d-4e6f-8a9b-0c1d2e3f4a5b",
"amount": 5000
}
],
"date_created": "2026-11-05T10:14:00.131483Z"
}The refunds array on the orders list and in the order.updated webhook uses a similar object, but only for successful refunds.
See errors for the error response format.