Double Purchase Protection


Double Purchase Protection helps prevent accidental duplicate charges when a user submits the same purchase request multiple times. This is commonly caused by retries, double-clicks, or parallel requests.

What it does

How it works

The system uses a combination of identifiers to determine duplicates:

  1. Unique identifiers
    We use clientTransactionId, phone, and content to detect duplicate transactions.

  2. Duplicate check logic
    A payment is flagged as a duplicate if either of the following combinations match a previous transaction:

  3. If clientTransactionId exists, match on clientTransactionId, phone, and content
  4. Else match on phone and content

How transactions are handled

For every transaction attempt, the system performs these checks:

  1. Check for unique clientTransactionId
    If a transaction comes with a unique clientTransactionId, it is treated as a new transaction.

  2. Combination check
    If the combination of phone and content, or clientTransactionId, phone, and content matches any previous transaction, the request is identified as a duplicate.

Error response (when blocked)

The API responds with a conflict status and Zlick error code:

{
  "statusCode": 409,
  "error": "DuplicatePaymentBlockedError",
  "message": "Transaction blocked due to duplicate transaction protection. Check your records for a recent, successful payment before retrying.",
  "zlickErrorCode": "ZLICK16",
  "info": {
    "existingTransactionId": "...",
    "existingTransactionState": "confirmed",
    "existingTransactionAmount": 499,
    "existingTransactionDate": "2026-01-26T12:34:56.789Z",
    "doublePurchaseProtectionEnabled": true
  }
}