Get 400 When create new fulfillments

Highlighted
Tourist
9 0 1

Hi,

I'm trying to create new fulfillment with the API

Request id is as below.

'x-request-id': [ '446b61ba-2c4f-4bab-b49f-2e621bbebbe2' ]

  const endpoint = `${storePrefix[store]}2020-04/orders/${id}/fulfillments.json`;
      const body = JSON.stringify({
        fulfillment: {
          location_id: null,
          line_items: [matchedLineItem],
          tracking_number: trackingNumber,
          tracking_company: trackingCompany,
        },
      });
      // console.log(body);
      const createNewFulfillment = await fetch(endpoint, {
        headers,
        body,
        method: 'POST',
      });

My code is as above.

I expected new fulfillment of the corresponding order and line item will be created but 
the response I got was with 400 code

Could any of the shopify staff help me on this or anyone has any solution.

 

Thanks a lot.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
491 97 88

Hi @hoangfuongduy 

 

You will need to pass a location ID. Here is more information on fulfillments: https://shopify.dev/tutorials/manage-fulfillments-with-fulfillment-and-fulfillmentorder-resources

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes