Retrieve Product Details
GET /api/v1/products/{productId}
Description
Retrieves detailed information about a specific product, including its name, description, pricing, quantity available, and other relevant details. This endpoint is crucial for managing inventory, providing customer support, and conducting sales analysis.
URL Parameters:
productId(required): The unique identifier of the product whose details are to be retrieved. This must be included in the URL path.
Headers:
tenantId(required): The tenant ID under which the product is registered. This header identifies the specific tenant environment and should be included.userId(required): The user ID of the individual querying the product details. This header is used for authentication and authorization.
Example Request:
curl -G "http://[base_url]/api/v1/products/{productId}" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "userId: USR456"
Responses:
- 200 OK: Successfully retrieved the details of the product. The response includes comprehensive information such as the product's name, description, quantity, cost price, selling price, and other specifics.
Example Response:
{
"productId": "12345",
"name": "High-Quality Organic Wheat",
"description": "Organic wheat harvested from eco-friendly farms.",
"quantity": 150,
"costPrice": 2.00,
"sellingPrice": 3.50,
"currencyCode": "USD",
"photos": ["http://example.com/photo1.jpg"],
"businessId": "BIZ789",
"userId": "USR456",
"tenantId": "TEN123",
"countryCode": "US",
"productTypeId": "789",
"productTypeDetail": {
"category": "Grains",
"labels": ["Organic", "Non-GMO"]
}
}
Error Responses:
- 400 Bad Request: Incorrect parameters provided.
- 404 Not Found: No product found with the provided
productId. - 403 Forbidden: The user does not have permission to view the product details.
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/products/{productId} \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!