Guides
Safe retries
Use idempotency keys so a retried request never charges or pays twice.
Networks drop. If a request times out you can't tell whether it reached us, so you retry. Idempotency keys make that retry safe.
How to use them
Send an Idempotency-Key header with a fresh UUID on every POST. If you retry with the same key, we return the original result instead of doing the work again.
With an idempotency key
curl https://sandbox.cswitchcba.com/v1/transfers \
-H "Authorization: Bearer $CSWITCH_SECRET_KEY" \
-H "Idempotency-Key: 6f1c2e4a-9b7d-4c1e-8a2f-1d3e5b7c9a0b" \
-H "Content-Type: application/json" \
-d '{"amount": 25000000, "account_number": "0000000001", "bank_code": "058"}'CarefulUse a new key for each new operation. Reusing a key for a different transfer returns the first transfer's result.