Refund line items cannot remove more than the fulfillable quantity.

Solved
Highlighted
New Member
2 1 1

I'm cancelling an order using shopify cancel order API "admin/orders/{id}/cancel.json" and in response i receive this error "Refund line items cannot remove more than the fulfillable quantity". Can someone please elaborate what i'm doing wrong. As I've mentioned only two line_items in my API body request. 
Order financial_status is pending and fulfillment_status is fulfilled. Order have two line_items and they are fulfilled.

API Body:

"refund": {
        "shipping": {
            "full_refund": true
        },
        "refund_line_items": [
            {
            "line_item_id":4490571-----,
            "quantity":1,
            "restock_type":"cancel",
            "location_id":3254-----
            },
            {
            "line_item_id":449057-----,
            "quantity":1,
            "restock_type":"cancel",
            "location_id":3254-----
            }
        ]
    }
Highlighted
Shopify Staff
Shopify Staff
1041 140 170

Hey @Mobeen_Ali,

 

Can you please provide a request ID from the response headers?

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes
Highlighted
New Member
2 1 1

This is an accepted solution.

Thanks for reaching out @SBD_ . I've figured it out by replacing restock_type value "cancel" to "return". It worked.
And yes i've a request to please elaborate the RETURNED error so developer can understand what he/she is doing wrong. 

0 Likes
Highlighted
New Member
1 0 0

Where do we get the "refund_line_items - > line_item_id" is not same as Product and variant Ids ?

0 Likes