Retrieve Product Types
GET /api/v1/product-types
Description
Retrieves a comprehensive list of all product types registered in the system. This endpoint is used to obtain detailed information about each product type, including their names, categories, and any specific attributes associated with them, which can be essential for managing product cataloging and classification.
Example Request:
curl -G "http://[base_url]/api/v1/product-types" \
-H "Authorization: Bearer [access_token]"
Responses:
- 200 OK: Successfully retrieved the list of product types. The response includes detailed information about each product type, such as name, category, and any specific details or attributes.
Example Response:
{
"productTypes": [
{
"productTypeId": "1",
"name": "Agric Commodities",
"category": "Agriculture",
"supportedFields": [
{
"label": "Quality",
"value": "High",
"required": true,
"valueType": "string",
"formType": "input",
"formOptions": [
{
"label": "Standard",
"value": "ISO 22000"
}
]
}
]
},
{
"productTypeId": "2",
"name": "Textiles",
"category": "Manufacturing",
"supportedFields": [
{
"label": "Material",
"value": "Cotton",
"required": false,
"valueType": "string",
"formType": "dropdown",
"formOptions": [
{
"label": "Polyester",
"value": "Polyester"
},
{
"label": "Wool",
"value": "Wool"
}
]
}
]
}
]
}
Error Responses:
- 400 Bad Request: Incorrect request format.
- 404 Not Found: No product types found in the system.
- 403 Forbidden: The user does not have permission to view the list of product types.
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/product-types \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!