Hey guys!
I am starting to design an app for my own store and I want to get some feedback on the approach I am considering plus clarify a question.
I generate orders on other channels and want to create those Orders in Shopify via API. At a later time I want to create the Fulfillment in Shopify via API as well.
I was considering using the OrderCreate mutations (orderCreate - GraphQL Admin) and later on use the FulfillmentCreate mutation (fulfillmentCreate - GraphQL Admin). However I found in the docs that the FulfillmentOrders get created automatically in the background.
How can I prevent these FulfillmentOrder from being sent to a different fulfillment service? can my app just grab any existing FulfillmentOrder and create a Fulfillment for it?
Thanks
Hey @ChrisGU,
Your idea sounds solid. Fulfillment orders are created when the order is created, however the fulfillment itself isn’t created until it’s selected to fulfill in the admin or when the fulfillmentCreate mutation is used.
To ensure they are not sent to a different fulfillment service, you can create a fulfillment service of your own and make sure they are assigned to your location when you create the order.
Hope that helps.
Hey @ChrisGU
Do you still have some questions around fulfillment orders, or can I mark this as solved?
Hey @KyleG-Shopify! Thank you very much for responding and helping out!
That makes sense I can create a Fulfillment Service and when I create the order I can specify the fulfillment service on each line item and that should ensure it does not get sent to any other fulfillment service right?
Then is time to fulfill it via API - should I pull the existing FulfillmentOrder automatically created and create a Fulfillment agains it?
Yes, you have that right! If you do run in to any snags while you’re testing it though, do let us know 
Hi!
I have implemented the the flows to create and update order and I am now working on the flow to fulfill them. These orders have been fulfilled outside of shopify through other channels and I want to mark them as fulfilled in shopify (and specify tracking information). However, I am not able to find any existing FulfillmentOrders to fulfill for these orders I am creating via API even when I specify a fulfillment service on each lineItem and I don’t see a mutation to create a FulfillmentOrder that I can fulfill.
Any suggestions or pointers as to how can I mark them as fulfilled?
I would appreciate any information you can share about this!
Thank you!
Hey Chris,
Fulfillment orders should be automatically created when you create the order.
If you query the order directly you can include the fulfillmentOrder ID’s that you can use in subsequent mutations for managing the delivery details
Hey KyleG,
Thanks for replying!
I retrieve the Order and also FulfillmentOrders but getting empty responses. I tried adding Products and Variants as well as inventory levels and making sure the FulfillmentSerivice location had units available but still not seeing the Fulfillment Orders.
I have used these queries:
query getFulfillmentOrdersForOrder($orderId: ID!) {
order(id: $orderId) {
id
name
fulfillmentOrders(first: 10) {
edges {
node {
id
status
}
}
}
}
}
And this one
query getOrderByID {
order(id: “gid://shopify/Order/orderid”) {
id
name
fulfillmentOrders(first: 10) {
edges {
node {
id
status
requestStatus
supportedActions {
action
}
lineItems(first: 1) {
edges {
node {
id
totalQuantity
}
}
}
merchantRequests(first: 1){
edges {
node {
message
}
}
}
}
}
}
}
}
I did a bit more research and after retrieving the order details I see the items are assigned to the “manual” fulfillment service even though I am passing the handle of the newly created FulfillmentService for each item.
Does this means something is wrong with the FulfillmentService? Thanks!
Since this isn’t your own location, this looks like you may not have the proper access scopes for the merchant managed location. You need the read_merchant_managed_fulfillment_orders
scope to see those fulfillment orders.
For the assignment issue: Items fall back to “manual” when there’s a problem with your fulfillment service assignment. This can happen if the fulfillment service handle is invalid, the fulfillment service location doesn’t stock the inventory item, or there are permission issues. Check that your fulfillment service handle is correct and that the location has inventory levels set for the products you’re trying to create orders for. I would also double check the shops fulfillment priority settings as it may default to the merchant managed location.
Hi Kyle, thanks for replying!
Upon further investigation I found out that the reason was that the Variants I was creating for testing had the Shop Location enabled and with “committed” inventory. However I did not see a way to change that in the UI.
Then I created another Variant but did not enabled the Shop Location on it. Orders with this new variant are getting FulfillmentOrders created automatically.
Is there a way to “disable” the Shop Location in a variant in the Dashboard?
Thanks for all your help!
Glad to see we are getting somewhere!
On the product page in the admin, you can edit locations to remove the shop location.
Hey! I did get there but I see the following message
You’ll need to re-asign the inventory on open orders to another location first.
Awesome yeah that worked. I think I should be able to make this work by using autogenerated fulfillmentOrders and not having to use a new fulfillment service
for the shipping portion what webhook topic should I susbcribe to in order to receive notifications for orders that get fulfilled in shopify? either manually fulfilled or by requesting a fulfillment
Thanks!
For fulfillment notifications, you’ll want to subscribe to the fulfillments/create
webhook topic.
If you also want to track any updates to existing fulfillments (like when tracking numbers get added or changed), you can additionally subscribe to fulfillments/update
.
Hey @KyleG-Shopify, thanks for all your help. By passing the fulfillment service handler in each order line item when creating the order and the fulfillment order is generated - does that guarantees that no other third party service will fulfill the order? If not how could I best do it?
Thanks
What’s available to other apps will depend on the scopes granted to them, but generally no, other apps shouldn’t be able to create fulfillments.