Refund error

Solved
Highlighted
New Member
1 0 0

Hi!

I´m trying to create a refund using the Admin API but for some reason it is not working. I´ve tried the "Get" section and they work but the "Post" version don´t. Can anyone tell me why this is happening? I am authenticated so I don´t think that is the problem.

 

My Request (Post) https://testshopno1337.myshopify.com/admin/api/2020-04/orders/2250065444999/refunds.json

 

Body:

{
"refund": {
"currency": "SEK",
"notify": true,
"note": "wrong size",
"shipping": {
"full_refund": true
},
"refund_line_items": [
{
"line_item_id": 4994696478855,
"quantity": 1,
"restock_type": "return",
"location_id": 45098926215
}
],
"transactions": [
{

"amount": 2,
"kind": "refund",
"gateway": "bogus"
}
]
}
}

My Response:

<html>
<body>
  <noscript>
    <a
  </noscript>

  <script type="text/javascript">
    window.location = "https:\/\/app.shopify.com\/services\/login\/identity?destination_uuid=77d283b7-2d74-4dfe-b273-508a4e964794\u0026prompt=merge\u0026return_to=https%3A%2F%2Fapp.shopify.com%2Fservices%2Flogin%2Fidentity_callback%3Ffrom_signup%3Dfalse%26locale%3Den%26shop_name%3Dtestshopno1337%26state%3Dvw2y6z9yLnDu99Vy_k7r_4CUSYUSaqN65gWiyctJq_Rje-yhTdjVaxTP69dB0JBd0BuShABrOdZMGu9y-W0GxtlL9pCrSVLCc18L14myJTp-KWUrQ0qTD8Q84BS-Bm8nNUkVp3ZXeLBqXTXrWj3DNN9y4rKHo1R0BUjBY_Fd68BqepXl3KhSTboMT-dTBqyXZAKSsUNsrdkzc2jZTrTcabzaSV6fXMldv4vo6SoexryTEzr0I6NC3LMvi4-54xhH\u0026ui_locales=en\u0026ux=shop";
  </script>
</body>
0 Likes
Highlighted
Shopify Staff
Shopify Staff
587 72 129

This is an accepted solution.

Hey @Rasmus1,

 

An HTML response usually means cookies were sent with your request. If you're using an HTTP client like Postman or Insomnia, make sure to delete all stored cookies before sending your request.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes