Woo REST API – Product Variations issue
-
Describe the bug
Trying to
create order
with product typecomposite
with multiplevariations
, but theline_items variations
are became separate product.product_id
not tally from create order, thevariation_Id
updated toproduct_id
afterget order
Expected behavior
- Create order with 1 product type
composite
with 2 variations. - Get order with 1 product type
composite
with 2 variations.
Actual behavior
- Create order with 1 product type
composite
with 2 variations. - Get order with 2 product which is from 2 variations.
Steps to reproduce
- Call RESTFul API
create order
with product typecomposite
, product id21926
with differentvariation_id
{
“payment_method”: “billplz”,
“payment_method_title”: “billplz”,
“set_paid”: false,
“customer_id”: 2983,
“billing”: {
“first_name”: “John”,
“last_name”: “Doe”,
“address_1”: “969 Market”,
“address_2”: “”,
“city”: “San Francisco”,
“state”: “CA”,
“postcode”: “94103”,
“country”: “US”,
“email”: “[email protected]“,
“phone”: “(555) 555-5555”
},
“shipping”: {
“first_name”: “John”,
“last_name”: “Doe”,
“address_1”: “969 Market”,
“address_2”: “”,
“city”: “San Francisco”,
“state”: “CA”,
“postcode”: “94103”,
“country”: “US”
},
“line_items”: [
{
“product_id”: 21926,
“variation_id”: 21900,
“quantity”: 2
},
{
“product_id”: 21926,
“variation_id”: 21914,
“quantity”: 2
}
]
}- Call RESTFul API
get orders
, response below:
{
“id”: 55348,
“parent_id”: 0,
“number”: “10002576”,
“created_via”: “rest-api”,
…
“line_items”: [
{
“id”: 6306,
“name”: “200g Cookies in Bag”,
“product_id”: 21900,
“variation_id”: 21901,
“quantity”: 2,
“tax_class”: “”,
“subtotal”: “53.00”,
“subtotal_tax”: “0.00”,
“total”: “53.00”,
“total_tax”: “0.00”,
“taxes”: [],
“meta_data”: [
{
“id”: 83140,
“key”: “pa_variations”,
“value”: “caffe-macchiato”
}
],
“sku”: “200GBAG-001”,
“price”: 26.5,
“composite_parent”: “”,
“composite_children”: [],
“bundled_by”: “”,
“bundled_item_title”: “”,
“bundled_items”: []
},
{
“id”: 6307,
“name”: “Sweet Treats pack”,
“product_id”: 21914,
“variation_id”: 21915,
“quantity”: 2,
“tax_class”: “”,
“subtotal”: “0.00”,
“subtotal_tax”: “0.00”,
“total”: “0.00”,
“total_tax”: “0.00”,
“taxes”: [],
“meta_data”: [
{
“id”: 83150,
“key”: “pa_sweet-treats-pack-colour”,
“value”: “orange-pack”
}
],
“sku”: “Orange box”,
“price”: 0,
“composite_parent”: “”,
“composite_children”: [],
“bundled_by”: “”,
“bundled_item_title”: “”,
“bundled_items”: []
}
],
}, - Create order with 1 product type
- The topic ‘Woo REST API – Product Variations issue’ is closed to new replies.