Contents
Purpose
This endpoint is used to cancel a loyalty order and refund the guest’s loyalty points at a client device (typically a POS or Kiosk terminal).
Request format
Endpoint
PUT /loyalty/transaction/pos/{loyaltyTransactionId}/void
Headers
As documented here: Loyalty API - Getting Started.
Body
loyaltyId
<string>: Loyalty ID in UUID format.transactionId
<string>: Loyalty order ID in UUID format.channel
<string>: “Restaurant” for In-Restaurant orders.created
<string>: string that represents the current date and time of the requestcreated
<string>: service mode of the order being placed. This can be “EAT_IN”, “TAKEOUT”, ”DRIVE_THRU”.status
<string>: status of the order that indicates if the order is still pending or if it has been completed. This can be “PENDING” for orders not yet completed and “CLAIMED” for orders that were completed.transactionDetails
: object identifying order information from the request (POS or Kiosk):currency
<string>: the currency used in the market.order
: array identifying all products inside the order. each product is an object with these fields:name
<string>: name of the product.price
<number>: price of the product.productId
<string>: PLU of the product.productType
<string>: type of the product. This can be “combo”, “item”, “reward” or “offer”.quantity
<number>: number of times this product was ordered.referenceId
<string>: line ID of producttax
<number>: tax amount attributed to this product.parentReferenceId
<number> (optional): line id of parent product. Only relevant for children products (e.g. a coke drink that was ordered as part of a whopper medium meal combo).
payments
: array with an object identifying payment information of the order:amount
<number>: total cost of the order in cents.type
<string>: type of payment method that was used during payment for order. This can be “CASH”, “CREDIT”, “VISA”, “MASTERCARD”.
posVendor
: object identifying system making the request (POS or Kiosk):transactionId
<string>: the POS transaction identifier.storeId
<integer>: uniquely identifies the store where the guest is identifying from.terminal
<string> (optional): identifies the POS or Kiosk terminal used in the restaurantoperator
<string> (optional): identifies the POS operator (only applicable for orders made on a POS terminal)posType
<string>: identified the type of POS or Kiosk system making the request. This value must have been previously agreed between the vendor and RBI, so that the correct integration configuration is applied. In most cases, this will be set to a value of “Partner”.supportingPos
<string> (optional): in case the posType is “Partner”, this field should be used to identify the POS/Kiosk brand for analytical purposes.
Example request
{ "loyaltyId": "{{loyaltyUserId}}", "transactionId": "{{loyaltyTransactionId}}", "channel": "Restaurant", "created": "2021-05-04T13:39:47Z", "serviceMode": "Eatin", "status": "CLAIMED", "transactionDetails": { "currency": "USD", "order": [ { "name": "med whopper combo", "price": 5.00, "productId": "$plu", "productType": "combo", "quantity": 1, "referenceId": "1", // line id "tax": 0 }, { "name": "whopper", "parentReferenceId"?: "1", // line id of parent element (for children entries) "price": 0, "productId": "$plu", "productType": "item", "quantity": 1, "referenceId": "2", // line id "tax": 0 }, { "name": "med fries", "parentReferenceId"?: "1", // line id of parent element (for children entries) "price": 0, "productId": "$plu", "productType": "item", "quantity": 1, "referenceId": "3", // line id "tax": 0 } ], "payments": [ { "amount": 500, "type": "CASH", "ccToken": "optional PAN token" } ], "posVendor": { "operator": "300", // operator / cashier id "posType": "Kiosk vendor name", "supportingPos": "POS vendor name (optional field)", // vendor to return plu for "storeId": "9999", "terminal": "0", // terminal id "transactionId": "000000000257" // vendor transaction id }, } }
Response Format
Success response body
transactionId
<string>: unique UUID identifier of the loyalty transaction created.
Success response example
{ "transactionId": "$transactionId" // uuid of the loyalty order/transaction }
Error responses
All error responses use the standard Error Responses format.
HTTP
400 (Bad Request)
if the request body has an incorrect format. In this case, the response will include details about which specific field or fields have an incorrect format.HTTP
401 (Unauthorized)
if authentication headers are missing or not valid.HTTP
404 (Not Found)
: in the following scenarios indicated in thecode
field of the error response:"UserNotFoundError"
: the Loyalty user (specifically the loyalty id) was not found."TransactionNotFoundError"
: the transaction (specifically the transaction id) was not found."RewardNotFoundError"
: the reward was not found."OfferNotFoundError"
: the offer was not found.