• Resolved lxon1014

    (@lxon1014)


    Describe the bug

    Trying to create order with product type composite with multiple variations, but the line_items variations are became separate product.

    product_id not tally from create order, the variation_Id updated to product_id after get order

    Expected behavior

    1. Create order with 1 product type composite with 2 variations.
    2. Get order with 1 product type composite with 2 variations.

    Actual behavior

    1. Create order with 1 product type composite with 2 variations.
    2. Get order with 2 product which is from 2 variations.

    Steps to reproduce

    1. Call RESTFul API create order with product type composite, product id 21926 with different variation_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
    }
    ]
    }

    1. 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”: []
    }
    ],
    },

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Woo REST API – Product Variations issue’ is closed to new replies.