To prevent duplicate resource creation and depending on your use case, you can include in your POST request (such as one that creates an invoice) a unique value in the X-Chift-Client-RequestId header.

This ensures that each POST request is processed exactly once by our API. Uniquely identifying POST requests that create new resources is particularly crucial when the response outcome is uncertain due to temporary service disruptions, such as server timeouts or network failures.

In such cases, the client application can safely retry the request without the risk of duplicate operations.
API endpoints that guarantee a request is processed only once, regardless of how many times it is retried with the same unique identifier, are referred to as idempotent.

How to use it?

Include in your request to Chift, the following header:

x-chift-client-requestid: 123456

123456 is a unique identifier that is managed at your side

What can you expect?

You can expect a 409 error code in case you request was processed (REQUEST_ALREADY_PROCESSED) or currently in processing (REQUEST_IN_PROCESS):

E.g.

{
    "status": "error",
    "message": "Request already processed: 200",
    "detail": "Request with same client request id {client_request_id} was already successfully processed",
    "error_code": "REQUEST_ALREADY_PROCESSED"
}
{
    "status": "error",
    "message": "Request is in processing",
    "detail": "Request with same client request id {client_request_id} is currently processed",
    "error_code": "REQUEST_IN_PROCESS"
}