Idempotency Key
Generate unique keys to prevent accidental duplicate transactions and ensure predictable API behavior. Build robust and reliable financial applications with confidence.
Overview
To prevent an operation from being performed more than once, Dwolla supports passing in an Idempotency-Key
header with a unique key as the value. Multiple POST
s with the same idempotency key and request body won’t result in multiple resources being created. It is recommended to use a random value for the idempotency key, like a UUID (i.e. - Idempotency-Key: d2adcbab-4e4e-430b-9181-ac9346be723a
).
For example, if a request to initiate a transfer fails due to a network connection issue, you can reattempt the request with the same idempotency key to guarantee that only a single transfer is created.
If you reattempt a POST
request with the same value for the Idempotency-Key
, rather than creating new or potentially duplicate resources, you will receive a 201 Created
, with the original response of the created resource. If the Dwolla server is still processing the original POST
request, you will receive a 409 Conflict
error response on the subsequent request. Multiple POST
s with the same idempotency key including an exact match request body won’t result in multiple resources being created. Idempotency keys are intended to prevent conflicts over a short period of time, therefore keys which are paired with a request body expire after 24 hours.
To prevent resources from being created more than once, we highly recommend making all requests idempotent.