What's your biggest current challenge? Have your say in Community Polls along the right column.
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.

Unable to create fulfillment service

Solved

Unable to create fulfillment service

mlundqvi
Visitor
1 0 1

Hi, 

 

I am trying to create a new fulfillment service for an existing location using admin/api/2024-01/fulfillment_services.json REST end-point. 

 

The request body I use is: 

{
  "fulfillment_service": {
    "name": "<Name>",
    "admin_graphql_api_id":"gid://shopify/FulfillmentService/1",
    "inventory_management": false,
    "permits_sku_sharing": false,
    "fulfillment_orders_opt_in": false,
    "tracking_support": false,
    "format": "json",
    "location_id": "<Id>"
  }
}

 

I get no errors, but the response body simply says:

 

{
"fulfillment_services": []
}

Any advice?

 

Thank you

Accepted Solution (1)

Soroosh
Shopify Staff
7 2 2

This is an accepted solution.

Hi @mlundqvi ,

Based on the response you received `fulfillment_services` sounds like that you are sending a GET request rather than a POST. So I would suggest to review the code and make sure that it's actually sending a POST request.

Also please refer to this document for the necessary fields that needs to be sent. Dields like `id` or `location_id` are not permitted as input when creating a fulfillment service.

View solution in original post

Replies 5 (5)

Michael841
Shopify Partner
10 2 0

Hi, could you resolve the issue? I have the same problem. Neither via REST nor via GraphQL I can create a fulfillment service.

 

All the best,

Michael

Soroosh
Shopify Staff
7 2 2

Hi @Michael841 , please refer to this reply for more information.
In case you still have the problem, can you please create a new post with example for the sent request and response received from the API?

Best,

Michael841
Shopify Partner
10 2 0

Hi @Soroosh,

 

thank you for your reply.

I am doing a POST:

 

POST: https://shop.myshopify.com/admin/api/2024-01/fulfillment_services.json

 

 

{
    "callback_url": "https://myservice.com/callback",
    "format": "json",
    "inventory_management": false,
    "name": "my_name",
    "tracking_support": true
}

 

 
Response:
 

 

{
    "fulfillment_services": []
}

 

 
When posting via GraphQL https://shop.myshopify.com/admin/api/2024-10/graphql.json:

 

 

mutation fulfillmentServiceCreate($name: String!, $callbackUrl: URL!) {
  fulfillmentServiceCreate(name: $name, callbackUrl: $callbackUrl) {
    fulfillmentService {
      id
      serviceName
      callbackUrl
    }
    userErrors {
      field
      message
    }
  }
}

 

and setting the variables name and callbackUrl accordingly, I get the following response:

 

 

{
    "errors": "Not Found"
}

 

 

This is strange, as I did this with other shops without any problems before.

My App hast write access to all fulfillment-related values, also.

Soroosh
Shopify Staff
7 2 2

I tested it on one of my test stores, and it worked perfectly. Given the error message you received ("errors": "Not Found"), I recommend reviewing your setup again. This error suggests that the request did not reach the correct endpoint. If the issue persists, please contact the Shopify support team. And please provide them with additional details such as request_id and shop_id so they can assist you in resolving the problem.

Soroosh
Shopify Staff
7 2 2

This is an accepted solution.

Hi @mlundqvi ,

Based on the response you received `fulfillment_services` sounds like that you are sending a GET request rather than a POST. So I would suggest to review the code and make sure that it's actually sending a POST request.

Also please refer to this document for the necessary fields that needs to be sent. Dields like `id` or `location_id` are not permitted as input when creating a fulfillment service.