Skip to content

Trigger batch coupon generation (idempotent)

Requires ADMIN. Only draft/generating pools are eligible. Enqueues via INCENTIVE_COUPON_GENERATION queue.

projectId
required
string

Project (tenant) identifier. Row-level tenant isolation is enforced on every query.

id
required
string

Job already queued (idempotent hit).

Media typeapplication/json
object
jobId
string
status
string
message
string

Generation job enqueued.

Media typeapplication/json
object
jobId
string
status
string
Example
json
{
"status": "queued"
}

Missing/invalid path input (e.g. projectId) or invalid JSON body.

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Not authenticated (401 via requireAuthenticated) or insufficient project role (403).

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Resource not found (or cross-tenant — same 404).

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Pool status not eligible for generation (error=pool_not_eligible).

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Invalid pool (error=invalid_pool).

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}

Generation queue binding unavailable (error=queue_unavailable).

Media typeapplication/json
object
error
required

Human-readable error message.

string
message
string
Examplegenerated
json
{
"error": "example",
"message": "example"
}