Either the API documentation for transactions/void is incorrect or the call is. The void call documentation here says the void retirement is TBD. However void doesn’t seem to be working.
Running this call
curl https://connect.squareup.com/v2/locations/XXXXXXXXXX/transactions?begin_time=2023-02-03T00%3A00%3A00Z \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxx' \
-H 'Content-Type: application/json'
.
.
Results in output that includes this section:
{
"id": "4h1sKSWtkiQsQDOhXRsdxAmeV",
"location_id": "XXXXXXXXXXX",
"created_at": "2023-02-03T21:25:28Z",
"tenders": [
{
"id": "3NPjOjsalyDzLPZG6yCSzv1bvaB",
"location_id": "XXXXXXXXXX",
"transaction_id": "4h1sKSWtkiQsQDOhXRsdxAmeV",
"created_at": "2023-02-03T21:25:25Z",
"amount_money": {
"amount": 218,
"currency": "USD"
},
"processing_fee_money": {
"amount": 0,
"currency": "USD"
},
"type": "CARD",
"card_details": {
"status": "AUTHORIZED",
"card": {
"card_brand": "MASTERCARD",
"last_4": "XXXX",
"fingerprint": "sq-1-ZqUARqyyihEOa4vbAUSNy6AWisGsdOgns4_ccdy-JvZXh2PtJKGd_yBHh5mOvoiFbQ"
},
"entry_method": "EMV"
}
}
],
"product": "REGISTER",
"client_id": "E4B155B8-BE61-4744-B374-6A0FCD5F03B3"
},
.
.
But when I do this call afterward
curl https://connect.squareup.com/v2/locations/XXXXXXXXXX/transactions/4h1sKSWtkiQsQDOhXRsdxAmeV/void \
> -X POST \
> -H 'Square-Version: 2023-01-19' \
> -H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxx' \
> -H 'Content-Type: application/json'
.
.
I get this response
{"errors":[{"category":"INVALID_REQUEST_ERROR","code":"NOT_FOUND","detail":"Location `XXXXXXXXXX` does not have a transaction with ID `4h1sKSWtkiQsQDOhXRsdxAmeV`.","field":"transaction_id"}]}{
.
.
So which is incorrect? We’d love it if this call would work correctly.