Skip to main content

FetchRewardInfo

Reveals a scratch card. This is where Cheggout assigns the reward — picking from the campaign pool, applying the targeting context stored at creation — and returns the full reward detail.

Available
POST /api/FetchRewardInfo
EnvironmentURL
Productionhttps://rewardscenter.cheggout.com/api/FetchRewardInfo
UAThttps://rewardscenter-uat.cheggout.com/api/FetchRewardInfo

AuthenticationAuthorization: Bearer <token> from GetAuthToken

Reveal exactly once

Revealing is one-shot. Calling this again with the same rewardId returns REWARD NOT FOUND, not the reward. Persist the response the moment you receive it. To re-display a reward later, read it from your own store or from GetAllScratchCardsByUserId.

Request

This endpoint uses the BDATA wrapper without a SIGN field.

FieldTypeRequiredDescription
CHANNELIDstringYesYour channel identifier
BDATAstringYesBase64 of the payload below
BDATA here is encoding, not signing

There is no signature on this request — authentication is the bearer token. Base64 is a transport convention, not a security boundary. Do not assume the presence of BDATA implies a signed request. See API conventions.

BDATA payload

FieldTypeRequiredDescription
rewardIdstringYesThe card to reveal, from GetReward
virtualIdstringYesThe user revealing it
channelNamestringYesYour channel name
entryPointstringNoWhere the reveal happened in your UI
rewardId is a string here

GetReward returns rewardId as a number; this endpoint takes it as a string. Convert explicitly rather than relying on your JSON library.

Payload before encoding
{
"rewardId": "45144",
"virtualId": "pub_8f14e45fceea167a",
"channelName": "YOURCHANNEL"
}

Example

curl -X POST https://rewardscenter-uat.cheggout.com/api/FetchRewardInfo \
-H "Authorization: Bearer REPLACE_WITH_USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"CHANNELID": "YOURCHANNEL",
"BDATA": "REPLACE_WITH_BASE64_PAYLOAD"
}'

Response

{
"CHANNELID": "CHEGGOUT",
"BDATA": "REPLACE_WITH_BASE64_PAYLOAD"
}

Base64-decode BDATA to get either a reward or a business failure.

Reward payload

Beta This schema is documented here for the first time and is pending final confirmation from Cheggout engineering. Field presence — particularly the optional fields below — should be treated defensively: read what you need, tolerate absences.

There are two variants, distinguished by couponType.

Shared fields

FieldTypeDescription
rewardIdnumberThe revealed card
transactionIdstringYour original extTransactionId
offerTitlestringHeadline shown to the user
descriptionstringOffer description
termsstringTerms and conditions, HTML list markup
couponCodestringThe code to redeem. Empty for points rewards.
endDatestringValidity end, YYYY-MM-DD HH:mm:ss.SSS
couponTypestring"Brand" for a coupon reward, "points" for a points reward
isSeenbooleantrue — the card has now been revealed
couponImagestringCoupon artwork URL
redeemStepsstringHow to redeem, HTML list markup
bannerDisplayUrlstringBanner artwork URL
iconImagestringIcon URL
detailsstringAdditional detail, HTML list markup
siteNamestringMerchant name
pointsnumberPoints awarded. 0 for coupon rewards.
coverImagestringCover artwork URL
createdDateTimestringWhen the card was created
rewardImagestringReward artwork URL
bgColorstringSuggested background colour for your card UI
copyClickarrayFire when the user copies the coupon code
redeemClickarrayFire when the user taps redeem

Coupon reward — additional fields

FieldTypeDescription
siteIdnumberMerchant identifier
offerIdnumberOffer identifier
promoLinkstringDestination for the redeem action

Points reward

couponType is "points", couponCode is empty, and points carries the awarded value. The merchant-specific fields above are not applicable.

Coupon reward (synthetic)
{
"rewardId": 45144,
"transactionId": "PUB_TXN_20260731_000117",
"offerTitle": "Flat 20% off your next order",
"description": "Valid on orders above the minimum spend.",
"terms": "<ul><li>One use per customer.</li><li>Not valid with other offers.</li></ul>",
"couponCode": "REPLACE-COUPON-CODE",
"endDate": "2026-12-31 23:59:59.000",
"couponType": "Brand",
"isSeen": true,
"couponImage": "https://assets.example.com/coupon.png",
"redeemSteps": "<ul><li>Tap redeem.</li><li>Apply the code at checkout.</li></ul>",
"bannerDisplayUrl": "https://assets.example.com/banner.png",
"iconImage": "https://assets.example.com/icon.png",
"details": "<ul><li>Applies to the full catalogue.</li></ul>",
"siteId": 1217,
"offerId": 517,
"siteName": "Example Merchant",
"points": 0,
"coverImage": "https://assets.example.com/cover.png",
"promoLink": "https://click.cheggout.com/REPLACE",
"createdDateTime": "2026-07-31 14:15:31.000",
"rewardImage": "https://assets.example.com/reward.png",
"bgColor": "#db551c",
"copyClick": ["https://tracking.cheggout.com/Tracker/clicks?REPLACE"],
"redeemClick": ["https://tracking.cheggout.com/Tracker/clicks?REPLACE"]
}
Points reward (synthetic)
{
"rewardId": 45145,
"transactionId": "PUB_TXN_20260731_000118",
"offerTitle": "You won 100 points",
"couponType": "points",
"couponCode": "",
"points": 100,
"isSeen": true,
"endDate": "2026-12-31 23:59:59.000",
"createdDateTime": "2026-07-31 14:20:02.000",
"bgColor": "#db551c"
}
Handle both variants

Branch on couponType. A points reward has no coupon code and no merchant link, so a UI that assumes a code will render an empty card.

Business failures

A failure decodes to:

{ "status": false, "message": "REWARD NOT FOUND" }
messageMeaningHow to handle
BETTER LUCK NEXT TIMENo reward allocated — campaign inactive, frequency cap reached, empty pool, probability miss, or budget exhaustedA normal outcome. Show your "no luck this time" state.
REWARD NOT FOUNDNo card matches this rewardId for this user — including a card already revealedLook it up in reward history
SCRATCHCARDID NOT FOUNDrewardId missing or not a valid numberFix the request
CHEGCUSTOMERID NOT FOUNDUser could not be resolvedCheck the token matches the user
VIRTUALID NOT FOUNDvirtualId missing from the payloadFix the request
BANKNAME NOT FOUNDchannelName missing from the payloadFix the request
BETTER LUCK NEXT TIME is a success

The platform answered correctly: this card had no reward behind it. Do not retry, do not refresh the token, do not raise an alert. Design the "no luck" state into your UI from day one — with frequency caps in play, it will be common.

Reveal flow

Implementation notes

  • Persist before you render. If your app crashes between receiving and storing the reward, the reward is not recoverable through this endpoint.
  • Do not blind-retry a timeout. The reveal may have succeeded server-side. Call GetAllScratchCardsByUserId to find out what actually happened before deciding.
  • Fire tracking: copyClick when the user copies the code, redeemClick when they tap redeem.
  • Render HTML fields safely. terms, redeemSteps and details contain list markup — sanitise before injecting into a web view.

Next