externalReference: a string you choose, unique within your organization. It does two jobs:
- Idempotency. Retrying with the same
externalReferencenever creates a second resource. You get the original back with status200instead of201, and its state reflects whatever has happened since. - Lookup.
GET /v1/payouts/by-reference/{externalReference}(and the same for orders and collections) finds the resource by your id — so you can reconcile even if you never stored ours.
Rules
- Uniqueness is per organization and permanent — an
externalReferencecan’t be reused for a different payment later. Derive it from something in your system that’s already unique: an invoice number, an order id, a ledger entry id. - The replay is keyed on the reference alone. Sending a different body with the same reference returns the original, not an error — so don’t reuse references across distinct intents.
- Use it for lookups in webhook handlers too:
data.externalReferenceis on every payout, collection, and order event.
Request ids
Separately, every response carries anx-request-id header (also in error bodies as requestId). It identifies the HTTP request, not the payment. Log it; quote it to support.