Skip to main content
POST
/
partner
/
campaigns
/
issue
curl https://api.thanxsandbox.com/partner/campaigns/issue \
  -X POST \
  -H 'X-ClientId: {client_id}' \
  -H 'Accept-Version: v4.0' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'X-Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000' \
  -d '{
    "campaign_id": "camp_abc123",
    "merchant_id": "k2lye10h32l5wzo",
    "variant_id": "var_treat1",
    "identifiers": [
      {
        "type": "email",
        "value": "jane.smith@example.com"
      },
      {
        "type": "phone",
        "value": "+14155551234"
      }
    ]
  }'
{
  "issuance_job": {
    "id": "job_xyz789",
    "campaign_id": "camp_abc123",
    "variant_id": "var_treat1",
    "state": "pending",
    "total_count": 2,
    "processed_count": 0,
    "success_count": 0,
    "failure_count": 0,
    "progress_percent": 0,
    "created_at": "2025-06-15T10:30:00Z",
    "started_at": null,
    "completed_at": null
  }
}
Scope required: rewards.issue
This endpoint initiates an asynchronous reward issuance job. Rewards are issued to the specified users for a given campaign variant. The endpoint returns immediately with a 202 Accepted response containing the issuance job details. Use the Get Issuance Job endpoint to poll for completion status.

Best Practices for Event-Driven Workflows

While there is nothing preventing you from issuing rewards one user at a time, we strongly recommend batching identifiers into a single request whenever possible. Sending individual requests per user is significantly less efficient and may result in rate limiting under the global rate limits. Collect identifiers and submit them in batches of up to 10,000 per request for optimal throughput.

Idempotency

This endpoint supports idempotent requests via the X-Idempotency-Key header. When provided, duplicate requests with the same key return the cached response from the original request. If the request body differs from the original, a 422 Unprocessable Entity error is returned.

Parameters

campaign_id
string
required
Campaign ID
merchant_id
string
required
Merchant ID
variant_id
string
required
Variant ID. Must belong to the specified campaign.
identifiers
array
required
Array of user identifiers to issue rewards to (max 10,000)
X-Idempotency-Key
string
Optional idempotency key to prevent duplicate issuance jobs.

Response

Returns 202 Accepted with the issuance job object.
id
string
Issuance job ID
campaign_id
string
Campaign ID
variant_id
string
Variant ID
state
string
Job state: pending, processing, completed, or failed
total_count
integer
Total number of identifiers submitted
processed_count
integer
Number of identifiers processed so far
success_count
integer
Number of rewards successfully issued
failure_count
integer
Number of failed issuances
progress_percent
integer
Completion percentage (0-100)
created_at
datetime
Job creation timestamp (ISO8601)
started_at
datetime
Processing start timestamp (ISO8601), null if not started
completed_at
datetime
Processing completion timestamp (ISO8601), null if not completed
curl https://api.thanxsandbox.com/partner/campaigns/issue \
  -X POST \
  -H 'X-ClientId: {client_id}' \
  -H 'Accept-Version: v4.0' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'X-Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000' \
  -d '{
    "campaign_id": "camp_abc123",
    "merchant_id": "k2lye10h32l5wzo",
    "variant_id": "var_treat1",
    "identifiers": [
      {
        "type": "email",
        "value": "jane.smith@example.com"
      },
      {
        "type": "phone",
        "value": "+14155551234"
      }
    ]
  }'
{
  "issuance_job": {
    "id": "job_xyz789",
    "campaign_id": "camp_abc123",
    "variant_id": "var_treat1",
    "state": "pending",
    "total_count": 2,
    "processed_count": 0,
    "success_count": 0,
    "failure_count": 0,
    "progress_percent": 0,
    "created_at": "2025-06-15T10:30:00Z",
    "started_at": null,
    "completed_at": null
  }
}