Trying to POST refund using reunds endpoint

Highlighted
New Member
1 0 0

Hello,

I'm trying to post refund through postman using /admin/orders/{order_id}/refunds.json, when hit send I'm receiving status 200 OK but when I see on the Admin page, I couldn't be able to find refund happens. Please, anyone, have the same issue please help needed. 

Body:

{
    "refund": {
        "currency": "USD",
        "notify": true,
        "note": "OOS",
        "shipping": {
            "full_refund": true
        },
        "refund_line_items": [
            {
                "line_item_id": 1782004416582,
                "quantity": 1,
                "restock_type": "no_restock"
            }
        ]
    }

Tried above message format using "/admin/orders/{order_id}/refunds/calculate.json" but no luck and receiving source code of login page

and then tried in different way:

{
    "refund": {
        "notify": true,
        "shipping": {
            "full_refund": true
        },
        "refund_line_items": [
            {
                "line_item_id": 1774603829318,
                "quantity": 1,
                "restock_type": "return"
            }
        ],
        "transactions": [
            {
                "parent_id": 991334629446,
                "amount": "6.99",
                "kind": "refund"
            }
        ]
    }
}

endpoint: /admin/orders/{order_id}/refunds.json

Thanks

0 Likes
Shopify Partner
918 17 159

Hi Harish,

Your refund_line_items.restock_type is return which requires you also provide location_id.

Best wishes

I turn coffee in to code - since 1998
0 Likes