Hi there!
We have a problem when manipulating Purchase Orders(PO) with the API, basically when creating or updating the PO line items quantity_received, it gets updated on the PO but the inventory doesn’t update on the Product, if we update the PO item quantity received on the receive page from web manually (https://purchase-orders.shiphero.com/purchase-orders/details/XXYYZZ/receive) it does change the product inventory as expected.
Is this behavior intentional and we must update the inventory manually on the product with the API as well or is a bug and it SHOULD update the product inventory when interacting with the PO with the API?
Here is the creation mutation we have tried:
mutation($input: CreatePurchaseOrderInput!){
purchase_order_create(data: $input){
complexity
purchase_order{
id
legacy_id
po_number
}
}
}
Input:
{
"input": {
"vendor_id": "VmVuZG9yOjE2MTg3Nw==",
"po_number": "DEV TEST GQL - #55",
"line_items": [
{
"sku": "APUBROWSER",
"quantity": 1,
"price": "0",
"sell_ahead": 0,
"quantity_received": 1,
"expected_weight_in_lbs": "0"
}
],
"po_date": "2019-12-18T12:00:00",
"subtotal": "0",
"shipping_price": "0",
"total_price": "0",
"warehouse_id": "V2FyZWhvdXNlOjEwMjMy"
}
}
With that we got everything set on the PO correctly, but the product itself doesn’t get its inventory updated.
I thought it had to do with the creation mutation but tested the purchase_order_update endpoint to no avail, only the PO quantity gets update without change on the product:
mutation($input: UpdatePurchaseOrderInput!){
purchase_order_update(data: $input){
complexity
purchase_order{
id
legacy_id
po_number
}
}
}
Input:
{
"input": {
"po_id": "UHVyY2hhc2VPcmRlcjo0Mjg2NzA=",
"line_items": [
{
"sku": "APUBROWSER",
"quantity_received": 2
}
]
}
}