Skip to main content

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

HeaderTypeDescription
Content-TypestringMust be application/json.
accessTokenstringAccess token for authentication. (required)

Request Body

The request body should include the details of the product group to create. Example structure is provided below:

FieldTypeDescription
namestringThe name of the product group.
statusbooleanThe 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

FieldTypeDescription
successbooleanIndicates the success status of the request, typically true for a successful operation.
messagestringA message conveying the outcome of the operation, e.g., "ProductGroup created Successfully".
datastringThe unique identifier of the created product group. defined in See Product group Data

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
500Internal 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.