Error 500 when creating Fulfillment via Rest API

bernhard1
Shopify Partner
2 0 0

Hello,

 

I tried now to migrate to the new API Version from 10-2020. Therefore, of course, I have to change the creation of order fulfillments.

 

In short, i would like to add a tracking URL to my order, through the fulfillment API.

 

Fetching fulfillment Orders from the Shopify Order with the corresponding order_id:

GET:/admin/api/2023-07/orders/[order_id]/fulfillment_orders.json

 

Response:

{
	"fulfillment_orders": [
		{
			"id": 674xxxxx933,
			"shop_id": 15xxxxxxxx47,
			"order_id": 57xxxxxxxx89,
			"assigned_location_id": 63xxxxxx99,
			"request_status": "unsubmitted",
			"status": "open",
			"supported_actions": [
				"create_fulfillment",
				"move",
				"hold"
			],
			"destination": {
				...
			},
			"line_items": [
				...
			],
			"fulfill_at": "2023-08-18T15:00:00+02:00",
			"fulfill_by": null,
			"international_duties": null,
			"fulfillment_holds": [],
			"delivery_method": {
				"id": 747xxxx117,
				"method_type": "shipping",
				"min_delivery_date_time": null,
				"max_delivery_date_time": null
			},
			"created_at": "2023-08-18T15:00:16+02:00",
			"updated_at": "2023-08-18T15:00:16+02:00",
			"assigned_location": {
				...
			},
			"merchant_requests": []
		}
	]
}

Now im using the ID 674xxxxx933 from the fulfillment_order to create the fulfillment:

POST:/admin/api/2023-07/fulfillments.json

Body:

{
	"fulfillment": [
		{
			"message": "test message",
			"notify_customer": false,
			"tracking_info": {
				"number": 10xxxxxxxx60,
				"url": "some-valid-url",
				"company": "some company"
			},
			"location_id": 6348406899,
			"line_items_by_fulfillment_order": [
				{
					"fulfillment_order_id": 674xxxxx933
				}
			]
		}
	]
}

 

That last POST Request results in an 500-Error: Internal Server Error

 

Any help on why that might be???

 

Best,

Bernhard

 

 

 

Replies 0 (0)