How to add new or update existing line items in existing order in order_update mutation query

Hi

Can you please tell me how to add new line items or update existing line items in an existing order? I saw there is an order_update mutation but does it support adding new line items or removing existing lin items.

Note: I am using GraphQL API.

Can you please suggest a way to do the same?
If possible please share the mutation request as well.

Thanks in advance!:blush:

Hi @khungersumit!
You could add new line items using the order_add_line_items or update existing line items with the order_update_line_items

order_add_line_items

mutation {
  order_add_line_items(
    data: {
      order_id: "154713804"
      line_items: {
        sku: "154713804154713804"
        partner_line_item_id: "2800112233466915"
        quantity: 2
        price: "150.00"
        product_name: "Hello New Product"
        fulfillment_status: "pending"
        quantity_pending_fulfillment: 2
        warehouse_id: "V2FyZWhvdXNlOjExNzkw"
      }
    }
  ) {
    request_id
    complexity
  }
}

order_update_line_items

mutation {
  order_update_line_items(
    data: {
      order_id: "154713804"
      line_items: { id: "436514716", price: "0.00" }
    }
  ) {
    request_id
    complexity
  }
}

Let me know if you still more information about those.
Thanks in advance!
Tom