Shipment_Create Line_item_ids format

How do I format the line_item_ids section of th eShipment_Create mutation when I have more than one item? The example in the documentation only has one item like line_item_ids: “111223344”. I tried separating them with a comma like line_item_ids: “111223344”, “111223344” but got a syntax error expecting a name for the second item id.

Hi @BrownMFG!
Try sending them as an array:

line_items: [{ line_item_id: "111223344", quantity: 1 },{ line_item_id: "111223345", quantity: 1 }]

Please let us know if that still doesn’t work.
Thanks in advance!

Hi @tomasw,
That call did succeed but in Shiphero, the shipment says there is only one item in the shipment when I sent two. Do you know why that is? The request id is 6059f09bb09d2ec31ed32613.

Hi @BrownMFG!
I apologize for the delayed response about this

Try by separating the line_item_ids with {}

It looks like for that request_id it has:

line_items: [{ line_item_id: "TGluZUl0ZW06NDk0MDE5NTUz", quantity: 1 ,line_item_id: "TGluZUl0ZW06NDk0MDE5NTUy", quantity: 1 }]

And should be

line_items: [{ line_item_id: "TGluZUl0ZW06NDk0MDE5NTUz", quantity: 1} ,{ line_item_id: "TGluZUl0ZW06NDk0MDE5NTUy", quantity: 1 }]

Let us know if that still doesn’t work
Thanks again!

Hi @tomasw ,
That seems to have worked! Thank you very much.

1 Like