API Close fulfillment orders error

chaebe
New Member
2 0 3

Hello,

I handled the partial shipment for specific order.
The remaining items are out of stock.
I just want the item that needs to be closed on the order status screen that the customer sees to come out of stock rather than preparing for shipment.
So I tried to implement it through fulfillment close, but an error occurred.

When I try close partial fulfillment order via API, I'm getting error below.

The fulfillment order's assigned fulfillment service must be of api type
Please advise.
 
Thank you.
 
image.png
 
image.png
 
 
 
chaebe
New Member
2 0 3

Update:

I add Origin request header.

After then, I've got another error.

Here’s my curl code:

var client = new RestClient("https://{key}:{password}@shopblupepper.myshopify.com/admin/api/2020-04/fulfillment_orders/{fulfillment_order_id}/close.json");

client.Timeout = -1;

var request = new RestRequest(Method.POST);

request.AddHeader("Origin", "{myshopify}.myshopify.com");

request.AddHeader("Content-Type", "application/json");

request.AddHeader("Cookie", "__cfduid=d5177661e869b0f8b06088f8f85efaa1f1592420960");

request.AddParameter("application/json", "{\r\n  \"fulfillment_order\": {\r\n    \"message\": \"Not enough inventory to complete this work.\"\r\n  }\r\n}",  ParameterType.RequestBody);

IRestResponse response = client.Execute(request);

 

Error message:

{

    "errors": [

        "The fulfillment order's assigned fulfillment service must be of api type"

    ]

}

 

Please advise.