Documentation is still being updated. Some content maybe unfinished.
A valid request URL is required to generate request examples{
"id": 278,
"parent_id": 0,
"name": "Premium Cotton T-Shirt",
"type": "variable",
"slug": "premium-cotton-t-shirt",
"permalink": "https://example-store.com/product/premium-cotton-t-shirt/",
"sku": "PCT-2024",
"description": "<p>Soft, breathable premium cotton t-shirt perfect for everyday wear.</p>",
"short_description": "<p>Comfortable premium cotton t-shirt in various sizes and colors.</p>",
"dates": {
"created": "2024-02-10T09:15:00",
"created_gmt": "2024-02-10T13:15:00",
"modified": "2024-09-18T11:45:00",
"modified_gmt": "2024-09-18T15:45:00"
},
"featured": false,
"prices": {
"price": "25.00",
"regular_price": "25.00",
"sale_price": "",
"price_range": {
"min": "25.00",
"max": "35.00"
},
"on_sale": false,
"date_on_sale": {
"from": null,
"from_gmt": null,
"to": null,
"to_gmt": null
},
"currency": {
"currency_code": "USD",
"currency_symbol": "$",
"currency_minor_unit": 2,
"currency_decimal_separator": ".",
"currency_thousand_separator": ",",
"currency_prefix": "$",
"currency_suffix": ""
}
},
"hidden_conditions": {
"virtual": false,
"downloadable": false,
"manage_stock": false,
"sold_individually": false,
"reviews_allowed": true,
"shipping_required": true
},
"average_rating": "4.8",
"review_count": 234,
"rating_count": 234,
"rated_out_of": "5",
"images": [
{
"id": 723,
"src": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-1024x1024.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white.jpg"
},
"name": "tshirt-white",
"alt": "Premium Cotton T-Shirt in White",
"position": 0,
"featured": true
},
{
"id": 724,
"src": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-1024x1024.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black.jpg"
},
"name": "tshirt-black",
"alt": "Premium Cotton T-Shirt in Black",
"position": 1,
"featured": false
}
],
"categories": [
{
"id": 23,
"name": "Clothing",
"slug": "clothing",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/categories/23"
},
{
"id": 28,
"name": "T-Shirts",
"slug": "t-shirts",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/categories/28"
}
],
"tags": [
{
"id": 51,
"name": "Cotton",
"slug": "cotton",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/tags/51"
},
{
"id": 89,
"name": "Casual",
"slug": "casual",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/tags/89"
}
],
"attributes": {
"attribute_size": {
"id": 1,
"name": "Size",
"position": 0,
"is_attribute_visible": true,
"used_for_variation": true,
"options": {
"small": "Small",
"medium": "Medium",
"large": "Large",
"x-large": "X-Large"
}
},
"attribute_color": {
"id": 2,
"name": "Color",
"position": 1,
"is_attribute_visible": true,
"used_for_variation": true,
"options": {
"white": "White",
"black": "Black",
"navy-blue": "Navy Blue",
"gray": "Gray"
}
}
},
"default_attributes": {
"attribute_size": {
"id": 1,
"name": "Size",
"option": {
"medium": "Medium"
}
},
"attribute_color": {
"id": 2,
"name": "Color",
"option": {
"white": "White"
}
}
},
"variations": [
{
"id": 289,
"sku": "PCT-2024-SM-WHT",
"description": "Small White T-Shirt",
"attributes": {
"attribute_size": "small",
"attribute_color": "white"
},
"featured_image": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-1024x1024.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white.jpg"
},
"prices": {
"price": "25.00",
"regular_price": "25.00",
"sale_price": "",
"on_sale": false,
"date_on_sale": {
"from": null,
"from_gmt": null,
"to": null,
"to_gmt": null
},
"currency": {
"currency_code": "USD",
"currency_symbol": "$",
"currency_minor_unit": 2,
"currency_decimal_separator": ".",
"currency_thousand_separator": ",",
"currency_prefix": "$",
"currency_suffix": ""
}
},
"stock": {
"is_in_stock": true,
"stock_quantity": 50,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null
},
"add_to_cart": {
"is_purchasable": true,
"purchase_quantity": {
"min_purchase": 1,
"max_purchase": 50
},
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item?id=289&quantity=1&variation[attribute_size]=small&variation[attribute_color]=white"
}
},
{
"id": 290,
"sku": "PCT-2024-LG-BLK",
"description": "Large Black T-Shirt",
"attributes": {
"attribute_size": "large",
"attribute_color": "black"
},
"featured_image": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-1024x1024.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black.jpg"
},
"prices": {
"price": "28.00",
"regular_price": "28.00",
"sale_price": "",
"on_sale": false,
"date_on_sale": {
"from": null,
"from_gmt": null,
"to": null,
"to_gmt": null
},
"currency": {
"currency_code": "USD",
"currency_symbol": "$",
"currency_minor_unit": 2,
"currency_decimal_separator": ".",
"currency_thousand_separator": ",",
"currency_prefix": "$",
"currency_suffix": ""
}
},
"stock": {
"is_in_stock": true,
"stock_quantity": 35,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null
},
"add_to_cart": {
"is_purchasable": true,
"purchase_quantity": {
"min_purchase": 1,
"max_purchase": 35
},
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item?id=290&quantity=1&variation[attribute_size]=large&variation[attribute_color]=black"
}
}
],
"grouped_products": [],
"stock": {
"is_in_stock": true,
"stock_quantity": null,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null
},
"weight": {
"value": "0.2",
"unit": "kg"
},
"dimensions": {
"length": "12",
"width": "10",
"height": "1",
"unit": "cm"
},
"reviews": [],
"related": [
{
"id": 301,
"name": "Classic Polo Shirt",
"permalink": "https://example-store.com/product/classic-polo-shirt/",
"price": "32.00",
"add_to_cart": {
"text": "Select options",
"description": "Variable product",
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item?id=301&quantity=1"
},
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/301"
}
],
"upsells": [],
"cross_sells": [],
"total_sales": 567,
"external_url": "",
"button_text": "",
"add_to_cart": {
"text": "Select options",
"description": "Variable product",
"has_options": true,
"is_purchasable": true,
"purchase_quantity": {},
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item?id=278&quantity=1"
},
"meta_data": []
}Gets a single product by ID or SKU.
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/v2/products/{id}{
"id": 278,
"parent_id": 0,
"name": "Premium Cotton T-Shirt",
"type": "variable",
"slug": "premium-cotton-t-shirt",
"permalink": "https://example-store.com/product/premium-cotton-t-shirt/",
"sku": "PCT-2024",
"description": "<p>Soft, breathable premium cotton t-shirt perfect for everyday wear.</p>",
"short_description": "<p>Comfortable premium cotton t-shirt in various sizes and colors.</p>",
"dates": {
"created": "2024-02-10T09:15:00",
"created_gmt": "2024-02-10T13:15:00",
"modified": "2024-09-18T11:45:00",
"modified_gmt": "2024-09-18T15:45:00"
},
"featured": false,
"prices": {
"price": "25.00",
"regular_price": "25.00",
"sale_price": "",
"price_range": {
"min": "25.00",
"max": "35.00"
},
"on_sale": false,
"date_on_sale": {
"from": null,
"from_gmt": null,
"to": null,
"to_gmt": null
},
"currency": {
"currency_code": "USD",
"currency_symbol": "$",
"currency_minor_unit": 2,
"currency_decimal_separator": ".",
"currency_thousand_separator": ",",
"currency_prefix": "$",
"currency_suffix": ""
}
},
"hidden_conditions": {
"virtual": false,
"downloadable": false,
"manage_stock": false,
"sold_individually": false,
"reviews_allowed": true,
"shipping_required": true
},
"average_rating": "4.8",
"review_count": 234,
"rating_count": 234,
"rated_out_of": "5",
"images": [
{
"id": 723,
"src": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-1024x1024.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white.jpg"
},
"name": "tshirt-white",
"alt": "Premium Cotton T-Shirt in White",
"position": 0,
"featured": true
},
{
"id": 724,
"src": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-1024x1024.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black.jpg"
},
"name": "tshirt-black",
"alt": "Premium Cotton T-Shirt in Black",
"position": 1,
"featured": false
}
],
"categories": [
{
"id": 23,
"name": "Clothing",
"slug": "clothing",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/categories/23"
},
{
"id": 28,
"name": "T-Shirts",
"slug": "t-shirts",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/categories/28"
}
],
"tags": [
{
"id": 51,
"name": "Cotton",
"slug": "cotton",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/tags/51"
},
{
"id": 89,
"name": "Casual",
"slug": "casual",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/tags/89"
}
],
"attributes": {
"attribute_size": {
"id": 1,
"name": "Size",
"position": 0,
"is_attribute_visible": true,
"used_for_variation": true,
"options": {
"small": "Small",
"medium": "Medium",
"large": "Large",
"x-large": "X-Large"
}
},
"attribute_color": {
"id": 2,
"name": "Color",
"position": 1,
"is_attribute_visible": true,
"used_for_variation": true,
"options": {
"white": "White",
"black": "Black",
"navy-blue": "Navy Blue",
"gray": "Gray"
}
}
},
"default_attributes": {
"attribute_size": {
"id": 1,
"name": "Size",
"option": {
"medium": "Medium"
}
},
"attribute_color": {
"id": 2,
"name": "Color",
"option": {
"white": "White"
}
}
},
"variations": [
{
"id": 289,
"sku": "PCT-2024-SM-WHT",
"description": "Small White T-Shirt",
"attributes": {
"attribute_size": "small",
"attribute_color": "white"
},
"featured_image": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white-1024x1024.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-white.jpg"
},
"prices": {
"price": "25.00",
"regular_price": "25.00",
"sale_price": "",
"on_sale": false,
"date_on_sale": {
"from": null,
"from_gmt": null,
"to": null,
"to_gmt": null
},
"currency": {
"currency_code": "USD",
"currency_symbol": "$",
"currency_minor_unit": 2,
"currency_decimal_separator": ".",
"currency_thousand_separator": ",",
"currency_prefix": "$",
"currency_suffix": ""
}
},
"stock": {
"is_in_stock": true,
"stock_quantity": 50,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null
},
"add_to_cart": {
"is_purchasable": true,
"purchase_quantity": {
"min_purchase": 1,
"max_purchase": 50
},
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item?id=289&quantity=1&variation[attribute_size]=small&variation[attribute_color]=white"
}
},
{
"id": 290,
"sku": "PCT-2024-LG-BLK",
"description": "Large Black T-Shirt",
"attributes": {
"attribute_size": "large",
"attribute_color": "black"
},
"featured_image": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black-1024x1024.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-black.jpg"
},
"prices": {
"price": "28.00",
"regular_price": "28.00",
"sale_price": "",
"on_sale": false,
"date_on_sale": {
"from": null,
"from_gmt": null,
"to": null,
"to_gmt": null
},
"currency": {
"currency_code": "USD",
"currency_symbol": "$",
"currency_minor_unit": 2,
"currency_decimal_separator": ".",
"currency_thousand_separator": ",",
"currency_prefix": "$",
"currency_suffix": ""
}
},
"stock": {
"is_in_stock": true,
"stock_quantity": 35,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null
},
"add_to_cart": {
"is_purchasable": true,
"purchase_quantity": {
"min_purchase": 1,
"max_purchase": 35
},
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item?id=290&quantity=1&variation[attribute_size]=large&variation[attribute_color]=black"
}
}
],
"grouped_products": [],
"stock": {
"is_in_stock": true,
"stock_quantity": null,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": null
},
"weight": {
"value": "0.2",
"unit": "kg"
},
"dimensions": {
"length": "12",
"width": "10",
"height": "1",
"unit": "cm"
},
"reviews": [],
"related": [
{
"id": 301,
"name": "Classic Polo Shirt",
"permalink": "https://example-store.com/product/classic-polo-shirt/",
"price": "32.00",
"add_to_cart": {
"text": "Select options",
"description": "Variable product",
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item?id=301&quantity=1"
},
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/301"
}
],
"upsells": [],
"cross_sells": [],
"total_sales": 567,
"external_url": "",
"button_text": "",
"add_to_cart": {
"text": "Select options",
"description": "Variable product",
"has_options": true,
"is_purchasable": true,
"purchase_quantity": {},
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item?id=278&quantity=1"
},
"meta_data": []
}Unique identifier for the product (ID or SKU).
Product retrieved successfully.
CoCart v2 Product object with custom structure
Unique identifier for the product
Product parent ID
Product name
Product type
simple, grouped, external, variable Product slug
Product URL
Unique identifier (SKU)
Product description
Product short description
Product dates
Show child attributes
Whether the product is featured
Product pricing information
Show child attributes
Product conditional flags
Show child attributes
Average rating
Number of reviews
Number of ratings
Maximum rating value (formatted)
Product images
Show child attributes
Product categories
Show child attributes
Product tags
Show child attributes
Product attributes
Show child attributes
Default variation attributes
Show child attributes
Full variation objects (not just IDs)
Show child attributes
Grouped product IDs
Stock information
Show child attributes
Product weight
Show child attributes
Product dimensions
Show child attributes
Product reviews (populated when show_reviews parameter is true)
Show child attributes
Related products with basic information
Show child attributes
Upsell products with basic information
Show child attributes
Cross-sell products with basic information
Show child attributes
Total number of sales
External product URL (for external product type)
External product button text (for external product type)
Add to cart information (CoCart-specific)
Show child attributes
Meta data
Show child attributes
Was this page helpful?