Skip to content
FFastPay Docs

Idempotency

A network can fail after your request arrived but before you saw the answer. Idempotency lets you send it again without doing the work twice.

Checkouts: use a reference#

When you start a checkout, send your own reference for the order. Repeating the request with the same reference, amount, currency and email returns the original checkout with 200 instead of creating a second one. The same reference with different details is refused with 409.

Creating records: use an Idempotency-Key#

Requests that create a customer, a payment link, an invoice or a virtual account take an Idempotency-Key header, and refuse the request without one. Use any unique value of at least 8 characters, such as a UUID.

  • Send the same key with the same request, and you get the original response back instead of a second record.
  • Send the same key with a different request, and you get 409 with the code idempotency_key_reused.
  • Keys are remembered for 24 hours.
  • Test and live are separate: the same key in each mode is two different requests.
  • A key belongs to one business. Another business in your organisation that sends the same key gets 409 with the code idempotency_key_reused, never the first business's response.