GraphQL with multiple items (Products)

Hello,

How can I use the GraphQL with multiple items (products) in OrderCreate ?

Actually I use this to create order with 1 items

line_items: {	
        sku: "wc-53-2",
        partner_line_item_id: "6298687aa733c",
        quantity: 1,
        price: "188.85",
        product_name: "NAME OF PRODUCT",
        fulfillment_status: "pending",
        quantity_pending_fulfillment: 1,
        warehouse_id: "81578"
    }

Hello @agencep !

Thanks for reaching out today, and welcome to our community!
I would recommend trying this to add multiple products in OrderCreate:

   line_items: [
        {
          sku: "wc-53-2"
          partner_line_item_id: "6298687aa733c"
          quantity: 1
          price: "188.85"
          product_name: "NAME OF PRODUCT"
          fulfillment_status: "pending"
          quantity_pending_fulfillment: 1
          warehouse_id: "81578"
        }
        ,
        {
          sku: "wc-53-3"
          partner_line_item_id: "6298687aa733c3"
          quantity: 1
          price: "188.85"
          product_name: "NAME OF PRODUCT"
          fulfillment_status: "pending"
          quantity_pending_fulfillment: 1
          warehouse_id: "81578"
        }
      ]

Please let me know if you have any questions or concerns.

Best,
RayanP

1 Like