Discussing APIs and development related to customers, discounts, and order management.
How to pass multiple line items in draft orders post request api call ,
Single Line item Ok but i need how to add multiple line_tems to object array Please replay me ASAP.
Rather than posting the code you're using, what is the actual data being sent? That will be much easier to review.
This does not appear to concern versioning, I'm moving this to the APIs and SDKs board.
Edit
Technical difficulties doing so. For now, let me address your question:
It looks like you're halfway to your answer. Your code would probably look like this instead:
"line_items" => array( array("title" => $title, "price" => $price, "quantity" => $quantity, "taxable" => false, "tax_exempt" => false, "taxes_included" => false, "tax_lines" => false), array("title" => $title, "price" => $price, "quantity" => $quantity, "taxable" => false, "tax_exempt" => false, "taxes_included" => false, "tax_lines" => false) ),
You need to provide a standard array of key/value objects, which it seems are also considered arrays in PHP. I'm not a PHP expert so the syntax might not be great, but the concept still applies.
Alex | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog