> ## Documentation Index
> Fetch the complete documentation index at: https://firespark.cloud/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund tender

> Refund one paid tender in full, by amount, or by units.

Refunds one `PAID` tender that still has money left. Omit `amount` and `items` for a full refund. Send `amount` or `items`, not both. The call is idempotent by `idempotency_key`.

> [!NOTE]
>
> Requires a Storefront API access token from [Token
> exchange](https://firespark.cloud/docs/storefront-api/oauth/exchange/post.md). The order must already be
> placed.

In `@fire-spark/storefront`, call `order.refundTender(tenderId, { amount, reason })`.

## Path parameters

| Parameter | Required | Description |
| - | - | - |
| `id` | Yes | External order identifier |
| `tenderId` | Yes | Tender identifier |

## Request body

| Field | Required | Description |
| - | - | - |
| `idempotency_key` | Yes | 10–64 characters |
| `amount` | No | Partial refund, greater than 0 |
| `items` | No | `[{ line_uid, units? }]`. Do not send with `amount`. |
| `reason` | No | Up to 500 characters |

```bash theme={null}
curl -X POST "https://firespark.cloud/api/storefront/v1/orders/ord-48291/tenders/tnd-card-1/refund" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "idempotency_key": "refund-9f3c1a20b4", "amount": 4.5 }'
```

## Response

Returns `200` with the order. `refunded_total` on the tender increases by the refunded amount. A full refund sets the tender status to `REFUNDED`. A provider result of `NEEDS_REVIEW` still applies the refund and reports the case for review. A rejection returns `502` and leaves the tender unchanged.

## Error responses

| Status | Description |
| - | - |
| `404` | Order or tender not found |
| `409` | The order is still `OPEN`, or the tender is not paid with money left |
| `422` | `amount` and `items` were both sent |
| `502` | The provider rejected the refund |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.