Skip to main content

Read time 1 minutes

Introduction

This document defines the required technical interface for claiming a redemption code for an offer provided in a Rest API web service transferring data in JSON format.

What are redemption codes

Redemption codes are a unique string, usually alpha-numeric, which are used to track and validate entitlement at the point of redeeming an offer. This may be printed on a voucher and presented at a physical venue or used online for digital offers.

External Claim API​

Environments​

The production environment (prd) has features to manage test and live data and can be used during website build. If you require a development environemnt away from production please request this with the TLC Account Management team.

envurlUsage
uathttps://uat.api.cosmosplatform.ioAvailable on request
prdhttps://api.cosmosplatform.ioTest and Live versions of Cosmos campaigns

Endpoint​

POST /api/claims/external

Request Headers​

Content-Type: application/json
Authorization: Bearer {apiKey}

Body Params​

{
"offerId": long // mandatory, to be taken from listings API, OfferModel, field=id
"consumerId": guid // mandatory
}

Possible Responses​

Headers​

Content-Type: application/json

200 OK - code available and issued​

{
"redemptionCode": "ABCDF"
}

200 OK - code not available for current offer/website​

{
"redemptionCode": null
}

400 Bad Request - validations error on any of the body parameters​

{
"errors": [
{
"field": "OfferId",
"message": "OfferId field is required"
},
{
"field": "OfferId",
"message": "Offer not available for this website"
},
{
"field": "ConsumerId",
"message": "Consumer already redeemed this offer"
}
{
"field": "ConsumerId",
"message": "Consumer already redeemed an offer from this partner"
}
...
]
}

note: error messages will likely be different in the built version

401 Unauthorized - invalid api key or no api key provided​