Custom virtual currency rewards on orders
What's new
create_order accepts an optional eligible_rewards list
of up to 20 entries. Each entry names a virtual_currency_sku and an amount, and the player gets
those rewards once the order is paid.
The response echoes the list back with a status on each entry:
applied: the reward will be granted once the order is paiddeclined: the SKU doesn't match an active virtual currency, so the reward was droppedinvalid_amount: the amount isn't positive, so the reward was dropped
Impact
The list overrides the rewards Aghanim would otherwise calculate from your virtual currency settings. An empty list grants nothing, which lets you turn rewards off for a single order. Leaving the field out keeps the calculated rewards.
Changes
| Resource | Change |
|---|---|
| create_order | Added the optional eligible_rewards request property, a list of OrderRewardCreate objects with virtual_currency_sku and amount |
| create_order | Added eligible_rewards to the 201 response, a list of OrderRewardResult objects that adds a status to each requested reward |
| Components | Added the OrderRewardCreate, OrderRewardResult, and OrderRewardStatus schemas |
Upgrade
- No changes are needed if you rely on the rewards from your virtual currency settings.
- To set rewards per order, pass
eligible_rewardsand check thestatusof each entry in the response. The order is still created when a reward isdeclinedor has aninvalid_amount, so a typo in a SKU fails quietly unless you look.
Need help?
Contact our integration team at [email protected]