Purchase_order_update with new line items

Hi

I’m running a mutation to update a PO, however if i add a line item it seems to break.

mutation {
purchase_order_update ( data: { line_items:[{sku:“9454513215464”, quantity:400, price:“2.22”},
{sku:“759321539248”, quantity:500, price:“8”}]
discount:“0”
shipping_price:“0”
po_id:“UHVyY2hhc2VPcmRlcjo1NjU2MzU=” } ) {
request_id
complexity
purchase_order {
id
po_number
warehouse_id
vendor_id
po_date
fulfillment_status
created_at
line_items{
edges{
node{
sku
quantity
}

}

}

}

    }
            }

Already checked, both sku’s are there, however the error is

{
“errors”: [
{
“message”: “Invalid SKU 9454513215464, no line item exists for the purchase order 565635”,
“operation”: “purchase_order_update”,
“field”: “purchase_order_update”,
“request_id”: “5f5255d3c86f1f8397263392”,
“code”: 5
}
],
“data”: {
“purchase_order_update”: null
}
}

How can i add a line item to the purchase order?

I already searched through the schema using Altair but there seems to be no mutation for this operation.

Thanx!

Hi @lpedretti!
That is because currently, we don’t allow new products to be added to the PO with that mutation, we only allow already added products to get updated.
I logged a Feature Request for this to be added. It will be a mutation similar yo what we have for orders --> order_add_line_items Mutation (in this case purchase_order_add_line_items Mutation)
I will let you know as soon as I have a response for this, in the meantime, you will need to add new products using the app and then if you want to edit quantities for existing SKUs the purchase_order_update will work.
Thanks in advance!
Tom

Hi ShipHero team, may we know the estimated timeframe for the launch of this feature? We are in the midst of integrating ShipHero with our systems and being able to add or delete lines from POs is a critical part of our workflow.

Fingers-crossed that given that the feature request was raised a year ago, it would be sometime soon.

1 Like

I will check on this

Hi Theresa are there updates?

Hello @Edwin!
Unfortunately, there are still no updates on the ETA.
I will request one and let you know as soon as I get an answer from the team.
Have a great day!
Tomas