# Acknowledging an order

## Acknowledging an order
- **`POST /orders/{order_id}/acknowledgements`** — after you import an order
into your ERP, report the result back so the Mercura operator can see it.
Send `status: "SUCCESS"` (optionally with your own `external_id`, a
free-text `message`, and any `metadata`), or `status: "FAILED"` with a
required `message` describing why. The call is idempotent and
**latest-wins** for the status and message (a retry that first failed then
succeeded ends up `SUCCESS`); a once-reported `external_id` is kept even if
a later acknowledgement omits it. On a `SUCCESS` your `external_id` is also
written back to the order's `erp_offer_id`, so it shows up everywhere Mercura
reads that field; a `FAILED` acknowledgement records it on the
acknowledgement only, since `erp_offer_id` means "this was exported"
throughout Mercura. The response body is the recorded acknowledgement only —
`{ status, external_id, message, metadata, acknowledged_at }`, the same
shape as the order's `acknowledgement` field — a small deterministic
confirmation of what Mercura persisted (including the sticky `external_id`)
without refetching the whole order.
The acknowledgement **does** move the order's workflow `status`, since it is
the outcome of its export: `SUCCESS` → `EXPORTED`, `FAILED` →
`EXPORT_FAILED` (which puts the order in front of a Mercura user for rework).
It never re-triggers an export.

Version: 1.79.2

## Description:

  - `Acknowledging an order` ()
    - **`POST /orders/{order_id}/acknowledgements`** — after you import an order
into your ERP, report the result back so the Mercura operator can see it.
Send `status: "SUCCESS"` (optionally with your own `external_id`, a
free-text `message`, and any `metadata`), or `status: "FAILED"` with a
required `message` describing why. The call is idempotent and
**latest-wins** for the status and message (a retry that first failed then
succeeded ends up `SUCCESS`); a once-reported `external_id` is kept even if
a later acknowledgement omits it. On a `SUCCESS` your `external_id` is also
written back to the order's `erp_offer_id`, so it shows up everywhere Mercura
reads that field; a `FAILED` acknowledgement records it on the
acknowledgement only, since `erp_offer_id` means "this was exported"
throughout Mercura. The response body is the recorded acknowledgement only —
`{ status, external_id, message, metadata, acknowledged_at }`, the same
shape as the order's `acknowledgement` field — a small deterministic
confirmation of what Mercura persisted (including the sticky `external_id`)
without refetching the whole order.
The acknowledgement **does** move the order's workflow `status`, since it is
the outcome of its export: `SUCCESS` → `EXPORTED`, `FAILED` →
`EXPORT_FAILED` (which puts the order in front of a Mercura user for rework).
It never re-triggers an export.

