Skip to main content

API Idempotency

The EasyPay Online Payment API supports Idempotency Keys to prevent duplicate processing on the server side, ensuring safety even if the client sends the same request multiple times due to network issues or retries.

Clients must include the Idempotency Key in the shopTransactionId (Merchant Transaction ID) field when making a request.

The Idempotency Key must be a unique value per request (e.g., UUID or random string). If a request is retried with the same key, the server will return a duplicate request error.

Generate a unique key for each API request and include it in the shopTransactionId field as shown below. The key sent in the request will be returned exactly as is in the response.

Request/Response Body Example
{
"shopTransactionId": "{Idempotency Key}",
}
About Idempotency Keys
  • Client Responsibility: Clients are responsible for generating and managing Idempotency Keys, ensuring they are unique for each request.
  • Validity Period: The key remains valid until midnight on the day of the request. Reusing the same key within this period will result in a duplicate error.
  • Different Keys: Be aware that if the keys are different, the server treats them as distinct requests even if the request body content is identical.

Generating API Idempotency Keys

LanguageRecommended Function
JavaUUID.randomUUID
Pythonuuid (Python 2, Python 3)
PHPuniqid
C#Guid.NewGuid
RubySecureRandom.uuid
Node.jsuuid