Activate Product
PUT /api/v1/products/{productId}/active
Description
Activates a specific product in the system, making it available for sale or distribution. This endpoint is used to change the product's status from inactive to active, which is crucial for inventory management and sales operations.
URL Parameters:
productId(required): The unique identifier of the product to be activated. 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 responsible for activating the product. This header is used for authentication and authorization.
Example Request:
curl -X PUT "http://[base_url]/api/v1/products/{productId}/active" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: TEN123" \
-H "userId: USR456"
Responses:
- 200 OK: Successfully activated the product. The response typically includes a confirmation message stating that the product has been set to active.
Example Response:
{
"message": "Product activated successfully.",
"productId": "12345"
}
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 activate the product.
LANGUAGE
CURL REQUEST
curl --request PUT \
--url /api/v1/products/{productId}/active \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!