Refund calculator api returns error "Required parameter missing or invalid"

Solved
leadstar116
New Member
4 0 0

Hello,

 

I am going to refund full order amount.

So i wanted to get total amount by calling Refund->calculator api.

Here's the parameter that i used.

"currency" => "USD",
 "shipping" => [
     "full_refund" => true
 ]

But this returns "refund - Required parameter missing or invalid".
What should be included in parameters?

 

Thanks

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 194

This is an accepted solution.

Hey there, 

 

Try something like this : 

 

{
  "refund": {
    "currency": "USD",
    "shipping": {
      "full_refund": true
    }
  }
} 

This is working for me, so I believe it's just the 'refund' portion of the request body that was missing. 

0 Likes
leadstar116
New Member
4 0 0

Yes, it works.

I have one more question.

I got calculated data and tried to use that for creating a refund.

But i get this error. "base - either refund line items or transactions must be present".

"refund" => [
        "currency" => "USD",
        "shipping" => [
               "full_refund" => true
         ],
         "refund_line_items" => $line_items,
         "transactions" => $transactions,         
]
$line_items are same as when I post calculate api.
and $transactions are the result from calculate api.
0 Likes
akashtilva
Tourist
3 1 0

i also have same issue but, even with proper data it is not working

https://community.shopify.com/c/Shopify-APIs-SDKs/API-orders-refunds-calculate-json-quot-errors-quot...

 

can you help me plz.

0 Likes