Idempotent Requests

The Domec API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a charge fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single charge is created.

To perform an idempotent request, provide an additional IdempotencyKey element to the request parameters.

How you create unique keys is completely up to you. We suggest using random strings or UUIDs. We’ll always send back the same response for requests made with the same key. However, you cannot use the same key with different request parameters.

An IdempotencyKey can be added to the UserData section of the Transaction Receipt by adding a __CLIENT_TX_ID__ parameter on it.

Have a look to the following example for further details.

    "IssuerData": {
        "Name":"Company Name",
        "Address":"Street Address",
        {"Code": "XYZ", "Name": "Dummy product", "Price": 25.50, "Quantity": 1.0}
        {"Method":0,"CardCode":"XXXXXXX", "Amount":25.50}
    "SenderData": {
        "Type": 1,
        "Number": 61,
        "CashDrawer": 61,
    "UserData": "{ __CLIENT_TX_ID__ : \"IdempotencyKey" }"