curl https://api.thanxsandbox.com/rewards/grant \
-X POST \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${token}" \
-H "X-ClientId: ${client_id}"
{
"reward": {
"id": "222441e34626",
"olo_uid": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
"user_id": "werofsdf",
"merchant_id": "weroif",
"campaign_id": "85133c3c1258",
"state": "available",
"earn": {
"type": "intro"
},
"redeem": {
"type": "manual",
"text": "$10 off",
"detail": "Long description",
"window": 60,
"venue": "all"
},
"coupon_code": {
"code": null,
"type": null,
"display": null
},
"fine_print": "Can't be used for alcohol purchases",
"instructions": "Example staff instructions",
"available_at": "2019-12-25T19:00:00Z",
"activated_at": "2020-01-01T20:00:00Z",
"retire_at": null,
"used_at": null,
"images": {
"index": {
"small": "https://...png",
"large": "https://...png"
},
"detail": {
"small": "https://...png",
"large": "https://...png"
},
"advertising": {
"small": "https://...png",
"large": "https://...png"
}
},
"uses_dynamic_coupon_codes": false
}
}
Rewards
Grant Reward
This endpoint grants the user a reward associated with the campaign provided.
POST
/
rewards
/
grant
curl https://api.thanxsandbox.com/rewards/grant \
-X POST \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${token}" \
-H "X-ClientId: ${client_id}"
{
"reward": {
"id": "222441e34626",
"olo_uid": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
"user_id": "werofsdf",
"merchant_id": "weroif",
"campaign_id": "85133c3c1258",
"state": "available",
"earn": {
"type": "intro"
},
"redeem": {
"type": "manual",
"text": "$10 off",
"detail": "Long description",
"window": 60,
"venue": "all"
},
"coupon_code": {
"code": null,
"type": null,
"display": null
},
"fine_print": "Can't be used for alcohol purchases",
"instructions": "Example staff instructions",
"available_at": "2019-12-25T19:00:00Z",
"activated_at": "2020-01-01T20:00:00Z",
"retire_at": null,
"used_at": null,
"images": {
"index": {
"small": "https://...png",
"large": "https://...png"
},
"detail": {
"small": "https://...png",
"large": "https://...png"
},
"advertising": {
"small": "https://...png",
"large": "https://...png"
}
},
"uses_dynamic_coupon_codes": false
}
}
Please review proper request headers here.
This endpoint is only available in SANDBOX
Parameters
string
required
The campaign id to grant the reward for. Must be the campaign’s hashid (e.g.,
85133c3c1258), not the numeric program ID.string
required
The user to grant the reward for
Response
string
Reward ID
string
Developers that do not communicate directly with the Olo APIs can ignore this
field.The field is only present for merchants that have integrated with Olo. This
UID should be used instead of the Reward ID when attempting to apply a reward
to the basket when communicating directly with the Olo API.This UID can also be used to match records (via the
externalreference Olo
rewards API attribute) being returned by the Olo API to relevant reward or
points product records in the Thanx API.string
User ID
string
Merchant ID
string
Campaign ID
enum
Reward State (
available, active, used)string
Fine print for the reward
string
Staff instructions for the reward
string
Time the reward was given to the user in ISO8601-format
string
Time the reward was activated in ISO8601-format
string
Time the reward was marked as used in ISO8601-format
string
Time the reward will be automatically retired in ISO8601-format
string
This hash will be populated if the reward is 'active' or 'used' and the
merchant uses coupon codes.
Show coupon_code
Show coupon_code
string
The raw coupon code value that should be rendered based on the
coupon_code_type enumenum
The type of coupon code that should be used to render the
coupon_code
value (raw, qrcode, barcode39, barcode39extended, barcode93,
barcode128, barcode_upc_a, barcode_ean_8, barcode_ean_13,
barcode25interleaved)string
If set, should be displayed instead of the raw coupon code value
string
Details of how the reward was earned
Show earn
Show earn
string
Type of campaign the reward was earned through
string
Details of how the reward can be redeemed
Show redeem
Show redeem
enum
How the reward can be redeemed (
manual, automatic, experience, points)string
"Access pass" redemption URL. This will only be present for access pass
rewards
string
Description of the reward
string
Long description of the reward
string
Where the reward can be used: (
instore, online, all)integer
Number of minutes the reward is available for use after activation
hash
Each of these values is a URL of the reward image with the aspect ratio preserved. Each property (EG:
index.small) has a set width for all rewards, and the height varies based on the aspect ratio.For example, if you import an image with the dimensions 1000x1000 (aspect ratio of 1:1), then the image for index.small has the dimensions 563x563 because it matches the original aspect ratio.Show images
Show images
hash
hash
string
Location ID where the reward was activated at
boolean
Indicates whether this reward uses dynamically generated coupon codes. When
true, a unique coupon code will be generated from a coupon pool when the reward is activated. This field is relevant for rewards created from points products or campaigns with dynamic coupon pools.curl https://api.thanxsandbox.com/rewards/grant \
-X POST \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${token}" \
-H "X-ClientId: ${client_id}"
{
"reward": {
"id": "222441e34626",
"olo_uid": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
"user_id": "werofsdf",
"merchant_id": "weroif",
"campaign_id": "85133c3c1258",
"state": "available",
"earn": {
"type": "intro"
},
"redeem": {
"type": "manual",
"text": "$10 off",
"detail": "Long description",
"window": 60,
"venue": "all"
},
"coupon_code": {
"code": null,
"type": null,
"display": null
},
"fine_print": "Can't be used for alcohol purchases",
"instructions": "Example staff instructions",
"available_at": "2019-12-25T19:00:00Z",
"activated_at": "2020-01-01T20:00:00Z",
"retire_at": null,
"used_at": null,
"images": {
"index": {
"small": "https://...png",
"large": "https://...png"
},
"detail": {
"small": "https://...png",
"large": "https://...png"
},
"advertising": {
"small": "https://...png",
"large": "https://...png"
}
},
"uses_dynamic_coupon_codes": false
}
}