ShopifyAPI Refund - getting error: StatusCodeError: 422 - {"errors":{"refund_line_items.line_item":[

New Member
3 0 0

I'm trying to create a refund using Shopify API with the details in the documentation here: and this is the payload I'm sending:

{ refund: { currency: 'GBP',
notify: false,
  [ { line_item_id: '<line-item-id>',
   quantity: 1,
   restock_type: 'no_restock' } ] } }

But I get this error:

StatusCodeError: 422 - {"errors":{"refund_line_items.line_item":["can't be blank"]}}

But refund_line_items.line_item is not mentioned in the documentation. I have checked and the line_item_id is correct (is the ID of the variation ID, not the product ID, but I have tried using SKU and product ID, same result)

Any suggestions would be much appreciated. Thanks!