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

# Refunds, returns and cancellations

> Cancel a store order, request a return or refund a shopper after checkout.

After checkout
Each store order in a purchase is cancelled, returned or refunded on its own. Use the store order ID (`mord_…`) from the purchase.

## Choose the right action

| Situation | Use | Scope |
| - | - | - |
| The order hasn't shipped and the shopper changed their mind | Cancel the store order | `orders:write` |
| The shopper wants to send goods back | Request a return | `orders:write` |
| You need to refund the shopper | Refund the store order directly, or create a refund request for Ignyt to review | `orders:write` |
| Part of a purchase failed and you asked the shopper what to do | Record the shopper's decision | `orders:write` |

Cancellations, returns and refunds act on one store order; other store orders in the same purchase are not affected. A shopper decision applies to the whole purchase, so `cancel_remaining` can cancel several store orders at once.

## Cancel a store order

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "$IGNITE_API_BASE_URL/v1/merchant-orders/$MERCHANT_ORDER_ID/cancel" \
  -H "Authorization: Bearer $IGNITE_API_KEY"
```

Ignyt asks the store to cancel a placed or confirmed order. Calling it again for an already cancelled order returns the same result, and a retry after a lost response only looks the order up.

* `409` means the order can't be cancelled in its current state, the store refused, or the result is still being checked.
* `409 unsupported_operation` means the store can't cancel through Ignyt. Request a return instead.

## Request a return

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "$IGNITE_API_BASE_URL/v1/merchant-orders/$MERCHANT_ORDER_ID/returns" \
  -H "Authorization: Bearer $IGNITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason": "Wrong size"}'
```

Returns work for placed, confirmed, shipped or delivered orders. The merchant approves or rejects the return. Each call creates a new return request, so don't call it again to retry; read the order instead.

## Refund a store order

Refund part or all of one store order. Send an `Idempotency-Key` and keep it; if you don't get a response, retry with the same key and body.

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "$IGNITE_API_BASE_URL/v1/merchant-orders/$MERCHANT_ORDER_ID/refunds" \
  -H "Authorization: Bearer $IGNITE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-mord-001-1" \
  -d '{"amount_minor": 1000, "reason": "Damaged packaging"}'
```

Leave out `amount_minor` to refund the full refundable amount. The response includes the refund's `status`:

| Status | Meaning |
| - | - |
| `reserved`, `executing`, `pending` | The refund is in progress. |
| `unknown` | Ignyt didn't get a clear answer from the payment provider and is checking. Don't create another refund. |
| `succeeded` | The payment provider accepted the refund. The shopper's bank may take a few days to show it. |
| `failed` | The refund didn't happen. |

`422` means the amount is more than what is left to refund. `409` means the refund is blocked for now, for example while the payment is disputed.

## Ask Ignyt to review a refund

Use a refund request when a refund needs Ignyt's review first. This needs a **server** API key with `orders:write`.

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "$IGNITE_API_BASE_URL/v1/refund-requests" \
  -H "Authorization: Bearer $IGNITE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-request-001" \
  -d '{"child_order_id": "mord_01M8NWKBVMYAHB227PECJHN2G7", "amount_minor": 1000,
       "reason": "Customer reported damaged packaging",
       "items": [{"variant_id": "var_01M8NWKBAYTH0HJ78BAJDY180R", "qty": 1}]}'
```

The request starts as `submitted`. Ignyt approves it, rejects it, or asks for more information. If its status becomes `needs_information`, reply with `POST /v1/refund-requests/{request_id}/reply`, sending the current `expected_revision` and a `note` of 10–500 characters.

Approval is not the refund itself. Each request reports three separate statuses:

* `request_status`: where the review is.
* `execution_status`: whether the refund has been sent to the payment provider.
* `bank_credit_status`: always `not_confirmed`, because provider success doesn't prove the shopper's bank has posted the money.

Follow progress with `GET /v1/refund-requests/{request_id}`, its `/events` history, or the `order.refund_request.updated` webhook.

## When part of a purchase fails

If one store fails and others succeed, the purchase becomes `partially_placed`, and the failed store's share is refunded automatically. When the purchase offers the shopper a choice, record it:

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "$IGNITE_API_BASE_URL/v1/purchases/$PURCHASE_ID/decision" \
  -H "Authorization: Bearer $IGNITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"decision": "continue"}'
```

* `continue` keeps the store orders that succeeded.
* `cancel_remaining` asks each store to cancel its placed or confirmed order and refunds the orders that are cancelled. A store can refuse or not support cancellation; those orders stay and appear in `decision_outcomes` as `not_cancelled`. Shipped orders stay and follow the return flow. If the response is lost, repeat the same decision: a repeat of a completed decision returns the purchase without `decision_outcomes`, so read each order's `status` in `merchant_orders` instead.

Only one decision is allowed per purchase. Sending the same decision again is safe; a different one returns `409`.

## Customer emails

`GET /v1/purchases/{purchase_id}/notifications` lists the customer emails for a purchase, with their status. If Ignyt sends customer emails for your app, don't send your own copy when a webhook is retried or an email is delayed.

## Related guides

> [card] [Event types](https://docs.ignyt.si/event-types.md)
>
> Refund, order and payment events.

> [card] [Payments and settlements](https://docs.ignyt.si/payments-and-settlements.md)
>
> How refunds relate to merchant payouts.


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