Skip to main content

Create Supplier (v1)

Method & Path

POST /api/v1/workspace/:workspaceId/suppliers

Actual backend path: POST /v1/workspace/:workspaceId/suppliers

Description

Create a new supplier for the workspace (اسم التام / full name).

Authentication

Required: Workspace JWT.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <workspace_token>
Content-TypeYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Request Body

{
"fullName": "اسم التام للمورد"
}
FieldTypeRequiredDescription
fullNamestringYesFull name of the supplier (trimmed, min 1 character)

Response 201 Created

{
"supplier": {
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"fullName": "اسم التام للمورد",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z"
}
}

Common Errors

  • 400 Bad Request: Validation error (e.g. empty fullName)
  • 401 Unauthorized: Missing or invalid token
  • 403 Forbidden: Workspace access denied
  • 404 Not Found: Workspace not found
  • 500 Internal Server Error: Server error