'fulfillable_quantity' didn't change after refunding the line_item

lisiming
New Member
9 0 0

Hi, Shopify devs,

After I create a refund with the line_item, the fulfillable_quantity of line_item didn't change to 0 and the line_item wasn't removed in Admin 

There is my request.

{
    "refund":{
        "currency":"EUR",
        "note":"",
        "notify":true,
        "refund_line_items":[
            {
                "line_item_id":"10188079136955",
                "quantity":3,
                "restock_type":"no_restock"
            }
        ],
        "shipping":{
            "full_refund":true
        },
        "transactions":[
            {
                "amount":21.36,
                "currency":"EUR",
                "gateway":"gift_card",
                "kind":"refund",
                "order_id":"3951296970939",
                "parent_id":"4905726017723"
            }
        ]
    }
}

 

Thanks!!!

0 Likes
garyrgilbert
Explorer
55 6 13

Hi,

 

this is your problem:

 

 "restock_type":"no_restock"

 

This tells shopify not to re-add the returned item to the availble stock.

You need to change this to refund in order to get the item to be added to the available stock 

from the docs:

  • restock_type: How this refund line item affects inventory levels. Valid values:
    • no_restock: Refunding these items won't affect inventory. The number of fulfillable units for this line item will remain unchanged. For example, a refund payment can be issued but no items will be returned or made available for sale again.
    • cancel: The items have not yet been fulfilled. The canceled quantity will be added back to the available count. The number of fulfillable units for this line item will decrease.
    • return: The items were already delivered, and will be returned to the merchant. The returned quantity will be added back to the available count. The number of fulfillable units for this line item will remain unchanged.
    • legacy_restock: The deprecated restock property was used for this refund. These items were made available for sale again. This value is not accepted when creating new refunds.

You also need to make sure you include the location_id if you set the restock_type to return or it probably won't be able to correctly return the item.

 

Cheers

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
0 Likes
lisiming
New Member
9 0 0

Thank you for your reply. But the restock_type was no_restock and the line_item was removed after I cancelled the order and didn't tick the 'Restock items' via Admin not the API. Why it's different from the API?

admin.png

0 Likes