Requests that move money can be retried safely: Cashela never executes the same operation twice for the same identifier.
The rules
- Every operation carries your own unique identifier,
external_identifier. Store it before you call the API.
- You may also send an
Idempotency-Key header. Use a stable value per operation.
- Keys are scoped to your credentials and environment.
| You repeat the request with… | Result |
|---|
| The same identifier and the same body | The original result is returned. Nothing happens twice. |
| The same identifier and a different body | 409. Pay-In adds code: PARTNER_PAYIN_IDEMPOTENCY_CONFLICT; Pay-Out answers with a message only. |
By product
- Pay-In: without an
Idempotency-Key, the external_identifier is the key; a failed creation is replayed with the same answer. See Idempotency and safe retries.
- Pay-Out: the key is your
external_identifier (an Idempotency-Key header is stored and echoed back). Repeating the same quotation payload with the same external_identifier returns the existing quotation; repeating the same transaction payload returns the existing transaction. An expired quotation is not executed again. See the Pay-Out guide.
When to retry
| Situation | Retry? |
|---|
Timeout, connection error, 500, 503 | Yes, with the same identifier and the same body. |
422 validation error | No: fix the request. |
409 | No: read the code and the transaction. |
429 | Yes, after Retry-After seconds. |