Idempotence
All critical Bridge POST
APIs require idempotency to safely allow you to make identical requests multiple times in the event of network failures or timeouts. In order to make a request idempotent, you must pass in an Idempotency-Key
header with a unique value identifying that request.
Read, update and delete (i.e. GET
, PUT
, PATCH
and DELETE
) requests must not have an Idempotency-Key
included as they are naturally idempotent.
For 24 hours following the initial request, as long as subsequent requests contain the same Idempotency-Key
value, we will guarantee that you can safely make the same request multiple times without any side effects. For example, if a request to create a Customer or a Transfer object fails, you can retry with the same idempotency key to ensure that no more than one object is created. After 24 hours, you will receive a 422 when attempting to make an identical request with a previously used idempotency key.
We recommend using a UUID generator in your language to create the idempotency key, store it in your database system, and then use it when calling out to Bridge.
Example
curl --location --request POST 'https://api.bridge.xyz/v1/customers' \
--header 'Content-Type: application/json' \
--header 'Api-Key: <Api-Key>' \
--header 'Idempotency-Key: <generate a uuid>' \
--data-raw '{
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"address": {
"street_line_1": "123 Washington St",
"street_line_2": "Apt 2F",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "USA"
},
"birth_date": "1989-09-09",
"tax_identification_number": "111-11-1111"
}'
Updated 4 months ago