Creating POs and Orders with multiple lines of the same SKU

Hi there!

I am working on an integration with ShipHero where the operation will need to create purchase orders and sales orders with multiple lines for the same SKU. Specific use cases are below.

  • Inbound orders can have multiple lines for the same SKU due to varying lot numbers (this will be mapped to the notes field for each line)
  • Outbound “shipments” can have multiple lines for the same SKU due to different order numbers. The customer will consolidate all open orders for a single customer in their ERP and send an order file to ShipHero, which can have multiple order lines for the same SKU.

I am running into an issue while trying to create POs (SOs too) where the same SKU is repeated across more than one line. The PO is created in ShipHero, but only a single line containing the SKU is created. Please see the mutation below.

mutation {
purchase_order_create(
data: {
po_date: “2020-01-01”
po_number: “TestPOExample6”
subtotal: “230.00”
tax: “2.30”
shipping_price: “0.00”
total_price: “230.00”
warehouse_id: “<WAREHOUSE_ID>”
line_items: [
{
sku: “3673”
quantity: 5
expected_weight_in_lbs: “0”
vendor_id: “”
quantity_received: 0
quantity_rejected: 0
price: “0”
product_name: “Product for testing Purchase Orders”
fulfillment_status: “pending”
sell_ahead: 0
note: “test-lot-1”
partner_line_item_id: “1”
}
{
sku: “3673”
quantity: 5
expected_weight_in_lbs: “0”
vendor_id: “”
quantity_received: 0
quantity_rejected: 0
price: “0”
product_name: “Product for testing Purchase Orders”
fulfillment_status: “pending”
sell_ahead: 0
partner_line_item_id: “2”
note: “test-lot-2”
}
]
fulfillment_status: “pending”
discount: “0.00”
vendor_id: “<VENDOR_ID>”
}
) {
request_id
complexity
purchase_order {
id
po_number
account_id
warehouse_id
vendor_id
created_at
po_date
date_closed
packing_note
fulfillment_status
po_note
description
subtotal
discount
total_price
tax
shipping_method
shipping_carrier
shipping_name
shipping_price
tracking_number
payment_method
payment_due_by
payment_note
locking
locked_by_user_id
line_items(first: 1) {
edges {
node {
id
sku
}
}
}
}
}
}

Has anyone run into this issue before?

Thanks!
Isaac

Hey, I’m currently facing the same issue? Were you able to solve this?