Skip to main content

Get Store (v1)

Method + Path

GET /v1/workspace/:workspaceId/storefront/store

Actual backend path: /v1/workspace/:workspaceId/storefront/store

Description

Get the storefront store configuration for a workspace.

Authentication

Required - JWT token in Authorization header

Required Permissions:

  • storefront.view or storefront.update

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Response (200)

The response includes the full store object. Relevant fields for inventory:

FieldTypeDescription
inventoryUnitsarrayList of inventory units (e.g. لتر, غرام, كيلو, وحدة). Each item: { id: string, name: string, sortOrder: number }. Defaults to four units if not set.
{
"store": {
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"name": "My Store",
"slug": "my-store",
"description": "Store description",
"inventoryUnits": [
{ "id": "liter", "name": "لتر", "sortOrder": 0 },
{ "id": "gram", "name": "غرام", "sortOrder": 1 },
{ "id": "kilo", "name": "كيلو", "sortOrder": 2 },
{ "id": "piece", "name": "وحدة", "sortOrder": 3 }
],
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
}

Common Errors

  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Store or workspace not found
  • 500 Internal Server Error: Server error