# Confirm the shipment

Handle POST /shipment/{shipment_id}/confirm to confirm Shipping Assistant reservations after purchase. Includes response codes and failure behavior.

Implement this optional endpoint to confirm reservations after purchase. Kustom uses the
`shipment_id` you returned from
[`POST /shipment`](/checkout/shipping/shipping-assistant/reserve-shipment/). It doesn't call
the endpoint without that id, and a failed confirmation doesn't affect the purchase.

## Confirm the reservation

```http
POST /shipment/{shipment_id}/confirm
Authorization: Bearer <token>
```

Kustom sends this once, when the purchase completes. There's no body. Answer `200` or `201`;
anything you send back is ignored.

| You answer | What happens |
| --- | --- |
| `200` or `201` | Done |
| `404` | Accepted. This is the answer if you don't implement the endpoint |
| `401` | Kustom fetches a new token and tries once more |
| Anything else, or no answer | Logged at Kustom. The purchase is unaffected, and the call isn't retried |

If you don't implement this endpoint, answer `404`. Your reservations remain unconfirmed
until the merchant tells you which purchases completed. The merchant books against your
`shipment_id`, received as `tms_reference` on their order.

Kustom doesn't send it for a checkout that fell back to the merchant's own options, or for a
digital-only order.

The API reference also lists `GET /shipment/{shipment_id}`, to read a shipment back. Kustom
doesn't call it, so you don't need to build it.

## Related

- [Reserve and update the shipment](/checkout/shipping/shipping-assistant/reserve-shipment/) — where `shipment_id` comes from
- [Build a TMS integration](/checkout/shipping/shipping-assistant/) — the whole flow
- [`POST /shipment/{shipment_id}/confirm` in the API reference](/api/shipping-service-callback/)
