question

kumarauriss avatar image
kumarauriss asked David Marginian Deactivated commented

Clover REST API - How to create a line item Refund for an existing Order?

Hello Team,

I have created an order with the following Curl (Removed my MerchantID & Access Token for security purpose), The order created successfully (orders/YQTPPATMCNBTM", "id": "YQTPPATMCNBTM", "currency": "USD"). Now I am trying to refund this order couldn't find the API for this.

Refund
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

You will need to use our EComm API - https://docs.clover.com/docs/ecommerce-refunding-payments.

4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kumarauriss avatar image kumarauriss commented ·

We are able to create an order using ecommerce API, however "Pay for an order" error showing "{"message":"401 Unauthorized"}". I am using the same oAuth token used for "Create an Order" . Please help

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ kumarauriss commented ·

Your token needs to have the correct permissions, all of the permissions required for the EComm APIs are outlined in our documentation - https://docs.clover.com/docs/ecommerce-app-permissions.. If you need to update the permissions on your app you will first need to change the permissions, then you will need to uninstall the app, reinstall it, and then obtain a new access token, instructions here - https://community.clover.com/articles/23744/resolving-401-unauthorized-responses-when-making-a.html.

0 Likes 0 ·
kumarauriss avatar image kumarauriss David Marginian ♦♦ commented ·

Thanks for your update.

Now we are getting the error "Either payment instrument or customer has to be present" below is our curl request.

curl --request POST \

> --url https://scl-sandbox.dev.clover.com/v1/orders/MRR1GNGW7Q3PW/pay \

> --header 'Accept: application/json' \

> --header 'Authorization: Bearer 103e6dc9-e9c8-19e4-908b-0e821027e33a' \

> --header 'Content-Type: application/json' \

> --data '

> {

> "ecomind": "ecom",

> "tender": {

> "label_key": "com.clover.tender.cash"

> },

> "customer": "1HA5E4SSGS15P",

> "email": "saravanakumar.s@auriss.com"

> }

> '

{"message":"400 Bad Request","error":{"type":"invalid_request_error","code":"invalid_request","message":"Either payment instrument or customer has to be present"}}

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community