Creating a purchase order via graph

We are currently importing purchase orders from CSV files into the import utility in ShipHero for purchase orders.

We want to have that automatic and pursuing an option going through Make module.

I have a few questions about it:

  • The create purchase order mutation passes the vendor_id. However, in the CSV, the name is passed. It was suggested that to return the list of vendors and find the id that way.
    How would the import process get the vendor_id? How does it reconcile that if the list returns 2 different vendors with the same name?
  • Is there a hard cap limit in the amount to return? I read the default is 100. I would probably just set it to 200, since the current number is below the default.
  • It looks like with the update purchase order mutation, you cannot currently add/remove line items, right?

Hi @pmb88

  1. Multiple vendor with the same name would need to exist within separate accounts. When using the upload it would match the vendor name with a vendor in the account to which the upload is made.
  2. Depending on the complexity of the call you can return up to 500 vendors in your call.
  3. You can use the purchase_order_update mutation for this action. for instance a call like:

mutation {
purchase_order_update(
data: {po_id: “UHVyY2hhc2VPcmRlcjoyOTM5MDg5”, line_items: {sku: “101008”, quantity: 0}}
) {
request_id
}
}

would remove the sku “101008” from the purchase order. When using line items it will override existing instances of the same line item.