Order LineItem fulfillmentStatus description is incorrect

dotdev-xxx
Tourist
11 0 6

The fulfillmentStatus field on the LineItem object is described incorrectly as:

The line item's fulfillment status. Returns 'fulfilled' if fulfillableQuantity >= quantity, 'partial' if fulfillableQuantity > 0, and 'unfulfilled' otherwise.

This is quite clearly a typo, I assume it was supposed to be something along the lines of:

The line item's fulfillment status. Returns 'fulfilled' if fulfillableQuantity = 0, 'partial' if fulfillableQuantity > 0, and 'unfulfilled' otherwise.

But even when that's fixed the description is reduced to a boolean operation (assuming it's not possible to have a negative fulfillable quantity) and naively calculates the partial status as a function of fulfillableQuantity without considering nonFulfillableQuantity (which is required to determine partial vs unfulfilled) and so it should read:

The line item's fulfillment status. Returns 'fulfilled' if fulfillableQuantity = 0, 'unfulfilled' if quantity - nonFulfillableQuantity = fulfillableQuantity, and 'partial' otherwise.

However this is still incorrect, I'm not exactly sure of Shopify's intent with their use of the word "fulfilled" here but based on their encyclopedic definition of "Fulfillment" and testing the API it seems that the fulfilled status can and should only be achieved if a fulfillment takes place, which a refund is not, and so the description of the fulfilled status is also incorrect as it is not just a function of the fulfillableQuantity but rather the quantityfulfillableQuantity (or unfulfilledQuantity) and nonFulfillableQuantity.

Which could be described in a few ways, but I think the simplest would be:

The line item's fulfillment status. Returns 'fulfilled' if fulfillableQuantity = 0 AND nonFulfillableQuantity < quantity, 'unfulfilled' if quantity - nonFulfillableQuantity = fulfillableQuantity, and 'partial' otherwise.

This description ensures that there was at least one quantity fulfilled and no more remaining.

Obviously this is all quite complicated and so I think it would make sense to describe this behaviour elsewhere and link to it from the reference documentation.

0 Likes