Send Fulfillment Request 422

Hello everyone,

When I create an order from the “create an order” endpoint. The order gets created successfully.
Then I get the fulfilment id for that order and call the “Send a fulfilment request” endpoint. The error I get there is confusing me since I am new to Shopify endpoints. I am attaching the body for the request for both endpoints. It will be great if someone can help me understand why I get this error.

Create an Order

**[https://gf-store-for-test.myshopify.com/admin/api/2022-04/fulfillments.json](https://gf-store-for-test.myshopify.com/admin/api/2023-01/fulfillments.json)**
{
    "order": {
      "currency": "PKR",
      "line_items": [
        {
          "quantity": 23,
          "title": "Some Title",
          "grams": "100",
          "fulfillment_service": "My New Fulfillment Service",
          "price": 50
        }
      ]
    }
  }

Send a Fulfillment Request

**[https://gf-store-for-test.myshopify.com/admin/api/2022-04/orders/{{fullfilmentorderid}}/fulfillment_orders.json](https://gf-store-for-test.myshopify.com/admin/api/2022-04/orders/5267156304186/fulfillment_orders.json)**
{
    "fulfillment_request": {
        "message": "some message"
    }
}

The error I get is “The fulfillment order’s assigned fulfillment service must be of api type”. Not sure what it means by this.
Help is appreciated. :smiley:

1 Like

That means your fulfillment is assigned to a shop location, likely the default location. Your order needs to contain line items stocked at a fulfillment service location in order to request a fulfillment from a fulfillment service.

If that does not make sense because you are not using a fulfillment service, then you do not need to request fulfillment. You just want to create a fulfillment for the fulfillment order.

Thank you for the response brother,
When I create the line item I add a line item present at a fulfilment service. But even then I get the issue. I am going to attach the body to that request here as well.

{
    "order": {
         "email": "norman@mail.com",
        "line_items": [
            {
                "fulfillment_service": "zach",
                "fulfillment_status": "partial",
                "fulfillable_quantity": 1,
                "product_id": 8168788197690,
                "variant_id": 44610974613818,
                "quantity": 1
                
            }
        ],
        "currency": "USD"
    }
}
1 Like

You cannot set the fulfillment service or status via the API this way. The API just ignored the parameters.

The Zach location is a Custom Fulfillment Service, it is not an app location. That is why you got the error message. Does your shop require fulfillment via a custom fulfillment service email?

2 Likes