2

I'm using Square for processing payments, and trying to make a refund I'm getting the following response:

{"errors": [{"code": "INVALID_VALUE","detail": "Read-only field is calculated and cannot be set by a client.","field": "order.returns","category": "INVALID_REQUEST_ERROR"}]}

It seems that the field "order.returns" is being sent but it isn't, this is my request body:

{"amount_money":{"currency":"USD","amount":3000},"reason":"requested_by_customer","payment_id":"BwC...","idempotency_key":"083bba8fabb9df88cf50fa1c489db275"}

It's a POST request to this endpoint: https://connect.squareup.com/v2/refunds

Any idea of why I'm getting this error? It seems to be a kind of bug in Square, but I couldn't find any information about it on the internet.

ouflak
  • 2,458
  • 10
  • 44
  • 49

1 Answers1

0
 {"errors": 
   [{"code": "INSUFFICIENT_SCOPES","detail": "The merchant has not given your application sufficient permissions to do that. The merchant must authorize your application for the following scopes: 
    [PAYMENTS_READ]","category": "AUTHENTICATION_ERROR"
   }]
 }
ouflak
  • 2,458
  • 10
  • 44
  • 49
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 20 '21 at 12:41