How to create order for bundle product with rest api Magento2 ?
I create an order using Rest Api for a simple product, but for a bundle product it does not work, any example can help me, thanks.
For this, I use this link
https://devdocs.magento.com/redoc/2.3/admin-rest-api.html#operation/salesOrderRepositoryV1SavePut
/rest/V1/orders/create
"entity"=>
[
"base_currency_code"=>"USD",
"base_discount_amount"=> 0,
"base_grand_total"=> 120,
"base_shipping_amount"=> 0,
"base_subtotal"=> 120,
"base_tax_amount"=>0,
"customer_email"=> "[email protected]",
"customer_firstname"=> "test",
"customer_group_id"=> 1,
"customer_id"=> 134,
"customer_is_guest"=> 0,
"customer_lastname"=> "test",
"customer_note_notify"=> 1,
"discount_amount"=> 0,
"email_sent"=> 1,
"coupon_code"=> "Test1",
"discount_description"=> "Test1",
"grand_total"=> 120,
"is_virtual"=> 0,
"order_currency_code"=> "USD",
"shipping_amount"=> 0,
"shipping_description"=> "Flat Rate - Fixed",
"state"=> "new",
"status"=> "pending",
"store_currency_code"=> "USD",
"store_id"=> 1,
"store_name"=> "Main Website\nMain Website Store\n",
"subtotal"=> 120,
"subtotal_incl_tax"=> 120,
"tax_amount"=> 0,
"total_item_count"=> 1,
"total_qty_ordered"=> 1,
"weight"=> 0,
"items" => [ [
"base_discount_amount"=> 0,
"base_original_price"=> 0,
"base_price"=> 0,
"base_price_incl_tax"=> 0,
"base_row_invoiced"=> 0,
"base_row_total"=> 0,
"base_tax_amount"=> 0,
"base_tax_invoiced"=> 0,
"discount_amount"=> 0,
"discount_percent"=> 0,
"free_shipping"=> 0,
"is_virtual"=> 0,
"name"=> "Mixte tandem",
"original_price"=> 0,
"price"=> 0,
"price_incl_tax"=> 0,
"product_id"=> 8,
"product_type"=> "bundle",
"qty_ordered"=> 1,
"row_total"=> 0,
"row_total_incl_tax"=> 0,
"sku"=> "Mixte Tandem",
"store_id"=> 1,
"product_option"=> [
"extension_attributes"=> [
"bundle_options"=> [
[
"option_id"=> 3,
"option_qty"=> 3,
"option_selections"=> ["12","15","16"]
], [
"option_id"=> 4,
"option_qty"=> 2,
"option_selections"=> ["13","14"]
]
],
]
],
] ],
"billing_address"=> [
"address_type"=> "billing",
"city"=> "Gyumri",
"company"=> "Shooga",
"country_id"=> "AM",
"email"=> "[email protected]",
"firstname"=> "test",
"lastname"=> "test",
"postcode"=> "30332",
"region"=> "Shirak",
"region_code"=> "SK",
"region_id"=> 19,
"street"=> [
"Street 1",
"Street 2"
],
"telephone"=> "12345688"
],
"payment"=> [
"method"=> "checkmo"
],
"extension_attributes"=> [
"shipping_assignments"=> [
[
"shipping"=> [
"address"=> [
"address_type"=> "shipping",
"city"=> "Gyumri",
"company"=> "Shooga",
"country_id"=> "AM",
"email"=> "[email protected]",
"firstname"=> "test",
"lastname"=> "test",
"postcode"=> "30332",
"region"=> "Shirak",
"region_code"=> "SK",
"region_id"=> 19,
"street"=> [
"Street 1",
"Street 2"
],
"telephone"=> "12345688"
],
"method"=> "flatrate_flatrate"
]
]
]
]
]
Now i have it in admin
but i need like this