API Idempotency

As part of MoneyHash commitment to ensuring a robust and reliable API, we offer an API Idempotency feature that enables you to make idempotent requests. This ensures that a request made to our API will have the same effect whether it is sent once or multiple times.

What is an Idempotent Request?

An idempotent HTTP request is one that can be made many times without causing any different effects than if it were made only once. This is beneficial in situations where you want to prevent duplicate processing of requests due to network issues, server errors, and so on.

How to perform Idempotent Request?

Simply add the X-Idempotency-Key header to your POST, PATCH, PUT, or DELETE HTTP requests.

The value of the X-Idempotency-Key header must be a unique identifier for the request. We accept only V4 UUID for generating this unique identifier.

📢

Please remember

The X-Api-Key header is mandatory for each request. The X-Idempotency-Key is used in combination with the X-Api-Key to uniquely identify the request.


Handling Duplicate Requests

If you attempt to resend a request with the same X-Idempotency-Key and X-Api-Key combination within 24 hours, MoneyHash will ensure that you receive an identical response to that of the original request. This design guarantees response consistency, even in cases where the initial request may have encountered failures.

Handling Invalid Idempotency Keys

If you send a request with an X-Idempotency-Key value that is not a valid UUID, our system will respond with a 400 Bad Request status code and provide a message indicating that the UUID is invalid:

{
  "status": {
    "code": 400,
    "message": "error",
    "errors": [
      {
        "X-Idempotency-Key": "Invalid UUID"
      }
    ]
  },
  "data": {},
  "count": 1,
  "next": null,
  "previous": null
}

Supported endpoints: