Update po_number using purchase_order_update

Hi,

I’m trying to update po_number using mutation purchase_order_update but it’s throwing error as
po_number: Unknown field.

Please help me to update po_number using purchase_order_update.

Thanks in advance!

1 Like

Hi @supritha!
To be able to update the PO you will need to send the po_id instead.
you can find out the id using the po_number and this query for example:

query {
  purchase_order(po_number: "374058") {
    request_id
    complexity
    data {
      id
      po_number
    }
  }
}

Let me know if that doesn’t help
Thanks in advance!
Tom

1 Like

Hi @tomasw,

I have po_number as "PO-with2line-items-from-api2"and I’m trying to update it to “PO-test” using po_id.

mutation {
  purchase_order_update(
    data: {
      po_id: "UHVyY2hhc2VPcmRlcjo1NzQ5NjU="
      po_number: "PO-test"
    }
  ) {
    request_id
    complexity
  }
} 

I’m getting error as
{
“errors”: [
{
“message”: “Argument “data” has invalid value {po_id:
“UHVyY2hhc2VPcmRlcjo1NzQ5NjU=”, po_number: “PO-test”}.\nIn field “po_number”: Unknown field.”,
“locations”: [
{
“line”: 3,
“column”: 11
}
]
}
]
}

purchase_order_update is working fine if I try to update line_items.
Need help in updating po_number using po_id.

Thanks in advance!

Hi @supritha
That is correct, the po number has to be updated through the UI for now, but I’m making a Feature Request for that to be added to this mutation as well.
I will let you know as soon as I get a response about this.
Thanks in advance!
Tom

Thank you so much, @tomasw!

Hi @supritha
I just wanted to provide an update about this.
The request has been approved and now is on our engineering board to be built.
It might take some time until this gets implemented, but I will let you know as soon as I have a better ETA for it.
Thanks again!
Tom

@tomasw,

That’s a great news!! thanks for the update.

Regards,
Supritha

It says it was scheduled to be added, but is it still not possible to update the po_number field four years later?

Any updates if this will ever be possible?

Hello @Gordon, this has not been implemented yet. I cannot track the original request now, but I will reengage and forward the feedback.
Have a great day!