Idempotency
Repeat a create call safely, without registering twice.
A network failure can leave you unsure whether the record was created. Send the Idempotency-Key header with a unique value for each record you want to create. When you repeat the call with the same value and the same body, you get the record already created, with no duplicate.
Idempotency-Key: erp-pedido-2026-1042| Operation | Idempotency-Key | Applies to |
|---|---|---|
POST /v1/service-requests | Required | The whole organization, whichever API key is used. |
POST /v1/customers | Optional | Each API key: the same value sent by another key registers another customer. |
What happens on a repeat
| Situation | Service request | Customer |
|---|---|---|
| First call | 201, request opened. | 201, customer registered. |
| Same value and same body | 200 with the request opened before. | 201 with the customer registered before. |
| Same value and different body | 409 IDEMPOTENCY_KEY_REUSED | 409 CUSTOMER_CREATION_IDEMPOTENCY_CONFLICT |
| Without the header | 422 VALIDATION_ERROR | Each call registers a customer. |
- The value has 16 to 128 characters. Use something that identifies the record in your system, such as the order number, or a UUID.
- Store the value with the record and send exactly the same one when you repeat the call.
The Idempotency-Key values in the samples, such as erp-pedido-2026-1042, are fixed. When you use a sample for real, replace it with the value of your record: running the same sample again with the same value returns the record already created and, with different data, answers 409.