Versions Compared

Key

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

...

The Update Points Balance endpoint is used to add or remove loyalty points from a customer’s account. This endpoint can be leveraged by Gamification partners such as Brame to be able assign loyalty points to a customer that has successfully played a game. For more information on Brame, please refer to: Gamification Offer and Points Assignment via Brame /wiki/spaces/HELP/pages/4932174018.

Request format

Endpoint

POST /loyalty/user/{loyaltyUserId}/points

...

  • Assigning 100 points to the useruser’s balance:

Code Block
{
    "id": "45601bf3-6d2a-4318-8842-affc38f563ba",
    "shortId": "EZMHC05S5AYMO2G9",
    "loyaltyId": "6d13456a-1304-5109-a117-af4de20b2487",
    "channel": "CAMPAIGN",
    "status": "CLAIMED",
    "createdAt": "2024-02-28T02:14:05.453Z",
    "impactedExpirationBuckets": [
        {
            "expirationDate": "2024-06-28",
            "points": 100
        }
    ],
    "claimedAt": "2024-02-28T02:14:05.453Z",
    "pointsEarned": 100,
    "bonusPointsEarned": 0,
    "pointsUsed": 0,
    "transactionDetails": {
        "fulfillment": {
            "autoRelease": true,
            "type": "POINT_ASSIGNMENT"
        },
        "orders": [],
        "payments": []
    },
    "metadata": {
        "partner": "Partner",
        "reference": "Gamification Campaign Prize #3"
    },
    "pointsDeducted": 0
}

...

  • Deducting 100 points from the useruser’s balance:

Code Block
{
    "id": "1ae098e0-dc41-42cc-a4ea-b75b44148381",
    "shortId": "GM2CKQ2QRUAPP90K",
    "loyaltyId": "6d13456a-1304-5109-a117-af4de20b2487",
    "channel": "CAMPAIGN",
    "status": "CLAIMED",
    "createdAt": "2024-02-28T02:15:27.784Z",
    "impactedExpirationBuckets": [
        {
            "expirationDate": "2024-06-28",
            "points": -100
        }
    ],
    "claimedAt": "2024-02-28T02:15:27.784Z",
    "pointsEarned": 0,
    "bonusPointsEarned": 0,
    "pointsUsed": 0,
    "transactionDetails": {
        "fulfillment": {
            "autoRelease": true,
            "type": "POINT_ASSIGNMENT"
        },
        "orders": [],
        "payments": []
    },
    "metadata": {
        "partner": "Partner",
        "reference": "Reason why points were deducted"
    },
    "pointsDeducted": 100
} 

Error responses

Info

All error responses use the standard https://rbictg.atlassian.net/wiki/spaces/RDP/pages/4231725617/LLoyalty+API+v1+-+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:

    • "TransactionInsufficientPoints": the user want to redeem more points than the user has.

  • HTTP 401 (Unauthorized) if authentication headers are missing or not valid.

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

    • "UserNotFoundError": the Loyalty user (specifically the loyalty id) was not found.