Not able to update a order line data along with order data in a single api mutation

Hello there,
I am relatively new to GraphQL. I would appreciate if anyone could help me out with my question. I am trying to update order data and order line item data using order_update mutation. This API is not supported.

Also, I tried to update order fields along order line items fields from order_update_line_items API. This is also not supported.

Here is the summary:

API Order data update support Order lime item data update
order_update Yes No
order_update_line_items No Yes
other API??? Yes Yes

I also tested, if any order gets canceled then its order line items are set to cancel status which is nice. But if I set that same order to pending status then its order line items are not set to pending status. I ended up consuming two API calls to handle my order.

It is also not possible to create a new order with the same order number when it is in a canceled state in Shihero.

My query looks like this:
mutation {
order_update(
data: {
order_id: “ABC1234”
fulfillment_status: “pending”
line_items:[
{id: “SOLABC1234” fulfillment_status: “pending”},
{id: “SOLABC1234” fulfillment_status: “pending”},
{id: “SOLABC1234” fulfillment_status: “pending”},
]
}
)
{
request_id
complexity
order {
id
line_items {
edges {
node {
id
sku
partner_line_item_id
}
}
}
}
}
}

Error: API Response:400. Argument “data” has invalid value. In field “line_items”: Unknown field.

Any solution please?

Hey @Prabhu,

Thanks for reaching out!

I believe the order number is store specific, so it’s not able to be repeated.

The line items of an order can only be updated through the order_update_line_items mutation. Which is why you’re getting the error that the field line_items is invalid when trying to run an order_update mutation.

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

Best,
RayanP

Hi @Rayanp,
thank you for your reply. Is it possible to update multiple orders at a time using order_update API? If yes, what does its syntax look like?

Hey @Prabhu,

Thanks for your patience!

Unfortunately at the moment that capability isn’t present in our Public API.
Let me know if there’s anything I can do to assist.

Best,
RayanP