Idempotent Requests

To prevent duplicate post transactions, we support idempotent requests. By providing a unique idempotency key in the header of your POST requests, the server can prevent duplicate requests from being processed.

This is especially useful in cases where there is network/connection failure before you receive a response from the server.

'Embed-Idempotency-Key':'19051a62-3403-11e6-ac61-9e71128cae77'
Add the Embed-Idempotency-Key as part of POST request headers.

If a duplicate request is received for a transaction that has previously been processed (same payload and same idempotency key), we do not re-process the duplicate request, rather we return to you the last successful response for the request.

We recommend using a unique string like UUID as your idempotency key.

Sample Idempotent Requests

curl https://sandbox.embed.cowrywise.com/api/v1/investments
  -H 'Embed-Idempotency-Key':'19051a62-3403-11e6-ac61-9e71128cae77'
  -d '{
      "account_id": "6a8f9d8aef16477f866b20161e003e48",
      "asset_code": "AST-TBILL-1502504249"
  }'
  -X POST 
Passing an idempotent key as part of a request to create investment.
client.transfers.initiate_transfer(
  idempotency_key="19051a62-3403-11e6-ac61-9e71128cae77",
   source_wallet_id='ec45bb798f244c75b9432ec19256316b', 
   destination_product_code='PRCDE1297453250',
   amount=50000, 
   currency_code='NGN'
  })
Passing an idempotent key as part of a request to create investment using the Embed python client library.