Redeem a benefit

Marks a redemption code as used. It is final.

POST/v1/benefits/redeemCommerce API key

Redeems the benefit using the code the member holds. It is the last step of the flow: from here on the code is burned and cannot be used again.

There is no going back

Call this endpoint only once the sale is closed and the discount applied. If you call it earlier and the sale falls through, the member loses the reward and there is no way to give it back over the API.

To see which reward it is without burning it, use look up a code.

Body

client_benefit_codeintegerrequired

The redemption code the member holds.

Example

curl -X POST https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/benefits/redeem \
  -H "Authorization: Bearer $LOYBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "client_benefit_code": 887766
  }'
// 200 OK
{
  "message": "Benefit redeemed successfully"
}

Errors

CodeWhen
400The benefit was already used.
404The benefit does not exist.
422The field is missing, or it is not an integer.

The 400 is the case to cover in your UI

It is what happens when someone tries to use the same code twice. It is not a bug in your integration: it is worth showing whoever is at the counter a clear "this code was already used" message instead of a generic error.

On this page