fulfillments using API Question

When I send the fulfillments API without entering the tracking_info field and then send the same api again after entering the tracking_info field
It says, “Fulfillment order 6097444962362 has an unfulfillable status= closed.” How can I send tracking_info?

first send

RestAPI : https://d838a7-2.myshopify.com/admin/api/2023-07/fulfillments.json

{
	"fulfillment": {
		"line_items_by_fulfillment_order": [
			{
				"fulfillment_order_id": 6097444962362
			}
		]
	}
}

second send

RestAPI : https://d838a7-2.myshopify.com/admin/api/2023-07/fulfillments.json

{
	"fulfillment": {
		"line_items_by_fulfillment_order": [
			{
				"fulfillment_order_id": 6097444962362
			}
		],
		"tracking_info": {
			"number": "MS1562678",
			"url": "https://www.my-shipping-company.com?tracking_number=MS1562678"
		}
	}
}

response

{
    "errors": [
        "Fulfillment order 6097444962362 has an unfulfillable status= closed."
    ]
}

Hi Weap0n7,

If you have already created a fulfillment but omitted the tracking information, you should update the existing fulfillment instead of trying to create a new one. This can be done by using the Fulfillment API, there’s an example here.

If your workflow requires adding tracking information at a later stage, consider changing how you handle the initial fulfillment creation to avoid closing the fulfillment order. This might involve specifying only a subset of items to fulfill in the first API call, leaving the fulfillment order open.

Hope this helps,

Hi @weap0n7

You are using the API incorrectly. After creation, you should use the API to update the status, but you used the API to create fulfillment again, leading to an error. Check the endpoint: https://shopify.dev/docs/api/admin-rest/2023-10/resources/fulfillment#post-fulfillments-fulfillment-id-update-tracking