Idempotency
Safe retries for Gate writes that accept Idempotency-Key.
Send a UUID in Idempotency-Key on the operations that declare the header in the OpenAPI contract:
POST /gate_sessionsPOST /rails/pay_insPOST /rails/pay_outs
curl -X POST https://gate-api-sandbox.0bit.app/gate_sessions \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"amount":"100.00","currency":"BRL","return_url":"https://partner.example/done"}'
Reuse the same key only when retrying the same logical request with the same body. A successful retry resolves to the original result. Reusing a key with a different fingerprint is rejected.
Store the key beside your own order or request record before making the network call. Keep it stable across timeouts, connection resets, and process restarts. Generate a new key for a new user action.
Do not invent idempotency support for operations that do not declare the header. Reads are naturally repeatable; dashboard management writes and POST /webhooks/test follow their documented state and rate-limit rules.
