Skip to main content

getCatalogueInventory

Returns remaining coupon stock per offer. Short-lived and cacheable for 180 seconds — call it before you show a buy action so you can mark an offer "limited stock" or disable it.

Available
GET /api/getCatalogueInventory
EnvironmentURL
Productionhttps://hotdeals.cheggout.com/api/getCatalogueInventory
UAThttps://onerupee-store-api-stage.azurewebsites.net/api/getCatalogueInventory

AuthenticationAPI key

Request

Headers

HeaderRequiredValue
Content-TypeYesapplication/json
X-CHANNELIDYesYour channel identifier
AuthorizationYesCheggoutAppKey <APP_KEY>:<SEC_KEY>

No request parameters are documented — the endpoint returns inventory for the catalogue.

curl -X GET https://hotdeals.cheggout.com/api/getCatalogueInventory \
-H "Content-Type: application/json" \
-H "X-CHANNELID: YOURCHANNEL" \
-H "Authorization: CheggoutAppKey REPLACE_APP_KEY:REPLACE_SEC_KEY"

Response

FieldTypeDescription
statusnumber200 on success
ttlSecondsnumberHow long this response stays valid — 180
dataarrayInventory entries
messagestringHuman-readable status text. The exact literal is not documented — do not match on it.

data[]

FieldTypeDescription
offerIdstringMatches id from getCatalogue
couponsLeftnumberRemaining coupons. 0 means sold out.
Response (synthetic)
{
"status": 200,
"ttlSeconds": 180,
"data": [
{ "offerId": "517", "couponsLeft": 124 },
{ "offerId": "518", "couponsLeft": 0 },
{ "offerId": "530", "couponsLeft": 7 }
],
"message": "REPLACE_STATUS_MESSAGE"
}
Respect ttlSeconds

Cache the response for the returned TTL rather than hardcoding 180. If the value changes, your integration follows it automatically.

How to use it

A reasonable presentation policy:

couponsLeftShow
0"Sold out" — disable the buy action
Low, by your own threshold"Limited stock" — keep the action enabled
OtherwiseNormal
Inventory is a hint, not a reservation

A non-zero couponsLeft does not reserve anything. Stock can be exhausted between your check and your fetchCouponCode call, which will then return 409 COUPON_EXHAUSTED. Handle that at delivery time — and if you have already burned the user's coins, refund them.

Errors

statuserrorCodeCause
400INVALID_REQUESTMalformed request
401UNAUTHORIZEDMissing or wrong Authorization header
500INTERNAL_ERRORPlatform-side failure

Status codes arrive in the body — see API conventions.

Notes

TBD The relationship between catalogue and inventory scope is not fully specified. Inventory may include offer identifiers that are not present in your catalogue response. Treat getCatalogue as the authority on what to show, and use inventory only to answer how much is left for offers you already display — join on offerId and ignore entries you do not recognise.

Next