Refund line items cannot remove more than the fulfillable quantity.

Solved
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-----
            }
        ]
    }
1 Like
Highlighted
Shopify Staff
Shopify Staff
625 84 89

Hey @Mobeen_Ali,

 

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

0 Likes
Highlighted

Success.

New Member
2 1 1

Thanks for reaching out @scottydont . 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