## Is there a way to get the fulfilled quantity ?

Visitor
2 0 1

Hi there,

This is something very basic I'm about to ask so I'm probably just missing something:

I need, for some reasons, to get the fulfilled quantity of ordered items but, accordingly to the doc, the Order API only provides the fulfillable_quantity that is the result of a computation:

`quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity`

By this, the fulfilled quantity is not directly exposed and there is no way to guess it, or maybe there is ?

Replies 4 (4)
Visitor
2 0 1

Someone ??

Shopify Partner
1873 184 901

Will the order.fulfillments.line_items.quantity not do?

Maybe I am misunderstanding your question...

Shopify Partner
660 0 130

I'm also looking for the fulfilled quantity.

I think @KarlOffenberger is right. As far as I can tell it is the best way to get the fulfilled quantity.

By the way, this formula is wrong

fulfillable_quantity =

`quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity`

This doesn't make sense to me.

As far as I can tell it is actually fulfillable_quantity = quantity - refunded_quantity - fulfilled_quantity - pending_fulfilled_quantity - open_fulfilled_quantity

For example, if you sell 10, refund 3 and fulfill 2, the fulfillable is 10 - 3 - 2 = 5 (I just tested).

Accordingly to this formula, it should be 10 - max(3, 2) = 7.

Am I missing something? Or is the documentation wrong?

If I am right, then you can also get the fulfilled_quantity by computing

fulfilled_quantity = quantity - refunded_quantity - fulfillable_quantity

But if there are pending/open fulfillments, they will be included, so it may be a better to actually check fulfillment objects.

I guess it depends if it should count open fulfillments as fulfilled or not.

Is anyone from Shopify able to give an official answer? That would be great.

Shopify Partner
5 0 4

I noticed the same thing. Shopify, please clarify or fix!

I provided context-specific feedback on the documentation page - I recommend you do the same, since it seems Shopify doesn't monitor this forum very closely.