Skip to main content

Create Product

Create a new product in your easycart store.

Request

POST /products

Request Body

ParameterTypeRequiredDescription
statusstringYesProduct status ("draft" or "published")
namestringYesProduct name (max 255 characters)
descriptionstringNoProduct description (max 10,000 characters)
image_urlstringNoURL to the product image (max 255 characters)
currencystringYesISO currency code (3 characters, e.g., "usd", "eur")

Example Request

curl -X POST "https://cart.easy.tools/api/v1/products" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": "published",
"name": "Premium Coffee Beans",
"description": "High-quality arabica coffee beans from Colombia",
"image_url": "https://example.com/images/coffee-beans.jpg",
"currency": "usd"
}'

Response

Success Response (201)

Returns the created product with its empty variants array.

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "published",
"name": "Premium Coffee Beans",
"description": "High-quality arabica coffee beans from Colombia",
"image_url": "https://example.com/images/coffee-beans.jpg",
"checkout_url": "https://cart.easy.tools/checkout/550e8400-e29b-41d4-a716-446655440000",
"currency": "usd",
"variants": []
}

Response Fields

FieldTypeNullableDescription
idstringNoUnique identifier for the product (UUID)
statusstringNoProduct status (e.g., "published" or "draft")
namestringNoProduct name
descriptionstringYesProduct description
image_urlstringYesURL to the product image
checkout_urlstringNoDirect checkout URL for the product
currencystringNoISO currency code (e.g., "usd", "eur")
variantsarrayNoList of product variants (empty for new products)

Error Responses

Validation Error (422)

{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"status": [
"The status field must be one of: draft, published."
],
"currency": [
"The currency field must be exactly 3 characters."
]
}
}