Moving Line Items to Shipped Status via API

Hi! New to using ShipHero’s GraphQL implementation. I can send shipment data to an order using shipment_create, remove inventory quantities (without updating the line items in the order to shipped,) with inventory_remove, and update the line items to “fulfilled” via order_update_line_items.

I am missing something in that I can’t unallocate the items from the order and move them to shipped.

Can anyone help point me in the right direction to fix the order’s status completely? What am I missing with these mutations to set the line items as shipped as opposed to allocated?

Hey @cs-sf,

Thanks for reaching out and Welcome to our Developer Community!

After using the inventory_remove mutation to correct the inventory quantity, you should be using the order_update_fulfillment_status mutation to set the order and its line items to the fulfilled status. When a line items status is set to fulfilled it shouldn’t be allocated.

If you haven’t already, I’d recommend checking out our article on the Order Flow via the Public API.

Please let me know if you have any questions or concerns.

Best,
RayanP


That’s where I get the issue though. I set the items to fulfilled and it leaves them as allocated?

If I go out of order at all in shipment_create > inventory_remove > order_update_fulfillment_status, does that just then break them being set as Shipped?

Hello @cs-sf

Could you share the order id so we can take a closer look at this case?

That would be the number you have at the end of the URL when you are sitting inside the order.

Have a great day!
TomasFD

343776784 is at the end of the URL. Not the string of upper, lower case letters and numbers id that I use with my mutations/query?

I may have done the order of operations wrong – but it wasn’t clear to me that that would matter.

Hi @tomasfd I was wondering if you could find anything else out about this one. My automation ran and I tried setting it to shipped with it, but didnt set a new order as shipped even if the item shows fulfilled.

Hey @cs-sf,

Thanks for hanging in there!
I’m currently looking into this issue and I’ll get back to you shortly with an update.

Best,
RayanP

Hey @cs-sf,

Thanks for hanging in there!

The ID and the legacy id are interchangeable when querying the Public API. The legacy id is the fully numeric value (343776784) while the id is the string of characters and numbers.

I’ve just replicated your case and confirmed that if you follow the mutations in order, you will get the expected result of fulfilling the order and clearing the line item allocations:

I’ve also noticed in your example you haven’t run the order_update_fulfillment_status mutation which may be why your line items are still allocated.

Please let me know if you have any questions or concerns.

Best,
RayanP

Hey, maybe I’m still missing something. I need to update the individual line items on an order when we have multiple warehouses that may ship something. The documentation says to use: order_update_line_items When I use this mutation, it doesn’t move the items from allocated to fulfilled, only the item status to fulfilled.

It sounds like the one you mentioned is specifically for updating the entire order as fulfilled. how would I update the specific line items in a shipment to move from allocated to shipped?

@Rayanp

@sh-agent I’ve been using the data input as

  order_update_line_items(
    data: {
      order_id: "order_id",
      line_items: [
        {
          id: "line_item_id",
          fulfillment_status: "fulfilled",
          quantity: 1
        }

but this doesn’t seem to work.

Hey @cs-sf,

Thanks for hanging in there!

I’ll get back to you after I confirm if this is the expected behavior or not. During my tests I ran into similar results.

Please let me know if you have any questions or concerns.

Best,
RayanP

Hey @sh-agent were you able to confirm if this is the expected behavior? It is problematic that it seems binary to update all items as fulfilled and update inventory and have these orders stuck at allocated.

Hey @cs-sf,

Thanks for hanging in there!

Instead of using the order_update_line_items mutation to update the fulfillment status directly, could you try updating the quantity pending fulfillment to 0? I believe this will yield the expected results.

mutation {
  order_update_line_items(
    data: {
      order_id: "346704086"
      line_items: [{ id: "TGluZUl0ZW06ODc4ODU3NDU5", quantity_pending_fulfillment:0}]
    }
  ) {
    request_id
    complexity
    order {
      id
      legacy_id
      order_number
      partner_order_id
      shop_name
      fulfillment_status
    }
  }
}

Please let me know if you have any questions or concerns!

Best,
RayanP

Hi Rayan,

After some further testing and clarification on my end, we need to be able to set the items to shipped. Is there a part of the Schema I’m missing that does this specifically on the order_update_line_items input?

It looks like when I use this and set the quantity_pending_fulfillment to 0, it just unallocates the items. I need a way to set the items to actually shipped, as we use this for internal reports.

This image is from another order I tried on, the second item is the one I used the mutation on and it shows unallocated and not shipped. (but status is fulfilled.)

Hey @cs-sf,

Thanks for hanging in there!

I realized that I never clarified that when you use order_update_line_items and change the line item statuses there, they will stay as allocated until you run the order_update_fulfillment mutation.

Meaning when partial shipping line items they will be deallocated when the order is fulfilled, but will be allocated until then. Is this an issue you for you?

Please let me know if you have any questions or concerns.

Best,
RayanP

Hi Rayan,

Thanks for getting back so quickly. I am still having trouble. I followed the steps as:

  1. Create Shipment
  2. Remove Inventory
  3. Update Line Items
  4. Update Fulfillment Status

The test Item I’m using on our dev store shows 0 quantity shipped after running the mutations in the order that was suggested. Am I missing a piece of required input to do this somewhere? I can attach copies of the mutations without some of the identifying info if that would help.
The fulfillment status on the right shows: STATUS: FULFILLED
and the order history shows:

Hey @cs-sf,

Thanks for hanging in there!
Could I grab the order id that you’re using to test for this example?

Please let me know if you have any questions or concerns.

Best,
RayanP

Hey @sh-agent here you go: 347066976

Should be the order id.

1 Like

Hey @cs-sf,

Thanks for hanging in there!

At the moment, I don’t believe it’s possible to have that column reflect an items shipped value when fulfilling orders through the Public API.

The only way I was able to get that column to show the shipped value was when I shipped the order through shipping.shiphero.com.

Please let me know if there’s anything I can do to assist here.

Best,
RayanP

No problem. Will this be something that may be added in the future? I have to reconfigure automation on my end now to function properly to record items from shipped from the warehouse using the GraphQL calls now, it would definitely be appreciated to have this kind of feature parity with the API. @sh-agent