Add multiple fulfillments

Solved
Excursionist
20 2 6

Hello,

 

I am working at adding fulfillment to my shopify order, and I have it works to add a fulfillment per line item per request. I wonder if I can add multiple fulfilments per request using either Restful API or GraphQL. Please advice. I greatly appreciate it.

 

Thanks!

0 Likes
Shopify Staff
Shopify Staff
11 1 1

Using both GraphQL and REST Admin APIs you are able to create one fulfillment at a time per query / request. You are able to however fulfill more than one line item on an order with a single request given that these variants have the same location ID. See the REST Admin API example below:

 

POST /admin/api/2019-10/orders/#{order_id}/fulfillments.json
{
  "fulfillment": {
    "location_id": 905684977,
    "tracking_number": null,
    "line_items": [
      {
        "id": 466157049
      },
      {
        "id": 518995019
      },
      {
        "id": 703073504
      }
    ]
  }
}

https://help.shopify.com/en/api/reference/shipping-and-fulfillment/fulfillment#create-2019-10

 

Would you be able to provide some more details about your use case such that we can potentially offer more guidance?

 

Cheers

0 Likes
Highlighted
Excursionist
20 2 6

@sd_ wrote:

Using both GraphQL and REST Admin APIs you are able to create one fulfillment at a time per query / request. You are able to however fulfill more than one line item on an order with a single request given that these variants have the same location ID. See the REST Admin API example below:

 

POST /admin/api/2019-10/orders/#{order_id}/fulfillments.json
{
  "fulfillment": {
    "location_id": 905684977,
    "tracking_number": null,
    "line_items": [
      {
        "id": 466157049
      },
      {
        "id": 518995019
      },
      {
        "id": 703073504
      }
    ]
  }
}

https://help.shopify.com/en/api/reference/shipping-and-fulfillment/fulfillment#create-2019-10

 

Would you be able to provide some more details about your use case such that we can potentially offer more guidance?

 

Cheers


Thanks for your reply sd_!

Let say I have 100 orders , which make at least 100 line items. To create  fulfillments for all of those orders, I have to  loop through all orders and send requests (either REST Admin or GraphQL) to create fulfillments for those line items. Number of request is 100, which make the code run for a long time because there is a limit to send request to either APIs. What I want to achive is to send one request or a few requests to create fulfillments for those line items. Is it possible?

0 Likes

Success.

Shopify Staff
Shopify Staff
11 1 1

It is not possible to fulfill multiple orders with a single request. You must make a request per order that you are trying to fulfill.

1 Like