> ## 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.

# Replace tender

> Swap a failed tender for a new method on a placed order.

Adds a new tender with `replaces_tender_id` pointing at a `FAILED` real tender. The replacement is checked with the same rules as the original intent. Charge it again with `order.payIntent()`.

> [!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 and the intent must be `LOCKED`.

In `@fire-spark/storefront`, call `order.replaceTender(tenderId, payment, collectAt)`.

## Path parameters

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

## Request body

| Field | Required | Description |
| - | - | - |
| `method` | Yes | Replacement method |
| `payment_id` | Yes | Merchant payment id |
| `provider` | Yes | Catalog provider id |
| `collect_at` | Yes | `DEVICE`, `KIOSK`, `COUNTER`, `DOOR`, or `OTHER` |

```bash theme={null}
curl -X POST "https://firespark.cloud/api/storefront/v1/orders/ord-48291/tenders/tnd-card-1/replace" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "CASH",
    "payment_id": "3b1c8f2e-5a44-4d1b-9c0e-2f6a1d8b7e90",
    "provider": "firespark",
    "collect_at": "COUNTER"
  }'
```

## Response

Returns `200` with the order. The new tender is on the locked intent.

## Error responses

| Status | Description |
| - | - |
| `404` | Order or live tender not found |
| `409` | The tender is not `FAILED`, or the order is still `OPEN` (`details.code: PAYMENT_INTENT_LOCKED`) |
| `422` | The replacement fails the same checks as [Save payment intent](https://firespark.cloud/docs/storefront-api/orders/\[id]/payment-intent/put) |


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