Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

And the Bearer Authentication is utilized in our system, when calling the endpoints, the authorization attribute needs to be added in the headers, with the value as Bearer <token>, the <token> is shared offline.

In the request headers, please set x-region as "ES".

(blue star) For security purpose, all the calls to our graphQL endpoints should NOT be directly from the frontend, please integrate the calls into existing/new-created backend APIs.

...

Code Block
languagejson
{
  "createdAt": "string",
  "id": "string", // RBI Loyalty Id
  "name": "string",
  "updatedAt": "string",
  "clientUserId": "string",
  "dateOfBirth": "string",
  "email": "string", // user email
  "emailVerified": true,
  "expirationBuckets": [
    {
      "expirationDate": "string",
      "pointsToExpire": 0
    }
  ],
  "loyaltyTier": {
    "loyaltyTierExpiryDate": "string",
    "loyaltyTierKey": "Tier_1", // Loyalty Tier, can be Tier_1 and Tier_2
    "pointsEarnedInTimeConstraint": 0,
    "startAt": "string"
  },
  "metadata": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "offerRedemptionAvailability": {
    "availableAfter": "string",
    "transactionId": "string"
  },
  "phoneNumber": "string",
  "phoneVerified": true,
  "points": 0, // Loyalty points
  "pointsEarningDisabled": true,
  "pointsExpiryDateKey": "string"
"string"
}}

Fetch RBI Loyalty Transactions

Desc: This endpoint is used to fetch all the Loyalty Transactions of a RBI Loyalty user, includes the information like points earned, points used, create date.

URL: /transactions/search

Method: POST

Payload:

Code Block
languagejson
{
  "statuses": [ // keep using this
    "CLAIMED"
  ],
  "loyaltyId": "string", // RBI Loyalty id
  "excludedChannels": [ // keep using this
    "REMEDIATION"
  ]
}

Example response:

Code Block
languagejson
[
  {
    "metadata": {},
    "status": "CLAIMED",
    "createdAt": "2024-04-01T07:50:23.147Z", // crate datetime
    "transactionDetails": {}, // includes order details, can be empty
    "loyaltyId": "b1aa9100-0cfd-59b5-8adf-72527b9ccb4d",
    "pointsUsed": 200, // used points
    "channel": "RESTAURANT",
    "pointsEarned": 120, // earned points, pointsEarned+bonusPointsEarned is the total earned points
    "bonusPointsEarned": 0,
    "id": "c9ab9b26-53ef-472d-88a8-10e31c151c5a",
    "dateUpdated": "2024-04-01T07:52:03.400Z"
  },
  {
    "shortId": "6G0B5R7F53B2HSON",
    "metadata": {},
    "status": "CLAIMED",
    "createdAt": "2023-10-31T12:43:11.406Z",
    "transactionDetails": {},
    "loyaltyId": "b1aa9100-0cfd-59b5-8adf-72527b9ccb4d",
    "pointsUsed": 0,
    "channel": "WEB",
    "pointsEarned": 161,
    "bonusPointsEarned": 0,
    "claimedAt": "2023-10-31T12:43:11.406Z",
    "id": "204b532b-3132-4a5f-90ab-44bfa88c0ce9",
  },
  {
    "pointsEarned": 100,
    "shortId": "7ETX4ME2EC4N4VMM",
    "bonusPointsEarned": 0,
    "claimedAt": "2023-07-25T06:16:26.693Z",
    "status": "CLAIMED",
    "createdAt": "2023-07-25T06:16:26.693Z",
    "loyaltyId": "b1aa9100-0cfd-59b5-8adf-72527b9ccb4d",
    "pointsUsed": 0,
    "id": "2b17414e-7eb2-42d7-a352-d949fb68cc14",
    "channel": "INITIAL_POINT_BALANCE"
  }
]

[APP] Create RBI Loyalty Transaction - Airtouch

Note

We decided not to use this endpoint, for all the transaction related endpoints, please refer to [BK ES Migration] Loyalty API - V1 Current

Desc: This endpoint is used to submit a transaction to RBI Loyalty platform for both Web and Mobile App. The payload needs to include the information, like RBI user Id, RBI Loyalty Id, items information, store id

...

Code Block
languagejson
{
  "cartEntries": [],
  "channel": "APP", // WEB, APP
  "cognitoId": "{{testRbiUserId}}", // RBI user Id
  "currency": "EUR", // currency
  "email": "{{testUserEmail}}", // user email
  "fulfillment": {"type": "DELIVERY"}, // DELIVERY, DRIVE_THRU, EAT_IN, TAKEOUT, N/A
  "loyaltyId": "{{testLoyaltyId}}",
  "orderId": {
    "id": "test-transaction-id", // the same as posVendor-transactionId
    "type": "AIRTOUCH" // the same as posVendor-type
  },
  "payments": [{
    "amount": 100, // in cent unit
    "type": "VISA" // VISA, AMEX, CASH, OTHER
  }],
  "posVendor": {
    "transactionId": "test-transaction-id", // a unique id to indicate the order
    "type": "AIRTOUCH"
  },
  "promotions": [
    {
      "id": "{{testRewardLoyaltyId}}", // the RBI Loyalty engine id of a Reward
      "name": "test-reward-id", // get from Sanity
      "type": "REWARD"
    }
  ], // rewards can be added
  "serviceMode": "DELIVERY" // DELIVERY, DRIVE_THRU, EAT_IN, TAKEOUT, N/A
}

[WEB] Create RBI Loyalty Transaction - Homeria

Note

We decided not to use this endpoint, for all the transaction related endpoints, please refer to [BK ES Migration] Loyalty API - V1 Current

Desc: This endpoint is used to submit a transaction to RBI Loyalty platform for both Web and Mobile App. The payload needs to include the information, like RBI user Id, RBI Loyalty Id, items information, store id

...