Collectable Rewards
Collectable Rewards represent Physical Rewards that have been claimed but are yet to be collected. These Rewards are stored at your Shop and await pickup by the Contact who claimed them. This section of the API deals with managing and tracking these Rewards.
List Collectable Rewards
Retrieve a collection of Physical Rewards that still need to be picked up at the Shop by the Contact that has claimed them remotely.
GET
https://api.piggy.eu/api//collectable-rewardsHeaders
ParamsAuthorization
Bearer {{ access_token | api_key }}Accept
application/jsoncontact_uuidstringREQUIREDRetrieve an overview of all uncollected rewards for the Contact using their UUID.
Response Example
Show more
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"data": [
{
"contact": {
"uuid": "123",
"email": "spongebob@bikinibottom.sea",
"credit_balance": {
"balance": 250
}
},
"created_at": "2023-11-13T14:37:04+00:00",
"uuid": "abc012-def789-u4k3l2-890xyz",
"title": "Krabby Patty",
"reward": {
"id": 20002,
"uuid": "539483d0-fab4-40db-add5-2ec65ef12901",
"title": "Krabby Patty",
"description": "Kelp Juice or Sea Water",
"reward_type": "PHYSICAL",
"media": {
"type": "image",
"value": "http://images.google.com/image/coffee/300x200.jpg"
},
"required_credits": 2,
"pre_redeemable": true,
"expiration_duration": 6307200,
"is_active": true,
"cost_price": null,
"stock": null,
},
"expires_at": "2024-01-25T14:37:04+00:00",
"has_been_collected": false
}
],
"meta": {}
}Code
Message
1003Invalid input.
55031Contact not found.
Redeem Collectable Reward
To collect a Reward, the UUID of the Loyalty Transaction needs to be stated as query parameter inside the URI. It updates the existing Reward resource and sets the has_been_collectedproperty to true.
PUT
https://api.piggy.eu/api//collectable-rewards/collect/{{loyalty_transaction_uuid}}Headers
ParamsAuthorization
Bearer {{ access_token | api_key }}Accept
application/jsonloyalty_transaction_uuidstringREQUIREDUUID of the Loyalty Transaction that was generated when the Reward was claimed by the Contact.
Response Example
Show more
1
2
3
4
5
6
7
{
"data": {
"uuid": "13ac4cc1-3522-4dfc-ae4a-a821e5090108",
"status": "COLLECTED"
},
"meta": {}
}Code
Message
6003Reward not found.
80300Reward not found.
80300Reward is expired.
Reverse Collectable Reward Redemption
Reverses a previous Collectable Reward Redemption, in the event of an order return or some other cancellation.
POST
https://api.piggy.eu/api/v3/oauth/clients/collectable-rewards/{{collectable_reward_redemption_uuid}}/reverseHeaders
Authorization
Accept
Bearer {{ personal_access_token }}application/jsonInput parameters
uuidstringrequiredThe UUID of the Collectable Reward Redemption to be reversed
Response Example
Show more
1
2
3
4
5
6
7
{
"data": {
"uuid": "13ac4cc1-3522-4dfc-ae4a-a821e5090108",
"status": "REVERSED",
},
"meta": {}
}