Unable to Mark Orders Fulfilled Via API Call

Highlighted

I sell digital service (no actual tracking number needed) and I'm using a custom script that needs to fulfill orders (mark as fulfilled) via POST API call. The error I get is

"The fulfillment order's assigned fulfillment service must be of api type" 

 I have all read and write settings for the API settings. I have looked for this question on the community and the relevant answers did not resolve my issues (creating custom fulfillment service from shipping settings, read&write access, tried to install a self-created developer app, but the link was broken).

I think if I can get my app installed on my store I might be able to set the fulfillment service to api type, but I can't even get it installed. All I want to do is to be able to mark my order as fulfilled via an API call. Any help is greatly appreciated. 

0 Likes
Highlighted
Shopify Expert
4263 32 434

You really need to provide more details, as fulfillment is one of the more complex issues to master. Some basic info you could provide:

  • What were the relevant line item attributes for fulfillment?
  • What data did you use to make that fulfillment that was rejected?

There are hundred ways or more to screw up. To dig in, you need to expose all the gory details. What was the fulfillment service at the time the order was booked? What API call did you make? And it goes on and on.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Highlighted

Sure so here is a request that gives me this error. I'm using python

d = requests.post("https://[API Auth]@[My Store].myshopify.com/admin/api/2020-10/fulfillment_orders/4171163173053/fulfillment_request.json",json={'fulfillment_request':{"locataion_id":56540266685,'fulfillment_order_line_items':[{'id':7582317674685,'quantity':50}]}})
print(d.text)

{"errors":["The fulfillment order's assigned fulfillment service must be of api type"]}

 The actual attributes of the line item shouldn't be that important I would imagine. Maybe I'm wrong, but there are no variants and, since it is not a physical product, there is no shipping involved. The only attributes that a line item could reasonably use (at least in my mind) are product type and url (a custom item attribute i need to perform the service) since those are the only things that can be different between the line items within one order

The fulfillment service at the time was shopify. I had not yet made a custom fulfillment service, but even after I did, and switched the fulfillment in the order menu, I was still unable to fulfill (same error). That led me to thinking that maybe I need to create an app and install it to my store for me to actually set the fulfillment to type API as the error says, but I am unable to install an app for some reason. 

Does this help clarify at all?

0 Likes
Highlighted
Shopify Expert
4263 32 434

You claim it does not matter, but it does matter. When Shopify books an order for you, it consists of one or more line items. If you examine a line item, you will see attributes that deal with inventory and fulfillment. You cannot gloss over those. You should list what they were at the time the order was booked. It does make a difference because Shopify will create FulfillmentOrder objects based on these settings. In your case, for some reason, your object is not so easily marked as fulfillable, probably because you forgot something, but we cannot see that yet, as you have not provided either the product setup data (product setup), nor the order processed data (line item settings).

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted

I have not claimed it does not matter. Rather, I explained why they seemed like they would not be important so as to better help you understand my current understanding of the system. Here is the json data I get when performing a GET request against my Store for the order I am trying to fulfill.  Please Let me know if this has the line item attributes you are talking about. It would help me a lot if you could explain what/where these attributes are/do instead of simply telling me they are important. I very much appreciate the effort

 

GET ... admin/api/2020-10/orders/2948732682429/fulfillment_orders.json"

{"fulfillment_orders":
[{"id":4171163173053,"shop_id":ShopID,"order_id":2948732682429,"assigned_location_id":MY_LOCATIONID,"fulfillment_service_handle":"manual","request_status":"unsubmitted","status":"open",
"supported_actions":["create_fulfillment"],"destination":null,
"line_items":
[{"id":7582317641917,"shop_id":ShopID,"fulfillment_order_id":4171163173053,"quantity":50,"line_item_id":8775204929725,"inventory_item_id":39033420251325,
"fulfillable_quantity":50,"variant_id":36940630524093},
{"id":7582317674685,"shop_id":ShopID,"fulfillment_order_id":4171163173053,"quantity":50,"line_item_id":8775204962493,"inventory_item_id":39033419432125,
"fulfillable_quantity":50,"variant_id":36940629999805}],
"assigned_location":{"address1":"MY Address","address2":"","city":"MY City","country_code":"US","location_id":MY_LOCATIONID,"name":"MY Address Name","phone":"##########","province":"MY State","zip":"My Zip"},"merchant_requests":[]}]}


0 Likes
Highlighted
Shopify Staff
Shopify Staff
4 0 0

 

Hey @otirenmedia,

I'll be happy to throw some more light on the error you're encountering. Essentially, creating FulfillmentRequest is responsible for sending a request to a third-party warehouse telling them to handle a fulfillment order. Check out this forum post  for details on why you are seeing this error - {"errors":["The fulfillment order's assigned fulfillment service must be of api type"]}.

Since you mention you sell a digital service, you wouldn't need to be making this call to mark an order as being fulfilled. To mark an order as fulfilled, you would have to make a POST request as shown here from the docs. This would create a fulfillment and mark its status as success; if I understand correctly, that is what you're looking to achieve.

Hopefully this clarifies the error you're receiving, and you can now mark orders as fulfilled using the API.

Let me know if you are still unable to mark an order as being fulfilled and I'd be happy to help out. Thank you!

 

Best,

Seth.

0 Likes