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
orderLive

OrderLive of the order

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",    "orderLive": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "createdAt": {},      "updatedAt": {},      "locationId": "1a5515a3-ba81-4a42-aee7-ad9ffc090a54",      "roomName": "string",      "tableName": "string",      "tillId": "19818646-df1d-4c99-b178-4fe04bb8d522",      "bookingId": "9a471128-954e-4e64-bde9-e8147015df89",      "revisionHash": "string",      "total": -9007199254740991,      "totalTax": -9007199254740991,      "totalDiscount": -9007199254740991,      "totalWithoutTax": -9007199254740991,      "leftToPay": -9007199254740991,      "data": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "tillId": "19818646-df1d-4c99-b178-4fe04bb8d522",        "roomId": "c3631f02-ff67-42b8-8775-18c47f52a678",        "revisionHash": "2942a7c8-bcb1-484c-832a-7c5ee7186169",        "deviceIdentifier": "string",        "openedAt": {},        "modifiedAt": {},        "closedAt": {},        "paidAt": {},        "canceledAt": {},        "transferredAt": {},        "firstBillPrintDate": {},        "postPaymentPrintDate": {},        "total": -9007199254740991,        "totalTax": -9007199254740991,        "totalDiscount": -9007199254740991,        "totalWithoutTax": -9007199254740991,        "leftToPay": -9007199254740991,        "guestsCount": 0,        "billPrintCount": 0,        "proofsOfPaymentCount": 0,        "postPaymentPrintCount": 0,        "roomType": "room",        "roomPricing": "custom",        "roomName": "string",        "tableId": "073fbfcb-cd05-4203-be18-a1ce6f8e4d2d",        "tableName": "string",        "tablePosX": -9007199254740991,        "tablePosY": -9007199254740991,        "tableShape": "string",        "beeperNumber": -9007199254740991,        "deviceName": "string",        "comment": "string",        "preparationActivated": true,        "isMerged": true,        "manuallyClosed": true,        "isPaid": true,        "isCanceled": true,        "canceledReason": "string",        "fiscalNumber": -9007199254740991,        "signature": "string",        "operatorId": "373c4133-3dda-4217-938b-a5730b9cc41a",        "operatorName": "string",        "firebaseCustomerName": "string",        "firebaseCustomerRefKey": "string",        "firebaseReservationRefKey": "string",        "isPrepaid": true,        "isTransferred": true,        "transferredTo": "string",        "externalServiceId": "string",        "extOctorateReservationId": -9007199254740991,        "extQoodosCheckInId": "1b12bc29-552f-4d46-9828-266b1455d502",        "extQoodosUserId": "e4c75c72-b2c4-494e-9a8f-3c0b17a1ffc3",        "extQoodosUserName": "string",        "pickupHour": "string",        "groupedTableInfo": [          {            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",            "catalogTableId": "ddfbdf7a-09d4-4844-814d-259974e39011"          }        ],        "externalOrderId": "string",        "externalLocationId": "string",        "paymentRowList": [          {            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",            "recordedAt": {},            "modifiedAt": {},            "amount": -9007199254740991,            "changeAmount": -9007199254740991,            "changePaymentName": "string",            "changePaymentMode": "string",            "lastProofOfPaymentAmount": -9007199254740991,            "totalProofOfPaymentAmount": -9007199254740991,            "status": "validated",            "name": "string",            "paymentType": "payment",            "paymentMode": "cash",            "paymentId": "472e651e-5a1e-424d-8098-23858bf03ad7",            "changePaymentId": "string",            "tipAmount": -9007199254740991,            "externalServiceId": "string",            "firebaseCustomerRefKey": "string",            "currencyCode": "string",            "sellerCardReceipt": "string",            "buyerCardReceipt": "string",            "operatorId": "string",            "operatorName": "string"          }        ],        "productRowList": [          {            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",            "parentProductRowId": "string",            "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",            "categoryId": "337f5e5d-288b-40d5-be14-901cc3acacc0",            "taxId": "ec2f3321-4009-45bd-9423-63aa80044823",            "priceId": "b245ceea-4bc7-4619-ae4c-559a1faf418e",            "operatorId": "373c4133-3dda-4217-938b-a5730b9cc41a",            "pricingId": "95485fa7-dfd0-412f-94ab-8c5aefc2bf79",            "deviceIdentifier": "string",            "recordedAt": {},            "modifiedAt": {},            "reclaimedAt": {},            "transmittedAt": {},            "orderedAt": {},            "taxName": "string",            "taxRate": -9007199254740991,            "taxAmount": -9007199254740991,            "taxableAmount": -9007199254740991,            "subCategoryId": "982c876c-aa7c-4e4f-ae18-aeb8518f3413",            "subCategoryName": "string",            "categoryName": "string",            "categoryCatalogColor": "colorGreen",            "unitPriceRow": -9007199254740991,            "unitPriceRowWithModifier": -9007199254740991,            "totalRowWithModifier": -9007199254740991,            "totalDiscount": -9007199254740991,            "totalRow": -9007199254740991,            "quantity": -9007199254740991,            "weight": 0,            "pricingName": "string",            "pricingType": "custom",            "deviceName": "string",            "operatorName": "string",            "name": "string",            "canceledReason": "string",            "isTransferred": true,            "transferredTo": "string",            "comment": "string",            "isMerged": true,            "isCustomPrice": true,            "validated": true,            "isCanceled": true,            "currencyCode": "string",            "menuStepName": "string",            "menuStepIndex": -9007199254740991,            "isLoss": true,            "lossReason": "string",            "modifierRowList": [              {                "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",                "recordedAt": {},                "modifiedAt": {},                "amount": -9007199254740991,                "name": "string",                "modifierIndex": -9007199254740991,                "modifierGroupName": "string",                "modifierGroupIndex": -9007199254740991,                "modifierId": "string",                "modifierGroupId": "2894e026-80d4-4a6a-8281-e3c706256766"              }            ],            "discountRowList": [              {                "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",                "recordedAt": {},                "modifiedAt": {},                "amount": -9007199254740991,                "status": "validated",                "splitAllowed": true,                "name": "string",                "discountId": "string",                "discountGroupId": "40a5b925-67b0-4b11-87cf-5fa4fa62e21b"              }            ]          }        ],        "menuRowList": [          {            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",            "recordedAt": {},            "modifiedAt": {},            "unitPriceRow": -9007199254740991,            "currencyCode": "string",            "amountToAdd": -9007199254740991,            "amountToSubtract": -9007199254740991,            "pricingId": "95485fa7-dfd0-412f-94ab-8c5aefc2bf79",            "menuId": "23cd2b3a-61d0-42e8-956a-ddbb0a604d97",            "pricingName": "string",            "pricingType": "custom",            "name": "string",            "parentMenuRowId": "ba323538-6fa7-487b-917c-bffbe891b4f1",            "totalRow": -9007199254740991,            "productRowList": [              {                "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",                "parentProductRowId": "string",                "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113",                "categoryId": "337f5e5d-288b-40d5-be14-901cc3acacc0",                "taxId": "ec2f3321-4009-45bd-9423-63aa80044823",                "priceId": "b245ceea-4bc7-4619-ae4c-559a1faf418e",                "operatorId": "373c4133-3dda-4217-938b-a5730b9cc41a",                "pricingId": "95485fa7-dfd0-412f-94ab-8c5aefc2bf79",                "deviceIdentifier": "string",                "recordedAt": {},                "modifiedAt": {},                "reclaimedAt": {},                "transmittedAt": {},                "orderedAt": {},                "taxName": "string",                "taxRate": -9007199254740991,                "taxAmount": -9007199254740991,                "taxableAmount": -9007199254740991,                "subCategoryId": "982c876c-aa7c-4e4f-ae18-aeb8518f3413",                "subCategoryName": "string",                "categoryName": "string",                "categoryCatalogColor": "colorGreen",                "unitPriceRow": -9007199254740991,                "unitPriceRowWithModifier": -9007199254740991,                "totalRowWithModifier": -9007199254740991,                "totalDiscount": -9007199254740991,                "totalRow": -9007199254740991,                "quantity": -9007199254740991,                "weight": 0,                "pricingName": "string",                "pricingType": "custom",                "deviceName": "string",                "operatorName": "string",                "name": "string",                "canceledReason": "string",                "isTransferred": true,                "transferredTo": "string",                "comment": "string",                "isMerged": true,                "isCustomPrice": true,                "validated": true,                "isCanceled": true,                "currencyCode": "string",                "menuStepName": "string",                "menuStepIndex": -9007199254740991,                "isLoss": true,                "lossReason": "string",                "modifierRowList": [                  {                    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",                    "recordedAt": {},                    "modifiedAt": {},                    "amount": -9007199254740991,                    "name": "string",                    "modifierIndex": -9007199254740991,                    "modifierGroupName": "string",                    "modifierGroupIndex": -9007199254740991,                    "modifierId": "string",                    "modifierGroupId": "2894e026-80d4-4a6a-8281-e3c706256766"                  }                ],                "discountRowList": [                  {                    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",                    "recordedAt": {},                    "modifiedAt": {},                    "amount": -9007199254740991,                    "status": "validated",                    "splitAllowed": true,                    "name": "string",                    "discountId": "string",                    "discountGroupId": "40a5b925-67b0-4b11-87cf-5fa4fa62e21b"                  }                ]              }            ]          }        ]      }    },    "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."
}