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

# Idempotency

> Idempotent invoice creation behavior.

## Invoice creation idempotency

`POST /v1/invoices` is idempotent on `(store_id, external_order_id)`:

* If an invoice already exists for the same store and external order ID, the **existing invoice is returned** with HTTP 201
* No duplicate invoice is created

## Conflict case

If the same `external_order_id` exists but belongs to a **different WooCommerce integration**, HTTP 409 is returned:

```json theme={null}
{
  "code": "EXTERNAL_ORDER_INTEGRATION_CONFLICT",
  "error": "External order ID belongs to another WooCommerce integration on this store"
}
```

## Webhook idempotency

Webhook events use an `eventKey` of `{invoiceId}:{eventType}:{status}`. Duplicate events for the same key are not re-created.

<Tip>
  Always handle duplicate webhook deliveries using `X-Stablecoin-Event-Id` as an idempotency key.
</Tip>

## Related pages

* [Idempotent processing](/webhooks/idempotent-processing)
