The Prize Object
A Prize is the record you create when you want to award a prize (either an inventory item such as a concert ticket, or a cash prize) to a listener.
Prize Types
There are 3 types of Prize in Audata - Cash, Inventory, and List prizes. This is represented in the prize_type attribute of the Prize object.
- Cash - a prize with a cash value.
- Inventory - an inventory item (e.g. concert tickets, a gift card).
- List - instead of winning a prize, the listener is added to a List (usually used to put listeners into a draw for a bigger prize down the track.
| Value | Type | Description |
|---|---|---|
| uuid | string | Prize UUID. |
| prize_number | integer | Prize number. |
| prize_type | string | Prize type. |
| description | string | Prize description. |
| cash_amount | number | Cash amount. |
| inventory_qty | integer | Inventory quantity. |
| list_qty | integer | List quantity. |
| value | number | Prize value. |
| phone_number | string | Phone number. |
| confirmed_at | string | Confirmed timestamp. |
| fulfilled_at | string | Fulfilled timestamp. |
| collected_at | string | Collected timestamp. |
| status | object | Serialized PrizeStatus object via PrizeStatusBlueprint when present. |
| campaign | object | Serialized Campaign object via CampaignBlueprint when present. |
| listener | object | Serialized Listener object via ListenerBlueprint when present. |
| inventory_item | object | Serialized InventoryItem object via InventoryItemBlueprint when present. |
| list | object | Serialized List object via ListBlueprint when present. |
| station_uuid | string | Station UUID when station_id is present. |
| created_at | string | Record creation timestamp. |
| updated_at | string | Record update timestamp. |
Awarding Prizes
Awarding Prizes without a Listener ID
You can award prizes without a Listener record and Audata will trigger the configured notification rules for your instance. Typically, and by default, Audata will send an SMS message to the prize winner with their redemption link and collect their details. Once the Listener has provided their details, the Prize will move to its Confirmed status, and an associated Listener record will be created for the Prize.
The below cURL request shows an example of creating a Prize without a Listener ID...
curl --request POST \
--url https://promo.audata.io/api/v1/prizes \
--header 'authorization: Bearer YOUR_API_KEY' \
--header 'content-type: application/json' \
--data '{"prize":{"phone_number":"0412123456","prize_type":"cash","cash_amount":"50.00"}}'In the above example, we are awarding a cash prize of $50.00 (in local currency) to a specified phone number.
Awarding Prizes with a Listener ID
There are times you may not want to rely on the Audata Promo automation features, and instead provide the winner details yourself. For example, you may already have the winners information in some kind of local database, and you want to award them a prize using Audata. To do this, you simply create a Listener record, and then pass the listener_id parameter along with your Prize.
curl --request POST \
--url https://promo.audata.io/api/v1/prizes \
--header 'authorization: Bearer YOUR_API_KEY' \
--header 'content-type: application/json' \
--data '{"prize":{"listener_id":123,"prize_type":"inventory","inventory_item_id":12345,"inventory_qty":1}}'