DocsAPI Reference
Log In
Docs

Idempotency Key

An idempotency key is a unique value generated by the client which the Meld BE uses to recognize subsequent retries of the same request. Using Idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a charge does not respond due to a network error, you can retry the request with the same idempotency key to ensure that no more than one charge is created.

To send an idempotent request, provide an additional idempotency_key element to the request header.
You can generate a random UUID v4 Idempotency key at uuidgenerator.net

Below is a sample request using Idempotency-Key:

curl --location --request POST '{api_base_url}/payments/transactions' \
--header 'Authorization: BASIC {{Your API Key}}' \
--header 'X-Idempotency-Key: {{Idempotency Key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": "10",
    "currencyCode": "USD",
    "nonce": "meld-fake-valid-nonce",
    "vault": false,
    "serviceProvider": "AUTHORIZENET"
}'