Possible to calculate accepted/rejected quantities for inventoryTransfer(s)?

I’ve been working with the GQL admin API to retrieve information on inventory transfers, and have noticed that there seems to be no way to pull accepted or rejected quantities on the line items for a transfer. The receivedQuantity field on the InventoryTransfer object sums the accepted/rejected values, and, according to the docs, the only quantity fields on the InventoryTransferLineItem object are processableQuantity, shippableQuantity, shippedQuantity, and totalQuantity. If there’s a way to derive the accepted/rejected quantity from those values somehow it’s not obvious to me. Querying two test transfers where one had accepted items and the other rejected results in identical looking InventoryTransfer objects, with all quantity values the same. Am I correct that there is no way to pull accepted/rejected values for inventory transfers at this time?

If there is no way to determine the accepted/rejected quantities from the GQL API, is there any info on whether those fields might be added in a future version?

Hey @Christopher_Larabee :waving_hand:

I think the split you’re looking for is available, just one layer down from the transfer line items.

InventoryTransferLineItem doesn’t expose accepted/rejected quantities directly, but you can query the transfer’s shipments connection, then each shipment’s lineItems. Those InventoryShipmentLineItem nodes expose acceptedQuantity and rejectedQuantity.

For example:

query TransferReceivedBreakdown($id: ID!) {
  inventoryTransfer(id: $id) {
    id
    receivedQuantity
    shipments(first: 50) {
      nodes {
        id
        totalAcceptedQuantity
        totalRejectedQuantity
        lineItems(first: 250) {
          nodes {
            inventoryItem {
              id
              sku
            }
            quantity
            acceptedQuantity
            rejectedQuantity
            unreceivedQuantity
          }
        }
      }
    }
  }
}

Hope this helps - let me know if I’m misunderstanding/can help out further!

@Alan_G Fantastic! I knew I had to be missing something… This meets my need perfectly!

Thanks very much for your reply, you’re a lifesaver!