주요 콘텐츠로 건너뛰기

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 paid
  • declined: the SKU doesn't match an active virtual currency, so the reward was dropped
  • invalid_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

ResourceChange
create_orderAdded the optional eligible_rewards request property, a list of OrderRewardCreate objects with virtual_currency_sku and amount
create_orderAdded eligible_rewards to the 201 response, a list of OrderRewardResult objects that adds a status to each requested reward
ComponentsAdded 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_rewards and check the status of each entry in the response. The order is still created when a reward is declined or has an invalid_amount, so a typo in a SKU fails quietly unless you look.

도움이 필요하세요?
통합팀에 문의하십시오 [email protected]