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. - A retry must match the original. Sending a different body (amount, currency, recipient or payer) with the same reference returns
409 duplicate, with the original’s id indetails.existingId. Nothing new is created. - 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.