Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.batchrelay.com/llms.txt

Use this file to discover all available pages before exploring further.

Idempotency lets you safely retry a failed or timed-out request without the risk of creating duplicate orders. Whenever you create an order, you should attach a stable, unique key to the request so that Batch Relay can recognize a replay and return the original response instead of processing the order a second time.

Sending the Header

Include the Idempotency-Key header on every create request. The value should be a string that uniquely identifies this particular order intent within your account:
POST /v1/orders HTTP/1.1
Idempotency-Key: order_2026_0001
Batch Relay stores the first order created for a given API account and idempotency key pair. Any subsequent request that arrives with the same key returns the original order record exactly as it was created — no new order is written, and no fulfillment is triggered a second time.

Choosing a Key

Your idempotency key should come from a stable identifier that already exists in your system before you make the API call. Good candidates include:
  • Order ID — the primary key from your own orders table
  • Workflow run ID — a unique run identifier from your automation platform
  • External job ID — an ID assigned by an upstream system or queue
  • n8n execution ID plus item ID — combining both values guarantees per-item uniqueness across parallel executions
Never reuse the same idempotency key for a different payload. If Batch Relay has already stored a successful response under a given key, any subsequent request that sends a different payload but the same key will receive the original response — your new payload will be silently ignored. Always generate a fresh key when the order content changes.