Consume

The Reward Consume endpoint allows you to set the state of vouchers to pending, verify, notified, redeemed, or expired. See the table below to understand the various states.

The Reward Consume endpoint will enable integrations whereby rewards are redeemed through a different mechanism i.e. not via the built-in peer-to-peer confirmation. This can be in the form of issuing coupons, digital codes, digital tickets, airtime credits, etc.

Reward Voucher States

Consuming Vouchers

In order to consume vouchers, you will need to retrieve the voucher guid. This can either be done via the reward list endpoint, or automatically via reward webhooks. The consume endpoint allows you to set the voucher state for a single or multiple users.

Parameters

curl -X POST \
  v1/rewards/consume \
  -H 'Authorization: Basic <Your Base64 Encoded Token>' \
  -d '{
	"guids" : ["3bf56525-d5ad-4f39-88b3-0cdcd0bfc7dc",...etc],
	"state" : "redeemed"
}'

Success Response

The response will contain how many vouchers changed their state. Vouchers will only change their state if the current state does not match the new state.

{
    "status": "success",
    "data": {
        "changed": 5
    },
    "hash": "dfdfac8d5493733dfab6d24c599785ba",
    "response_time": 0.11311697959899902
}

Last updated