question

flevour avatar image
flevour asked flevour commented

Failure while trying to refund a charge

We are encountering this error while trying to refund a charge that we just created via the same API token.

Our app is configured as indicated in the docs with all permissions to read and online payments as indicated in here https://docs.clover.com/docs/ecommerce-app-permissions#refund-endpoints

We are able to GET the charge via /v3/merchants/DYFNMT5WHVJX1/payments/E75Y2JS8C2KSC but still can't refund.


POST https://scl-sandbox.dev.clover.com/v1/refunds HTTP/1
Authorization: Bearer ***REDACTED***
Content-Type: application/json
accept-encoding: gzip, deflate
content-length: 129

{
  "charge": "R7137E8NV210J",
  "amount": 123,
  "reason": "requested_by_customer",
  "external_reference_id": "ABCDE"
}


HTTP/1.1 403 Forbidden
cache-control: no-cache, no-store, must-revalidate
pragma: no-cache
expires: Tue, 17 Sep 1991 10:00:00 PST
X-Clover-Request-Id: f9f5b4e0-d4e8-a1fa-5339-813259f90db1
X-Frame-Options: deny
Referrer-Policy: no-referrer
Strict-Transport-Security: 31536000
X-Content-Type-Options: nosniff
X-Robots-Tag: none
content-length: 118
content-type: application/json; charset=utf-8
Date: Mon, 18 Jan 2021 14:19:15 GMT
Via: 1.1 google
Alt-Svc: clear
Connection: close

{
  "message": "403 Forbidden",
  "error": {
    "code": "processing_error",
    "message": "Invalid permissions for expandable fields."
  }
}


How should we go about 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 flevour commented

Have you changed the permissions on your app after you installed it? If so the app needs to be uninstalled/reinstalled. Instructions on doing that here - https://community.clover.com/articles/23744/resolving-401-unauthorized-responses-when-making-a.html.

1 comment
10 |2000

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

flevour avatar image flevour commented ·

That was fast and spot on! Thanks Davis!

0 Likes 0 ·

Welcome to the
Clover Developer Community