Create POS Order Status (v1)
Method & Path
POST /v1/workspace/:workspaceId/pos/order-statuses
Actual backend path: /v1/workspace/:workspaceId/pos/order-statuses
Description
Create a new workspace-defined order status for POS invoices (e.g. "قيد التحضير", "جاهز"). Names must be unique within the workspace.
Authentication
Required: JWT in Authorization header.
Required permissions: store.orders.manage
Persona: Workspace Owner, Staff (store.orders.manage)
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token: Bearer <token> |
Content-Type | string | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
Request Body
{
"name": "preparing",
"labelAr": "قيد التحضير",
"order": 0
}
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Internal name (e.g. slug, used for API) |
labelAr | string | No | Arabic display label |
order | number | No | Sort order for display (default 0) |
Response 201 Created
{
"id": "507f1f77bcf86cd799439099",
"workspaceId": "507f1f77bcf86cd799439010",
"name": "preparing",
"labelAr": "قيد التحضير",
"order": 0,
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z"
}
Common Errors
- 400 Bad Request: Invalid or missing
name - 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Workspace not found
- 409 Conflict: An order status with this name already exists in the workspace
- 500 Internal Server Error: Server error