WooCommerce API: Create order with meta data on line item WooCommerce API: Create order with meta data on line item wordpress wordpress

WooCommerce API: Create order with meta data on line item


You can't specify the product variation data when placing a order, the product variation should already exist and shall be referred to using the variation ID.

For example if you would place a order of the "black" variation (say it has variation ID 12):

"line_items": [  {    "product_id": 1,    "variation_id": 12,    "quantity": 1  }]

Adding metadata to a product variation can not be done using the orders endpoint, use the products endpoint for updating products.