about fulfillment complete api error

kaipengliu
New Member
13 0 0

hey, guys

 

When I request the fulfillment api from the following URL to complete a fulfillment。 Always get this response : '"errors": "An error occurred, please try again"'

Is there a problem with this interface or is it deprecated? 

 

following  is fulfillment api website and fulfillment api :

'https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillment#complete-2021...'

/admin/api/2021-04/orders/{order_id}/fulfillments/{fulfillment_id}/complete.json

 

Hope to get help, thanks

 

0 Likes
rexb
Excursionist
19 0 0

Make sure you have the correct data and you have the location_id correct.

This is working for me:

 

$fulfillments = (new Shopify())->request('orders/1234/fulfillments.json',[
	    	'fulfillment' => [
		    	'line_items' => [
		    		[
                                       'id' => '1234'
                                ]
		    	],
		    	'location_id' =>  1234,
		    	'tracking_number' => '',
		        'tracking_urls' => [
		            ""
		        ],
		        'notify_customer' => true,
                'tracking_company' => ''
                
	    	]
	    ], 'POST');

 

 

0 Likes
kaipengliu
New Member
13 0 0

are you sure you did using the api about ‘POST /admin/api/2021-04/orders/{order_id}/fulfillments/{fulfillment_id}/complete.json

maybe the way we use for  complete for fulfillment  diffrent . 

I am still confused

0 Likes
CalD
Shopify Staff
Shopify Staff
129 15 19

Hey @kaipengliu,

Check out this similar thread here: https://community.shopify.com/c/Shopify-APIs-SDKs/Complete-Fulfillment-Question/m-p/544922

The complete endpoint on fulfillments is used to move a pending fulfillment, one that is awaiting fulfillment from an external fulfillment service, to completed status.

If you're still having issues completing a pending fulfillment via the API, send over an example x-request-id from the response headers of the request that you're making and we can help further.

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes