Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Contents

Purpose

This endpoint is used when a client device (typically a POS or Kiosk terminal) would like to change the status of a loyalty order. This endpoint will only change the status to CLAIMED (in the case an order is completed successfully) or VOID (in the case the order needs to be cancelled).

When an order status is changed to CLAIMED both points burned and earned are permanently updated in the guest’s account. When an order status is changed to VOID both points earned and burned of that order will be reversed back to the guest. A loyalty order must exist for this endpoint to be called; therefore, it must be used after Identify (POST) has been called.

Request Format

Endpoint

PUT /loyalty/v2/changestatus

Headers

Bearer token in JWT format as specified in /wiki/spaces/IN/pages/3739288100.

Body

  • newStatus <string>: the status that this order must change to, either CLAIMED or VOID

  • transactionId <UUID>: unique identifier of the transaction.

Example request

{
    "newStatus": "CLAIMED",
    "transactionId": "f4190848-169d-4c69-9f53-f916318c432b"
}

Response Format

Success response body

  • balances: object that indicates loyalty balance of the user's account

    • amount <number>: this represents the number of loyalty points the user has. If this QR code was pre-selected with rewards, then this number already has those loyalty points temporarily deducted from total user’s loyalty points balance.

    • currency <string>: this represents the currency the above amount. Normally set to "points".

  • order: an array that includes objects with the below fields for each product that is in the order basket.

    • productId <string>: PLU of the product that was pre-selected in the app. This can be an offer or a reward.

    • quantity <number>: the amount of the above product that is in the loyalty order.

    • price <number>: the price of the product

    • productType <string>: the type of product. In this case it would either be REWARD or OFFER

    • referenceId <string>: unique line ID of the product

Success response example

{
    "balances": [
        {
            "amount": 14464,
            "currency": "points"
        }
    ],
    "order": [
        {
            "productId": "2244",
            "quantity": 1,
            "price": 0,
            "productType": "REWARD",
            "referenceId": "01", 
        },
        {
            "productId": "6688",
            "quantity": 1,
            "price": 500,
            "productType": "OFFER",
            "referenceId": "02", 
        },
    ]
}

Error responses

  • HTTP 400 (Bad Request) if the either identifier or transactionId are not included with the request body, or if these parameters have an incorrect format.

  • HTTP 401 (Unauthorized) if the bearer token is missing or not valid.

  • HTTP 404 (Not Found): in the following scenarios indicated in the code field of the error response:

    • "CodeNotFound": the specified identifier has not been found;

    • "TransactionNotFound": the specified transaction has not been found.

  • HTTP 403 (Forbidden): if the specified identifier was generated for a different transactionId.

  • No labels