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.
Events
Section titled “Events”| 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 anorder_id: that is how the refund finds the purchase. amountis the amount paid after discounts.- A refund is always full: it excludes the whole purchase, and its
amountis ignored. - Top-ups are a separate type: they follow different rules, give status badges and don’t lead to a discount.
Scenarios
Section titled “Scenarios”| 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.
Coupons
Section titled “Coupons”- On the
reward.availablewebhook, fetch the terms withGET /v1/rewards/{reward_id}:percent,max_amount,min_order,applies_to,expires_at. - Create a personal coupon in your system, one per
reward_id, tied to the buyer and valid untilexpires_at. - At checkout, reserve the reward (
reserve); after payment, redeem it (redeem) with the amounts. Details are in the Checkout guide. - On
reward.expiredandreward.cancelled, disable the coupon.
Onboarding checklist
Section titled “Onboarding checklist”-
order.paid,topup.paidand refunds are sent from the server, signed and withorder_id - webhooks are received, the signature is verified, duplicates are dropped
- the coupon is created once per
reward_idand disabled onreward.expiredandreward.cancelled -
reserveat checkout,redeemafter payment, and the order without the discount if Zirva fails - with
group: controlthe program isn’t shown to the buyer - an export of order history is handed to us for a one-time import