Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: assignedFulfillmentOrders return api_client is not associated with any fulfillment service

assignedFulfillmentOrders return api_client is not associated with any fulfillment service

vertalm
Shopify Partner
18 0 14

Hello

Im trying implement fulfillment service app and everything work ok before this step

'query requests the fulfillment order destination, line item and line item SKUs'

Im trying to request orders withi this code

 

 

query {
  shop {
    assignedFulfillmentOrders(first: 10, assignmentStatus: FULFILLMENT_REQUESTED) {
      edges {
        node {
          id
          destination {
            firstName
            lastName
            address1
            city
            province
            zip
            countryCode
            phone
          }
          lineItems(first: 10) {
            edges {
              node {
                id
                lineItem {
                  name
                  sku
                }
                remainingQuantity
              }
            }
          }
          merchantRequests(first: 10, kind: FULFILLMENT_REQUEST) {
            edges {
              node {
                message
              }
            }
          }
        }
      }
    }
  }
}

 

 

 

And expect to get result

{
"data": {
"shop": {
"assignedFulfillmentOrders": {
"edges": [......

But Im getting

 

 

{
  "data": null,
  "errors": [
    {
      "message": "[\"The api_client is not associated with any fulfillment service.\"]",
      "locations": [
        {
          "line": 3,
          "column": 5
        }
      ],
      "path": [
        "shop",
        "assignedFulfillmentOrders"
      ]
    }
  ],

 

 


Additional info:
All permissions are granted to my app via GraphQL explorer
Im using 2022-01(Latest) API
Another thing: REST API works well... But what about GraphQL?

So, looks like this is Shopify bug. Or?

Replies 6 (6)

Zworthkey
Shopify Partner
5581 642 1581

@vertalm 
Have you verified that the Shopify shop has fulfillment services properly defined? And have you verified your API credentials have been granted this access scope? 
https://shopify.dev/docs/admin-api/access-scopes 

vertalm
Shopify Partner
18 0 14

Yes, fulfillment services properly defined and credentials granted.
otherwise Rest API also should fail, but its worked

Slokie
Shopify Partner
14 2 6

You have any luck in this?

 

I'm also having this same issue. I was able to setup my callbackurl eventually. I had to use Insomnia though... using GraphQL queries via the Shopify API would let me create the fulfillment service, but the url was always null... nothing I did would make it register.

 

But I was able to get it at least create successfully via the REST API through Insomnia, yet I'm experiencing this exact issue... i.e. I can go into my product pages and assign the new fullfillment service without any problems. But when I create a new order, nothing calls my endpoint, and the order webhook I get (which I use for generating my custom products) does actually list my fulfillment service, but the status and fulfillments are null:

 

fulfillments":[]

...

"fulfillable_quantity":1,"fulfillment_service":"slokie-fulfillment","fulfillment_status":null,

 

 

 

And, most troublesome, when I call AssignedFulfillmentOrders, I get null back, just like you describe.  

 

From this other thread, I thought perhaps that the issue was that my location might not have been assigned correctly, and indeed it was not. But fixing that did not resolve the issue.

 

When I use Insomnia to create a new fulfillment service via the REST API (since again, the graphql approach failed...), I get this response, which seems to indicate everything's in order. Note: I obfuscated my endpoint, but it's currently just setup to return a 200 ok response for the sake of getting this running.

{
"fulfillment_service": {
"id": 58584400069,
"name": "Slokie Fulfillment",
"email": null,
"service_name": "Slokie Fulfillment",
"handle": "slokie-fulfillment",
"fulfillment_orders_opt_in": true,
"include_pending_stock": false,
"provider_id": null,
"location_id": 66363785413,
"callback_url": "https:\/\/xxxxxxxxxxxxxxxxxxxxxxx(obfuscated)",
"tracking_support": true,
"inventory_management": true,
"admin_graphql_api_id": "gid:\/\/shopify\/ApiFulfillmentService\/58584400069"
}
}

 

Anyone have any ideas?

 

Slokie
Shopify Partner
14 2 6

ok so I think this is just a misunderstanding on my part, but apparently I needed to go into the Admin UI and click 'request fulfillment' on my new order, and now it shows up. However, this doesn't seem to be stated in the documentation. I'm trying to automate all this... I don't ever want to click on an order unless there's an issue with it, so I'm guessing there must be some other API call I need to add into the flow here so that once my order gets placed, it automatically requests fulfillment from my new custom service?

 

Maybe I'm going about this all wrong. Basically, on my store, an order gets placed, which triggers a bunch of backend work to get done on the cloud (via the new order webhook). That all works fine, and about 5 minutes after a new order is submitted, the print files are ready and get sent to my vendor. My vendor sends me order updates via their own webhooks at some point in the next couple days, including one that includes tracking info once it ships. I want to be able to take that tracking info and automatically tack it onto the relevant line items of the relevant order and send a notification to the customer without any manual intervention needed. Seems like thats what this custom fulfillment app approach is supposed to let me do. So, what am I missing here?

Slokie
Shopify Partner
14 2 6

Update: Ok so for my use case, apparently a custom fulfillment service was overkill and unnecessary. I spent an embarrassing amount of time figuring this out / learning GraphQL / experimenting with every possible mutation example I could find. In the end, since all I needed to do was add shipping info to orders that I receive via my vendor's webhooks, I found that just using the create fulfillment  REST API endpoint worked with no issue and was so much easier to implement than anything with GraphQL (which never seemed to work correctly, even with following the examples). I didn't need to create a custom service... just needed to set the location to the id in the json package to what you find in the URL in your admin page for your company's home location, and you can tack in whatever shipping info you want to an order and have the notification sent to the customer. 

 

I wish Shopify's documentation on the different types of fulfillment services mentioned this upfront in a clearer way. If you're just looking to tack shipping info to orders, any of the fulfillment service solutions are just a huge time sink and waste of time when you can just get this done in a single simple REST API call.

vertalm
Shopify Partner
18 0 14

Exactly

I implemented all necessary functions via REST API because GraphQL doesn't work in such cases.

Sorry for delay 
Actually Im from Russia and i just work to make worldwide service, but now you know Shopify blocked my store.

Guys... Really... Im not a Putin. And they are block me. So i think Shopify team is a Putin for me, because they do the same. They are killed my business in a few second.