Skip to main content

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:
{
  "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.
Always handle duplicate webhook deliveries using X-Stablecoin-Event-Id as an idempotency key.