Unable to refund amount for items removed using order editing API

Shopify Partner
7 1 1

I have removed one line item using order edit API. Now I'm trying to refund that amount using refund API. But the calculate refund API doesn't allow to me to specify the quantity as 1
If I do it throws me the error

{ "errors": { "refund_line_items.quantity": [ "cannot refund more items than were purchased" ] } }
    "refund": {
        "shipping": {
            "full_refund": true
        "refund_line_items": [
                "line_item_id": 1234,
                "restock_type": "cancel",
                "quantity": 1
any thoughts on what might be happening here?
  1. Does refund API also tries to remove the item from the order? so it can only work on existing items in the order?
  2. If that is the case is there a way to refund the amount removed using order edit API?
Developer, Indie hacker, Twitter: @approxhuman
Replies 0 (0)