Create Store (v1)
Method + Path
POST /v1/workspace/:workspaceId/storefront/store
Actual backend path: /v1/workspace/:workspaceId/storefront/store
Description
Create a new storefront store for a workspace.
Authentication
Required - JWT token in Authorization header
Required Permissions:
storefront.create
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": "My Store",
"slug": "my-store",
"description": "Store description"
}
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Store name (1-120 characters) |
slug | string | Yes | URL-friendly slug (1-120 characters) |
description | string | No | Store description (maximum 2000 characters) |
Response (201)
{
"store": {
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"name": "My Store",
"slug": "my-store",
"description": "Store description",
"createdAt": "2024-01-15T10:00:00Z"
}
}
Common Errors
- 400 Bad Request: Invalid request body
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
storefront.create) - 404 Not Found: Workspace not found
- 409 Conflict: Store already exists or slug already taken
- 422 Unprocessable Entity: Validation errors
- 500 Internal Server Error: Server error