cURL Code for Issuing Refunds

Hey Everyone,
I have SnipCart running smoothly on a food-ordering app. I’m wondering now about the code needed for issuing refunds, when necessary.

I see the cURL code listed at this page: https://docs.snipcart.com/v3/api-reference/refunds#post-orderstokenrefunds

But something does not seem correct about it:

curlhttps://app.snipcart.com/api/v1/orders/4243490d-87c1-480e-b413-51db0b419313/refunds \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -u {YOUR_API_KEY}: \
  -d "{ amount: 200.50,
        comment: 'Reason for refund'
      }"

I have a dashboard on my app where I call the API. To start a refund, I have an admin fill out a form with a “refund” and “comment” field. I want to use the POST info from that form in the cURL request.

Any help would be greatly appreciated!

Hi Matthew,
it seems a typo was introduced in the doc. Sorry about that, I’ll modify it. curl and the link should be separated :

curl https://app.snipcart.com/api/v1/orders/4243490d-87c1-480e-b413-51db0b419313/refunds \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -u {YOUR_API_KEY}: \
  -d "{ amount: 200.50,
        comment: 'Reason for refund'
      }"

Hi fxtardif,
Sorry, I missed your response!

Thank you for your help.

I’ll try to implement this soon, and check back here after that.

Thanks!