Skip to content

Game key shop

A recipe for a shop that sells game keys and Steam top-ups. The goal of the program is the second and later purchases.

Type When to send Key fields
order.paid a key order was paid order_id, amount, currency, items
topup.paid a Steam top-up was paid order_id, amount, currency
order.refunded the order was refunded order_id
order.chargeback a chargeback on the order order_id
order.chargeback_reversed the chargeback was reversed in the shop’s favour order_id
{
"event_id": "evt_90114",
"type": "order.paid",
"user_ref": "4f9a",
"order_id": "ord_78123",
"occurred_at": "2026-11-03T18:02:11Z",
"amount": 25.00,
"currency": "AZN",
"items": [{ "sku": "game-123", "category": "rpg", "price": 25.00, "qty": 1 }]
}
  • Each event has its own event_id, while a payment and its refund share an order_id: that is how the refund finds the purchase.
  • amount is the amount paid after discounts.
  • A refund is always full: it excludes the whole purchase, and its amount is ignored.
  • Top-ups are a separate type: they follow different rules, give status badges and don’t lead to a discount.
Scenario Steps Reward
Collector 3 key purchases of 10 AZN or more in any 60 days after 14 days, 10% off keys, up to 5 AZN
Gamer, with levels bronze: first key, silver: 5 keys, gold: 15 a level badge
Steam regular top-ups in 4 different weeks a badge only

The 14-day delay in “Collector” covers the refund window: if the key is refunded, the reward is cancelled before it becomes available. The whole path of this scenario with requests and responses is in the end-to-end example.

  1. On the reward.available webhook, fetch the terms with GET /v1/rewards/{reward_id}: percent, max_amount, min_order, applies_to, expires_at.
  2. Create a personal coupon in your system, one per reward_id, tied to the buyer and valid until expires_at.
  3. At checkout, reserve the reward (reserve); after payment, redeem it (redeem) with the amounts. Details are in the Checkout guide.
  4. On reward.expired and reward.cancelled, disable the coupon.
  • order.paid, topup.paid and refunds are sent from the server, signed and with order_id
  • webhooks are received, the signature is verified, duplicates are dropped
  • the coupon is created once per reward_id and disabled on reward.expired and reward.cancelled
  • reserve at checkout, redeem after payment, and the order without the discount if Zirva fails
  • with group: control the program isn’t shown to the buyer
  • an export of order history is handed to us for a one-time import