Void call in transactions API

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.

Hmm, I just tested in both sandbox and production and it worked for me. Did you try to void it right after the payment was created? If you retry it does it work? :slightly_smiling_face:

You mention trying this in the sandbox. The transactions API does not have a sandbox. So I’m guessing you tried this in the payments API. Which is not what I’m asking.

The Transactions API does work in sandbox for payments created with the Transactions V2 Charge endpoint. I then tested VoidTransaction with both production and sandbox. :slightly_smiling_face:

Ok. Sorry. I should have given more information then. Our transactions are created via the API to SquareReaderSDK. I didn’t realize that made a difference.

Creating the transaction via SquareReaderSDK and then trying the curl above returns the error specified above.

Ah, I see. Unfortunately delayed transactions can’t be voided with the VoidTransaction endpoint. Here is the link to our documentation. :slightly_smiling_face: