Skip to main content

Publish Product

Publish a product in your store.

Your store must have an active Easytools plan. If it does not, the call returns 422 and the product stays a draft; a product that is already published cannot be published again either. See Active plan required.

Request

POST /products/{id}/publish

Path Parameters

ParameterTypeRequiredDescription
idstringYesProduct UUID

Example Request

curl -X POST "https://cart.easy.tools/api/v1/products/0632bef5-c308-42cd-9cba-89a7a4f722bb/publish" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"

Response

Success Response (200)

Returns a success message when the product is published.

{
"message": "Product published successfully"
}

Error Responses

Bad Request (400)

{
"message": "Invalid product ID"
}

Product Not Found (404)

{
"message": "Product with ID 0632bef5-c308-42cd-9cba-89a7a4f722bb not found"
}

Publishing Not Allowed (422 — No Active Plan)

Returned when the store has no active Easytools plan. The product stays a draft, and a product that is already published is refused the same way. Activate a plan and retry — repeating the call as it stands returns the same error.

The body carries a message and no errors key.

{
"message": "Product cannot be published without an active Easytools plan"
}