Refund API with discount getting Transaction cannot be refunded

Highlighted
New Member
2 0 2

Hello! I'm a little bit frustrated after receiving such an error back from Refund API

Details:

First of all my json body:

 

 

{
  "refund": {
    "currency": "EUR",
    "shipping": {
      "full_refund": true
    },
    "duties": [],
    "refund_line_items": [
      {
        "quantity": 1,
        "line_item_id": 6173409443993,
        "location_id": 47686615193,
        "restock_type": "return"
      },
      {
        "quantity": 1,
        "line_item_id": 6173411279001,
        "location_id": 47686615193,
        "restock_type": "return"
      }
    ],
    "transactions": [
      {
        "kind": "refund",
        "gateway": "manual",
        "parent_id": 3491560751257,
        "amount": "97.67"
      }
    ],
    "order_adjustments": [],
    "notify": true
  }
}
​

 

 

 
I'm trying to refund 2 positions:
1) Preis 54,95 without discount
2) Preis 54,95 with a discount of 15 % = 46,71
Minus return tax of 3,99
 
I'm getting the total refund amount of (54,95 + 54,95 - 8,24 - 3,99) = 97,96
 
But getting error without any detailed description back: Transaction cannot be refunded
 
I have no clue what am I doing wrong.
 
I've also tried to calculate a refund amount with calculate API, but I'm getting the same suggested amount back (of course without return tax of 3,99) = 101,66
here is the response:
 

 

 

{
    "refund": {
        "shipping": {
            "amount": "0.00",
            "tax": "0.00",
            "maximum_refundable": "0.00"
        },
        "duties": [],
        "total_duties_set": {
            "shop_money": {
                "amount": "0.00",
                "currency_code": "EUR"
            },
            "presentment_money": {
                "amount": "0.00",
                "currency_code": "EUR"
            }
        },
        "refund_line_items": [
            {
                "quantity": 1,
                "line_item_id": 6173409443993,
                "location_id": 47686615193,
                "restock_type": "return",
                "price": "54.95",
                "subtotal": "54.95",
                "total_tax": "7.58",
                "discounted_price": "54.95",
                "discounted_total_price": "109.90",
                "total_cart_discount_amount": "0.00"
            },
            {
                "quantity": 1,
                "line_item_id": 6173411279001,
                "location_id": 47686615193,
                "restock_type": "return",
                "price": "54.95",
                "subtotal": "46.71",
                "total_tax": "6.45",
                "discounted_price": "46.71",
                "discounted_total_price": "93.42",
                "total_cart_discount_amount": "0.00"
            }
        ],
        "transactions": [
            {
                "order_id": 2851954720921,
                "kind": "suggested_refund",
                "gateway": "manual",
                "parent_id": 3491562455193,
                "amount": "101.66",
                "currency": "EUR",
                "maximum_refundable": "203.32"
            }
        ],
        "currency": "EUR"
    }

 

 

 
 
Does anybody have had the same issue with it or knows if i do any mistake?
Please help!
 
Thank you!
 
0 Likes