Code Batch Assign

Description

This service assign a code to the party in session from code batch name


Request

Restrictions

This service requires an authenticated user and can only be called after a successful login.

Endpoint

POST https://<server-url>/api/v4/mileage/{{activitycode}}/assignCode?touchpoint={{touchpoint}}&token={{token}}

Path Parameters

Parameter
Type
Description

activitycode

String

The unique code for the mileage activity (e.g., "activityMileagePoints").

Parameters

Parameter
Location
Description

touchpoint

Query / Header

The identifier for the touchpoint. Use Thalamus-Touchpoint for the header.

token

Query / Header

The authentication token for the API session. Use Thalamus-Token for the header.

Request Body

The request body contains the updated information for the consumer's profile, consumer data, and opt-in settings.

Field
Type
Description

codebatchName

String

code batch name

{
  "codebatchName": "code-batch-1"
}

Response

✅ Successful Response: 200 OK

A JSON object is returned containing an array of pointsToExpireElements. Each element represents a batch of points and its corresponding expiration date.

Field
Type
Description
used

boolean

state of the code assigned

codeValue

String

code

expireDate

Epoc

Expiration Date

assignedTo

Integer

Party id who has the code assigned

JSON

{
    "codeElement": {
        "used": false,
        "codeValue": "14779475",
        "expireDate": 1762228799000,
        "assignedTo": 1
    }
}

❌ Unsuccessful Response: 400

Returned if the specified codebatch_name does not exist.

JSON

{
    "errors": {
        "custom.error": "code not available",
        "execution.custom.error": "Error en ejecución: code not available"
    }
}

Last updated

Was this helpful?