Create Product Group
The POST endpoint creates a new product group with specified details.
Endpoint
- URL:
/productGroup/create - Method:
POST
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Request Headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | Must be application/json. |
accessToken | string | Access token for authentication. (required) |
Request Body
The request body should include the details of the product group to create. Example structure is provided below:
| Field | Type | Description |
|---|---|---|
name | string | The name of the product group. |
status | boolean | The status of the product group. |
Sample Request Body
{
"name": "Product group name",
"status": true // optional
}
Response
- Status Code: 200 OK
Sample Response Body
{
"success": true,
"message": "ProductGroup created Successfully",
"data": {
"id": "product id"
}
}
Success Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the success status of the request, typically true for a successful operation. |
message | string | A message conveying the outcome of the operation, e.g., "ProductGroup created Successfully". |
data | string | The unique identifier of the created product group. defined in See Product group Data |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Invalid input data. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 500 | Internal Server Error: An error occurred on the server. |
Notes
- Make sure to provide a valid access token in the request header for authentication.
- Ensure your request body is formatted according to the specified structure.