Skip to main content
POST
/
v2
/
loyalties
/
programs
/
{programId}
/
earning-rules
/
batch
Batch assign/unassign earning rules
curl --request POST \
  --url {protocol}://{host}/v2/loyalties/programs/{programId}/earning-rules/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '
{
  "assign": [
    {
      "id": "<string>"
    }
  ],
  "unassign": [
    {
      "id": "<string>"
    }
  ]
}
'
{
  "assigned": [
    {
      "earning_rule_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "object": "<string>"
    }
  ],
  "unassigned": [
    {
      "earning_rule_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "object": "<string>"
    }
  ]
}
{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}
{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}
{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}
{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}
{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

X-App-Id
string
header
required
X-App-Token
string
header
required

Path Parameters

id
string
required

Unique program identifier.

Pattern: ^lprg_[a-f0-9]+$

Body

application/json

Batch of earning rule assignment operations. unassign operations are processed before assign operations. Duplicate ids within a batch are rejected.

assign
object[] | null

Earning rules to assign.

Maximum array length: 10
unassign
object[] | null

Earning rules to unassign.

Maximum array length: 10

Response

Batch processing result.

Result of an earning rule assignment batch. Keys are null when the corresponding operation list was not provided.

assigned
object[] | null

Assignments created by the batch, or null when no assign operations were requested.

unassigned
object[] | null

Assignments removed by the batch, or null when no unassign operations were requested.

Last modified on July 10, 2026