简体   繁体   中英

Why am i receiving "Read-only field is calculated and cannot be set by a client. (order.returns)" from Square? (I'm not sending that field)

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. Any help is appreciated.

{"errors": [{"code": "INSUFFICIENT_SCOPES","detail": "商家没有授予您的应用足够的权限来执行此操作。商家必须为以下范围授权您的应用:[PAYMENTS_READ]"," category": "AUTHENTICATION_ERROR"}]}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM