Documentation is still being updated. Some content maybe unfinished.
A valid request URL is required to generate request examples{
"id": 289,
"parent_id": 278,
"name": "Premium Cotton T-Shirt - Large, Navy Blue",
"slug": "premium-cotton-t-shirt-large-navy-blue",
"permalink": "https://example-store.com/product/premium-cotton-t-shirt/?attribute_pa_size=large&attribute_pa_color=navy-blue",
"sku": "PCT-2024-L-NAVY",
"description": "Premium Cotton T-Shirt in Large, Navy Blue",
"dates": {
"created": "2024-02-10T09:15:00",
"created_gmt": "2024-02-10T14:15:00",
"modified": "2024-09-18T11:45:00",
"modified_gmt": "2024-09-18T16:45:00"
},
"featured": false,
"prices": {
"price": "80.00",
"regular_price": "80.00",
"sale_price": "",
"price_range": null,
"on_sale": false,
"date_on_sale": {
"from": null,
"from_gmt": null,
"to": null,
"to_gmt": null
},
"currency": {
"code": "USD",
"symbol": "$",
"position": "left",
"decimal_separator": ".",
"thousand_separator": ",",
"decimals": 2
}
},
"hidden_conditions": {
"virtual": false,
"downloadable": false,
"manage_stock": true,
"sold_individually": false,
"shipping_required": true
},
"images": [
{
"id": 724,
"src": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-navy-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-navy-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-navy-600x600.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-navy.jpg"
},
"name": "tshirt-navy",
"alt": "Premium Cotton T-Shirt in Navy Blue",
"position": 0,
"featured": true
}
],
"categories": [
{
"id": 15,
"name": "Clothing",
"slug": "clothing",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/categories/15"
},
{
"id": 22,
"name": "T-Shirts",
"slug": "t-shirts",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/categories/22"
}
],
"tags": [
{
"id": 8,
"name": "Premium",
"slug": "premium",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/tags/8"
}
],
"attributes": [
{
"id": 1,
"name": "Size",
"position": 0,
"visible": true,
"variation": true,
"options": [
"Large"
]
},
{
"id": 2,
"name": "Color",
"position": 1,
"visible": true,
"variation": true,
"options": [
"Navy Blue"
]
}
],
"stock": {
"is_in_stock": true,
"stock_quantity": 45,
"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"
},
"total_sales": 156,
"add_to_cart": {
"text": "Add to cart",
"description": "Add Premium Cotton T-Shirt - Large, Navy Blue to your cart",
"is_purchasable": true,
"purchase_quantity": {
"min_purchase": 1,
"max_purchase": 45
},
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item"
},
"meta_data": [
{
"key": "_fabric",
"value": "100% Cotton"
}
]
}Gets a single variation for a variable product.
A valid request URL is required to generate request examples{
"id": 289,
"parent_id": 278,
"name": "Premium Cotton T-Shirt - Large, Navy Blue",
"slug": "premium-cotton-t-shirt-large-navy-blue",
"permalink": "https://example-store.com/product/premium-cotton-t-shirt/?attribute_pa_size=large&attribute_pa_color=navy-blue",
"sku": "PCT-2024-L-NAVY",
"description": "Premium Cotton T-Shirt in Large, Navy Blue",
"dates": {
"created": "2024-02-10T09:15:00",
"created_gmt": "2024-02-10T14:15:00",
"modified": "2024-09-18T11:45:00",
"modified_gmt": "2024-09-18T16:45:00"
},
"featured": false,
"prices": {
"price": "80.00",
"regular_price": "80.00",
"sale_price": "",
"price_range": null,
"on_sale": false,
"date_on_sale": {
"from": null,
"from_gmt": null,
"to": null,
"to_gmt": null
},
"currency": {
"code": "USD",
"symbol": "$",
"position": "left",
"decimal_separator": ".",
"thousand_separator": ",",
"decimals": 2
}
},
"hidden_conditions": {
"virtual": false,
"downloadable": false,
"manage_stock": true,
"sold_individually": false,
"shipping_required": true
},
"images": [
{
"id": 724,
"src": {
"thumbnail": "https://example-store.com/wp-content/uploads/2024/02/tshirt-navy-150x150.jpg",
"medium": "https://example-store.com/wp-content/uploads/2024/02/tshirt-navy-300x300.jpg",
"large": "https://example-store.com/wp-content/uploads/2024/02/tshirt-navy-600x600.jpg",
"full": "https://example-store.com/wp-content/uploads/2024/02/tshirt-navy.jpg"
},
"name": "tshirt-navy",
"alt": "Premium Cotton T-Shirt in Navy Blue",
"position": 0,
"featured": true
}
],
"categories": [
{
"id": 15,
"name": "Clothing",
"slug": "clothing",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/categories/15"
},
{
"id": 22,
"name": "T-Shirts",
"slug": "t-shirts",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/categories/22"
}
],
"tags": [
{
"id": 8,
"name": "Premium",
"slug": "premium",
"rest_url": "https://example-store.com/wp-json/cocart/v2/products/tags/8"
}
],
"attributes": [
{
"id": 1,
"name": "Size",
"position": 0,
"visible": true,
"variation": true,
"options": [
"Large"
]
},
{
"id": 2,
"name": "Color",
"position": 1,
"visible": true,
"variation": true,
"options": [
"Navy Blue"
]
}
],
"stock": {
"is_in_stock": true,
"stock_quantity": 45,
"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"
},
"total_sales": 156,
"add_to_cart": {
"text": "Add to cart",
"description": "Add Premium Cotton T-Shirt - Large, Navy Blue to your cart",
"is_purchasable": true,
"purchase_quantity": {
"min_purchase": 1,
"max_purchase": 45
},
"rest_url": "https://example-store.com/wp-json/cocart/v2/cart/add-item"
},
"meta_data": [
{
"key": "_fabric",
"value": "100% Cotton"
}
]
}Unique identifier for the variable product.
Unique identifier for the variation.
Product variation retrieved successfully.
CoCart v2 Product Variation object. Variations use the same structure as Product objects, but with the following fields removed: type, short_description, hidden_conditions.reviews_allowed, average_rating, review_count, rating_count, rated_out_of, reviews, default_attributes, variations, grouped_products, related, upsells, cross_sells, external_url, button_text, and add_to_cart.has_options.
Unique identifier for the variation
Product parent ID (the variable product this variation belongs to)
Variation name
Variation slug
Variation URL
Unique identifier (SKU)
Variation description
Variation dates
Show child attributes
Whether the variation is featured
Variation pricing information
Show child attributes
Variation conditional flags (note reviews_allowed is not present)
Show child attributes
Variation images
Show child attributes
Product categories (inherited from parent)
Show child attributes
Product tags (inherited from parent)
Show child attributes
Variation attributes
Show child attributes
Stock information
Show child attributes
Variation weight
Show child attributes
Variation dimensions
Show child attributes
Total number of sales for this variation
Add to cart information (note has_options is not present)
Show child attributes
Meta data
Show child attributes
Was this page helpful?