---
title: "Void a transaction"
method: POST
path: "/transactions/{transaction_token}/void"
tags: ["void"]
---

# Void a transaction

`POST /transactions/{transaction_token}/void`

Cancel an `authorization` transaction or a `capture`/`purchase` transaction that hasn’t yet settled at the merchant account.

This API call can also be used to cancel a `verify` transaction that was part of the Ebanx customer enrollment process. To learn more about this visit [Ebanx Gateway](https://developer.spreedly.com/docs/ebanx-gateway-guide).

## Path parameters

- `transaction_token` string, required

## Response `200`

OK

- VoidResponse
  - `transaction` object
    - `on_test_gateway` string — `true` if the transaction took place on a test gateway
    - `created_at` string — The time the purchase token was created
    - `updated_at` string — The time the purchase token was last updated
    - `succeeded` boolean — `true` if the transaction request was successfully executed, `false` otherwise
    - `state` string — The current state of the transaction
    - `token` string — The token uniquely identifying this transaction at Spreedly
    - `transaction_type` string — The type of transaction, e.g., Authorization, Capture, Credit
    - `order_id` string — The merchant specified order id. If not provided, the Spreedly transaction token will be used.
    - `ip` string — The IP address of the end-user customer. If one is not provided, this will default to `127.0.0.1`. To actually send a `nil` value, this parameter must be set to "omit".
    - `description` string — A human readable description of the transaction which will be passed to the gateway if it's supported
    - `email` string — Override the customer email address associated with the payment method for this transaction
    - `merchant_name_descriptor` string — A human readable description of the merchant
    - `merchant_location_descriptor` string — A human readable description of the merchant location
    - `gateway_specific_fields` object — The list of gateway specific fields that can be specified in supported gateway transactions
    - `gateway_specific_response_fields` object — A hash containing unique optional fields that a gateway may return based on certain customized options.
    - `gateway_transaction_id` string — The id of the transaction *at the gateway*. To be used when corresponding with the gateway or reconciling transactions
    - `gateway_latency_ms` string — The time it took the gateway to respond to Spreedly
    - `message_key` string — A machine-parseable string indicating the result of the transaction
    - `message` string — A human-readable string indicating the result of the transaction
    - `gateway_token` string — The token of the gateway to executed against
    - `gateway_type` string — The type (short name) of the gateway
    - `response` object — Unmodified details of the gateway response, including the `message` and `error_code`, if applicable. For failed transactions these fields can help determine the root cause
    - `shipping_address` object — Override the customer shipping address associated with the payment method for this transaction
    - `reference_token` object — The token of the transaction being voided

## Other responses

- `401` — Unauthorized
- `404` — Not Found
- `422` — Unprocessable Entity

---

[API](https://skmtc.dev/spreedly/apis/spreedly-api-v1.md) · [All operations](https://skmtc.dev/spreedly/apis/spreedly-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/spreedly/spreedly-api-v1/revisions/72ba4e23e65c/schema)
