Skip to main content

The reference field

The reference field is your idempotency key. It must be unique per logical transaction — winam-payments uses it to deduplicate requests. If you call POST /deposits or POST /withdrawals twice with the same reference, winam-payments returns the existing transaction without creating a duplicate.

When to use

Use case: Your backend calls POST /deposits and the network times out before you receive the response. You don’t know if winam-payments created the transaction. Retrying with the same reference is safe — you’ll get the existing transaction back.

Constraints

  • Max length: 128 characters
  • Must be unique per logical transaction — use a different reference for each distinct payment
  • Scope: scoped to the player_id + direction pair — the same reference can be reused for a deposit and a withdrawal
If you use the same reference for two different amounts or MSDINs, winam-payments returns the original transaction — not an error. Always generate a fresh reference for each new transaction.