Logo PopinaPopina API

Redeem rewards

Based on the provided order details and selected rewards, this endpoint validates and redeems the rewards for a customer. It returns the discounts that should be applied to the order.

This step can be skipped for simple rewards like free products or straightforward percentage/amount discounts on the total order, which can be calculated locally by the POS/Kiosk.

[!WARNING] For Como loyalty service, this action will lock the rewards to avoid multiple redemptions. It must be used once per order.

This endpoint should be called before the payment process to add discounts to the Order.

POST/v1/benefits/redeem
authorization<token>

To get an API key, please contact us. We'll be happy to help you.

In: header

customerIdstring

Customer id

Formatuuid
orderIdstring

Order id

Formatuuid
rewards

Rewards to redeem for this order

Items1 <= items

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:4010/v1/benefits/redeem" \  -H "Content-Type: application/json" \  -d '{    "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",    "orderId": "b3e1eced-f2bd-4d8c-9765-fbc9d1d222d5",    "rewards": [      {        "rewardId": "string",        "couponCode": "string"      }    ]  }'
[
  {
    "id": "rew_3377badde0",
    "type": "AMOUNT",
    "name": "popina reward 1",
    "couponCode": null,
    "productSku": null,
    "value": 300
  },
  {
    "id": "rew_cb8ca87fe1",
    "type": "PERCENT",
    "name": "popina reward 2",
    "couponCode": null,
    "productSku": null,
    "value": 200
  },
  {
    "id": "rew_cb8ca87fe2",
    "type": "AMOUNT",
    "name": "popina reward 3",
    "couponCode": null,
    "productSku": "SKU-001",
    "value": 150
  }
]
{
  "code": "CUSTOMER_NOT_FOUND",
  "message": "No customers found."
}
{
  "code": "UNEXPECTED_ERROR",
  "message": "Internal server error."
}
{
  "code": "NOT_IMPLEMENTED",
  "message": "This method is not implemented."
}