Queue API
Queues provide first-come, first-served waiting room functionality. Consumers enter, wait in line, and are admitted in order.Get Queue
Retrieve queue details and current status.GET /api/v1/queues/:queueId
Authentication
- Publishable key required
- Consumer authentication not required
Path Parameters
| Parameter | Type | Description |
|---|---|---|
queueId | string | The queue ID |
Response
Example
Error Responses
| Status | Error | Description |
|---|---|---|
| 404 | Queue not found | The queue ID does not exist |
Enter Queue
Join a queue and receive initial position.POST /api/v1/queues/:queueId/enter
Authentication
- Publishable key required
- Consumer authentication required
Headers
| Header | Required | Description |
|---|---|---|
X-Fingerprint | Recommended | Device fingerprint for bot mitigation |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
queueId | string | The queue ID |
Response
Example
Error Responses
| Status | Error | Description |
|---|---|---|
| 400 | Consumer ID is required | Missing consumer authentication |
| 404 | Queue not found | The queue ID does not exist |
| 423 | Queue is not open yet | Queue opens in the future |
| 429 | Queue is full | Queue is at capacity |
Special Headers on Error
| Header | Value | Description |
|---|---|---|
Retry-After | ISO timestamp or seconds | When to retry (for 423/429) |
X-Fingerprint-Error | true | Fingerprint validation failed |
Denied Entry Response
If the consumer is denied entry (e.g., order limit exceeded):Leave Queue
Voluntarily leave a queue.POST /api/v1/queues/:queueId/leave
Authentication
- Publishable key required
- Consumer authentication required
Path Parameters
| Parameter | Type | Description |
|---|---|---|
queueId | string | The queue ID |
Response
Example
Error Responses
| Status | Error | Description |
|---|---|---|
| 400 | Consumer ID is required | Missing consumer authentication |
| 404 | Queue not found | The queue ID does not exist |
| 404 | Consumer not in queue | Consumer is not currently queued |
Get Queue Status
Get the current consumer’s position and status in the queue.GET /api/v1/queues/:queueId/status
Authentication
- Publishable key required
- Consumer authentication required
Path Parameters
| Parameter | Type | Description |
|---|---|---|
queueId | string | The queue ID |
Response
ReturnsQueueConsumerState with current position and status.
Example
Admit Consumer (Server-Side)
Manually admit a consumer. Requires secret key.POST /api/v1/queues/:queueId/admit
Authentication
- Secret key required
Path Parameters
| Parameter | Type | Description |
|---|---|---|
queueId | string | The queue ID |
Request Body
Example
Complete Admission (Server-Side)
Mark an admission as completed (consumer has finished checkout).POST /api/v1/queues/:queueId/complete
Authentication
- Secret key required
Path Parameters
| Parameter | Type | Description |
|---|---|---|
queueId | string | The queue ID |
Request Body
Example
Deny Consumer (Server-Side)
Deny a consumer from the queue.POST /api/v1/queues/:queueId/deny
Authentication
- Secret key required
Path Parameters
| Parameter | Type | Description |
|---|---|---|
queueId | string | The queue ID |
Request Body
Deny Reasons
| Reason | Description |
|---|---|
ORDER_LIMIT_EXCEEDED | Consumer has exceeded order limits |
FRAUD_DETECTED | Suspicious activity detected |
ADMIN_ACTION | Manual denial by administrator |
Example
Validate Admission Token (Server-Side)
Validate that an admission token is valid for a consumer.POST /api/v1/queues/:queueId/validate
Authentication
- Secret key required
Path Parameters
| Parameter | Type | Description |
|---|---|---|
queueId | string | The queue ID |
Request Body
Response
Returnstrue if valid, or an error object with details if invalid.
Example
Queue Consumer Statuses
| Status | Description |
|---|---|
QUEUED | Consumer is waiting in line |
ADMITTED | Consumer has been admitted and can proceed |
COMPLETED | Consumer has completed their checkout |
DENIED | Consumer was denied entry |
LEFT | Consumer voluntarily left the queue |