Loyalty API v1 - Assign Offer

Contents

Purpose

The Assign Offer endpoint is used to assign a personalized offer to a customer’s account. This endpoint can be leveraged by Gamification partners such as Brame to be able assign offer to a customer that has successfully played a game and it can be leveraged in Braze for CRM purposes to personalize the journey of targeted users. For more information on Brame setup, please refer to: . For more information on Braze offer assignment, please refer to: .

Request format

Endpoint

POST /bulk-action/hot/create-offer

Headers

As documented here: .

Body

  • userId <string>: unique identifier of the loyalty user in UUID format.

  • source <string>: the source of the request (e.g. “brame”).

  • reference <string>: the reference description from the source responsible for creating the request (e.g. “Campaign Prize #2”).

  • configId <string>: loyalty engine id of the config offer.

  • ruleParams object that contains date when offers becomes available and when it expires for the customer:

    • startDate <string>: the date that the offer will be available to the user (e.g. “2024-05-21”).

    • endDate <string>: the date that the offer will expire for the customer (e.g. “2024-05-22”).

Example Request

{ "userId": "6d13456a-1304-5109-a117-af4de20b2487", "source": "brame", "reference": "Campaign Prize #2", "configId": "1ac7eb33-1e04-40ea-b6f2-38af6bb4bf7a", "ruleParams": { "startDate": "yyyy-mm-dd", "endDate": "yyyy-mm-dd" } }

Response format

Success response body

  • traceId <string>: unique UUID identifier of the offer assignment process.

Success response example

{ "traceId": "730631be-c11b-48c0-8ec2-a3096dfd4d73" }

Error responses

All error responses use the standard 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 the code field of the error response:

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