---
updatedAt: 2025-09-30T15:27:43.000Z
agentTools:
  projectIndex: https://docs.nexiopay.com/llms.txt
---

# Void a transaction

Allows you to void a credit card, debit card, or echeck transaction using the Nexio Payment ID. In order to void a transaction, it must have been authorized but not yet settled.

The entire process for voiding a transaction is as follows: 
1. A transaction using the [Run card transaction](ref:runcardtransaction) or [Run echeck transaction](ref:runechecktransaction) endpoint occurs.
2. Retrieve the `id` from the response. This is the Nexio Payment ID.
3. Include that `id` in the body of your request for this endpoint in order to void the transaction.

If you do not know the `paymentId`, you can get an array of possible transactions that have authorized but are not yet settled with the [View transactions](ref:viewtransactions) endpoint and at least the following query filters:<br/>`transactionStatus=10`<br/>`plugin=`

<!-- theme: warning -->
> ⚠️ Try It
> 
> To use the Try It feature for this endpoint, you can use the credentials for your [Sandbox API user](doc:sandbox-environments).<br/><br/>You can also use the following test account. Copy the value and paste it into the appropriate space in the Try It section to the right.
> username: `docs@nexiopay.com`
> password: `JZdzoXpdDeH6VA`<br/><br/>Include the ID as indicated above.

<div style="display:none;">

## Request parameters
- id

## Response parameters
- id
- merchantId
- transactionDate
- authCode
- transactionStatus
- transactionType
- currency
- message
- data
- data.currency
- data.settlementCurrency
- gatewayResponse
- gatewayResponse.gatewayName
- gatewayResponse.refNumber

</div>

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Payments API Reference",
    "version": "3.0.0",
    "description": "Payments are how you interact with customers for all kinds of payment methods and types. \n\nUse the `pay` endpoints to generate one-time-use tokens and to accept web-based payments from cards and echecks (ACH) as well as retail payments from terminals or online forms. For more information about these workflows, see the [Getting started with ecommerce](doc:getting-started-with-ecommerce) and [Getting started with retail](doc:getting-started-with-retail) topics in Guides.\n\nAccess the `auth` endpoint to create a simple login that allows trusted users to proceed directly to the retail/MOTO iframe. For a tutorial, see [Using simple login for authentication](using-simple-login-for-authentication) in Guides.\n\nWork with payment billing for subscriptions and payment plans with the `subscriptions` endpoint. For additional information on using these endpoints, see the [Getting started with subscriptions](doc:getting-started-with-subscriptions) and [Getting started with pay plans](doc:getting-started-with-pay-plans) topics in Guides.\n\nThe `apm` endpoint allows you to generate one-time-use tokens and perform the various payment tasks for alternative payment methods. For workflows, integration guides, and tutorials, see the [Payment Methods](doc:payment-methods) documentation.",
    "contact": {
      "name": "Integrations Support",
      "email": "integrations@nexiopay.com",
      "url": "https://nexiointegrations.slack.com/"
    },
    "license": {
      "name": "ISC",
      "url": "https://docs.nexiopay.com/page/license"
    }
  },
  "security": [
    {
      "Basic_Authentication": []
    },
    {
      "One-time-use_Token": []
    }
  ],
  "servers": [
    {
      "description": "Sandbox",
      "url": "https://api.nexiopaysandbox.com",
      "variables": {}
    }
  ],
  "components": {
    "securitySchemes": {
      "Basic_Authentication": {
        "type": "http",
        "scheme": "basic",
        "description": "Basic authentication is a simple authentication scheme built into the HTTP protocol. \n\nFor the \"Try It\" feature, type your API username and password in the appropriate fields. The system then automatically creates the Authorization header that contains the word `Basic` followed by a space and a base64-encoded string `username:password`. \n\nFor example: `Authorization: Basic ZGVtbzpwQDU1dzByZA==` \n\nFor your own requests, learn how to do the conversion in the [Authentication](doc:authentication#basic-authentication) guide. \n\nFor more information about this security protocol, see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample"
      },
      "One-time-use_Token": {
        "type": "apiKey",
        "name": "token",
        "in": "query",
        "description": "The one-time-use token authentication scheme requires a token supplied in the named query parameter that can only be used to submit a single API request and that expires after one hour. \n\nFor the \"Try It\" feature, first generate the one-time-use token through either the [Create one-time-use token](ref:createonetimeusetoken) or the [Create APM one-time-use token](ref:createapmonetimeusetoken) endpoint. Copy the resulting token and then paste it in the appropriate field for the current endpoint. \n\nFor your own requests, learn how to generate the one-time-use token in the [Authentication](doc:authentication#one-time-use-tokens) guide. Then, use it as normal for this endpoint. \n\nFor more information about the \"apiKeys\" security protocol, see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object"
      }
    },
    "responses": {
      "401": {
        "description": "Unauthorized.\n\nFor help with this error and other error codes, see [Common errors](doc:common-errors) in the Guides area.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "integer",
                  "example": 440,
                  "description": "Indicates the Nexio error code, if applicable."
                },
                "message": {
                  "type": "string",
                  "description": "A message from Nexio about the state of the request.",
                  "example": "Unauthorized"
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Ecommerce",
      "description": "APIs for ecommerce payments"
    }
  ],
  "paths": {
    "/pay/v3/void": {
      "post": {
        "description": "Allows you to void a credit card, debit card, or echeck transaction using the Nexio Payment ID. In order to void a transaction, it must have been authorized but not yet settled.\n\nThe entire process for voiding a transaction is as follows: \n1. A transaction using the [Run card transaction](ref:runcardtransaction) or [Run echeck transaction](ref:runechecktransaction) endpoint occurs.\n2. Retrieve the `id` from the response. This is the Nexio Payment ID.\n3. Include that `id` in the body of your request for this endpoint in order to void the transaction.\n\nIf you do not know the `paymentId`, you can get an array of possible transactions that have authorized but are not yet settled with the [View transactions](ref:viewtransactions) endpoint and at least the following query filters:<br/>`transactionStatus=10`<br/>`plugin=`\n\n<!-- theme: warning -->\n> ⚠️ Try It\n> \n> To use the Try It feature for this endpoint, you can use the credentials for your [Sandbox API user](doc:sandbox-environments).<br/><br/>You can also use the following test account. Copy the value and paste it into the appropriate space in the Try It section to the right.\n> username: `docs@nexiopay.com`\n> password: `JZdzoXpdDeH6VA`<br/><br/>Include the ID as indicated above.\n\n<div style=\"display:none;\">\n\n## Request parameters\n- id\n\n## Response parameters\n- id\n- merchantId\n- transactionDate\n- authCode\n- transactionStatus\n- transactionType\n- currency\n- message\n- data\n- data.currency\n- data.settlementCurrency\n- gatewayResponse\n- gatewayResponse.gatewayName\n- gatewayResponse.refNumber\n\n</div>",
        "operationId": "VoidTransaction",
        "tags": [
          "Ecommerce"
        ],
        "security": [
          {
            "Basic_Authentication": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "title": "id",
                    "type": "string",
                    "description": "The Nexio Payment ID. To void a transaction through this endpoint it must have been captured through the Nexio Payment API.",
                    "example": "eyJuYW1lIjoWJlciI6IjMxCJtZXJjaGFudElkIjoiMoiVVNEIn0=",
                    "x-tags": [
                      "component"
                    ]
                  }
                }
              },
              "examples": {
                "Example request": {
                  "value": {
                    "id": "eyJuYW1lIjoWJlciI6IjMxCJtZXJjaGFudElkIjoiMoiVVNEIn0="
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "title": "id",
                      "type": "string",
                      "description": "The Nexio Payment ID.",
                      "example": "eyJuYW1lIjoWJlciI6IjMxCJtZXJjaGFudElkIjoiMoiVVNEIn0=",
                      "x-tags": [
                        "component"
                      ]
                    },
                    "merchantId": {
                      "type": "string",
                      "title": "merchantId",
                      "description": "The merchant ID (MID) through which the transaction was originally processed.",
                      "example": "100100",
                      "x-tags": [
                        "component"
                      ]
                    },
                    "authCode": {
                      "title": "authCode",
                      "type": "string",
                      "description": "Indicates the code for the originally processed and successfully authorized payment request. Not all [gateways or connections](doc:connections) return a value for `authCode`, so Nexio recommends against using this for reconciliation or bookkeeping.",
                      "example": "035410",
                      "x-tags": [
                        "component"
                      ]
                    },
                    "transactionType": {
                      "title": "transactionType",
                      "type": "string",
                      "description": "The [transaction type](doc:constant-transaction-values#transaction-type-transactiontype).",
                      "example": "sale",
                      "x-tags": [
                        "component"
                      ]
                    },
                    "transactionDate": {
                      "title": "transactionDate",
                      "type": "string",
                      "description": "The original transaction date and time, formatted as an [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html) date expressed in UTC.",
                      "example": "2019-01-15T13:19:39.329Z",
                      "x-tags": [
                        "component"
                      ]
                    },
                    "transactionStatus": {
                      "type": "string",
                      "title": "transactionStatus",
                      "description": "The current [transaction status](doc:constant-transaction-values#transaction-status-transactionstatus). If the void request is successful, this value will be `voided`.",
                      "x-tags": [
                        "component"
                      ],
                      "example": "voided"
                    },
                    "message": {
                      "type": "string",
                      "title": "message",
                      "description": "A message describing the status of the request.",
                      "example": "success",
                      "x-tags": [
                        "component"
                      ]
                    },
                    "currency": {
                      "title": "currency",
                      "type": "string",
                      "description": "The [three-character ISO code](https://en.wikipedia.org/wiki/ISO_4217) for the currency used in the original transaction.",
                      "x-tags": [
                        "component"
                      ],
                      "x-internal": false,
                      "example": "USD"
                    },
                    "data": {
                      "type": "object",
                      "description": "Transaction data.",
                      "properties": {
                        "currency": {
                          "$ref": "#/paths/~1pay~1v3~1void/post/responses/200/content/application~1json/schema/properties/currency"
                        },
                        "settlementCurrency": {
                          "title": "settlementCurrency",
                          "type": "string",
                          "description": "The [three-character ISO code](https://en.wikipedia.org/wiki/ISO_4217) for the currency in which the transaction was specified to be settled originally.",
                          "example": "EUR",
                          "x-tags": [
                            "component"
                          ]
                        }
                      }
                    },
                    "gatewayResponse": {
                      "title": "gateway",
                      "type": "object",
                      "description": "Gateway-specific information. <b>Details will vary by gateway. Do NOT code to any information included in this object</b>.",
                      "properties": {
                        "gatewayName": {
                          "$ref": "#/paths/~1pay~1v3~1processFromTerminal~1%7BterminalRequestId%7D/get/responses/200/content/application~1json/schema/properties/gatewayResponse/properties/gatewayName"
                        },
                        "refNumber": {
                          "type": "string",
                          "title": "refNumber",
                          "description": "The gateway identifier for the transaction.",
                          "example": "8E56222GD0701110",
                          "x-tags": [
                            "component"
                          ]
                        }
                      },
                      "x-tags": [
                        "object"
                      ]
                    },
                    "random-nnnnnnn": {
                      "$ref": "#/paths/~1card~1v3/get/responses/200/content/application~1json/schema/properties/random-nnnn"
                    }
                  }
                },
                "examples": {
                  "Example response": {
                    "value": {
                      "id": "eyJuYW1lIjoWJlciI6IjMxCJtZXJjaGFudElkIjoiMoiVVNEIn0=",
                      "merchantId": "100100",
                      "authCode": "",
                      "currency": "USD",
                      "transactionType": "sale",
                      "transactionDate": "2019-01-15T13:19:39.329Z",
                      "transactionStatus": "voided",
                      "message": "success",
                      "gatewayResponse": {
                        "gatewayName": "usaepay",
                        "refNumber": "8E56222GD0701110"
                      },
                      "data": {
                        "currency": "EUR",
                        "settlementCurrency": "USD"
                      },
                      "random-nnnnnnn": "6fec4a03-3a9f-40de-90bc-23a513ac904c"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          }
        },
        "summary": "Void a transaction"
      }
    },
    "/card/v3": {
      "get": {
        "description": "Allows you to view all saved card tokens based on the given criteria. \n\n<!-- theme: info -->\n> 📘 Note \n> \n> Nexio does not currently support returning terminal tokens from this endpoint. Instead, use the terminal's token with the [View card token details](ref:viewcardtokendetails) endpoint.\n\nSaved card tokens can be used to process through any MID on your account. They are not restricted to a specific merchant account or currency.\n\n<!-- theme: warning -->\n> ⚠️ Try It\n> \n> To use the Try It feature for this endpoint, you can use the credentials for your [Sandbox API user](doc:sandbox-environments).\n> \n> You can include any of the possible filters, or none of them, in your request. For example, `/card/v3/?expirationYear<2024&merchantId=000999` to return all records for the given merchantId and a card expiration year before 2024.\n\n<div style=\"display:none;\">\n\n## Request parameters\n- limit\n- offset\n- createdAt\n- updatedAt\n- merchantId\n- merchantIds\n- customerRef\n- expirationMonth\n- expirationYear\n- accountUpdaterStatus\n- shouldUpdateCard\n- lastAccountUpdaterUpdate\n- pauseAccountUpdater\n- cardType\n- firstSix\n- lastFour\n- token\n- cardHolderName\n\n\n## Response parameters\n- limit\n- offset\n- hasMore\n- rows.key\n- rows.merchantId\n- rows.customerRef\n- rows.expirationMonth\n- rows.expirationYear\n- rows.accountUpdaterStatus\n- rows.shouldUpdateCard\n- rows.lastAccountUpdaterUpdate\n- rows.pauseAccountUpdater\n- rows.createdAt\n- rows.updatedAt\n- rows.cardType\n- rows.firstSix\n- rows.lastFour\n- rows.token\n- rows.cardHolderName\n- random-nnnn\n\n</div>",
        "operationId": "ViewCardTokens",
        "tags": [
          "Ecommerce"
        ],
        "security": [
          {
            "Basic_Authentication": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "description": "The number of records to return. ",
            "schema": {
              "type": "integer",
              "example": 12,
              "default": 10
            }
          },
          {
            "in": "query",
            "name": "offset",
            "description": "The offset. Used to view records further along the list.",
            "schema": {
              "type": "integer",
              "example": 10,
              "default": 0
            }
          },
          {
            "$ref": "#/components/parameters/createdAt"
          },
          {
            "$ref": "#/components/parameters/updatedAt"
          },
          {
            "$ref": "#/components/parameters/merchantId"
          },
          {
            "$ref": "#/components/parameters/merchantIds"
          },
          {
            "$ref": "#/components/parameters/customerRef"
          },
          {
            "$ref": "#/components/parameters/expirationMonth"
          },
          {
            "$ref": "#/components/parameters/expirationYear"
          },
          {
            "$ref": "#/components/parameters/cardType"
          },
          {
            "$ref": "#/components/parameters/cardHolderName"
          },
          {
            "$ref": "#/components/parameters/firstSix"
          },
          {
            "$ref": "#/components/parameters/lastFour"
          },
          {
            "$ref": "#/components/parameters/accountUpdaterStatus"
          },
          {
            "$ref": "#/components/parameters/lastAccountUpdaterUpdate"
          },
          {
            "$ref": "#/components/parameters/pauseAccountUpdater"
          },
          {
            "$ref": "#/components/parameters/shouldUpdateCard"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "limit": {
                      "type": "integer",
                      "x-stoplight": {
                        "id": "m7rr4xu6r2u9i"
                      },
                      "title": "limit",
                      "description": "The maximum number of records returned in a response (starting from the default or specified `offset` query parameter).",
                      "default": 10,
                      "example": 12,
                      "x-tags": [
                        "component"
                      ]
                    },
                    "offset": {
                      "type": "integer",
                      "x-stoplight": {
                        "id": "bge9c0whmlhqb"
                      },
                      "title": "offset",
                      "description": "The offset indicates how many card token records were skipped before beginning to return records in a response. If both `offset` and `limit` were used together, the offset records were skipped before starting to count the records to limit.",
                      "default": 0,
                      "example": 10,
                      "x-tags": [
                        "component"
                      ]
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "Will be `true` if there are more records after the current paged response. Use the `limit` and `offset` query parameters to display paged results."
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string",
                            "title": "key",
                            "example": "4f211fde-d135-4c91-afbc-bcdb73c0c504.5292712865664733",
                            "x-tags": [
                              "component"
                            ],
                            "description": "The Nexio unique key for the card token."
                          },
                          "token": {
                            "$ref": "#/paths/~1pay~1v3~1vault~1card~1%7BcardToken%7D/get/responses/200/content/application~1json/schema/properties/tokenex/properties/token"
                          },
                          "customerRef": {
                            "title": "customerRef",
                            "type": "string",
                            "description": "Customer identifier associated with the card/echeck token.",
                            "example": "RP006",
                            "x-tags": [
                              "component"
                            ]
                          },
                          "merchantId": {
                            "$ref": "#/paths/~1pay~1v3~1saveCard/post/responses/200/content/application~1json/schema/properties/merchantId"
                          },
                          "cardType": {
                            "$ref": "#/paths/~1pay~1v3~1saveCard/post/responses/200/content/application~1json/schema/properties/cardType"
                          },
                          "cardHolderName": {
                            "$ref": "#/paths/~1pay~1v3~1vault~1card~1%7BcardToken%7D/get/responses/200/content/application~1json/schema/properties/card/properties/cardHolderName"
                          },
                          "firstSix": {
                            "type": "string",
                            "title": "firstSix",
                            "description": "The first six digits of the card number.",
                            "x-tags": [
                              "component"
                            ],
                            "example": "424242"
                          },
                          "lastFour": {
                            "type": "string",
                            "title": "lastFour",
                            "description": "The last four digits of the card number.",
                            "x-tags": [
                              "component"
                            ],
                            "example": "4242"
                          },
                          "expirationMonth": {
                            "$ref": "#/paths/~1pay~1v3~1vault~1card~1%7BcardToken%7D/put/responses/200/content/application~1json/schema/properties/card/properties/expirationMonth"
                          },
                          "expirationYear": {
                            "$ref": "#/paths/~1pay~1v3~1vault~1card~1%7BcardToken%7D/put/responses/200/content/application~1json/schema/properties/card/properties/expirationYear"
                          },
                          "createdAt": {
                            "$ref": "#/paths/~1pay~1v3~1vault~1card~1%7BcardToken%7D/get/responses/200/content/application~1json/schema/properties/dateCreated"
                          },
                          "updatedAt": {
                            "$ref": "#/paths/~1pay~1v3~1vault~1card~1%7BcardToken%7D/get/responses/200/content/application~1json/schema/properties/dateLastModified"
                          },
                          "shouldUpdateCard": {
                            "$ref": "#/paths/~1pay~1v3~1saveCard/post/responses/200/content/application~1json/schema/properties/shouldUpdateCard"
                          },
                          "accountUpdaterStatus": {
                            "$ref": "#/paths/~1pay~1v3~1vault~1card~1%7BcardToken%7D/get/responses/200/content/application~1json/schema/properties/accountUpdaterStatus"
                          },
                          "lastAccountUpdaterUpdate": {
                            "type": "string",
                            "title": "lastAccountUpdaterUpdate",
                            "description": "The most recent update to the card token from Account Updater. The value is one of the following:\n- `cardExpiration` - if the expiration date was changed\n- `cardNumber` - if the card number was changed\n- `accountClosed` - if the last update indicated that the account is closed\n- null - if no change has occurred yet",
                            "x-tags": [
                              "component"
                            ],
                            "example": "cardNumber"
                          },
                          "pauseAccountUpdater": {
                            "type": "boolean",
                            "title": "pauseAccountUpdater",
                            "x-tags": [
                              "component"
                            ],
                            "description": "This parameter has been deprecated. For Nexio internal use only.",
                            "example": false,
                            "deprecated": true
                          }
                        }
                      }
                    },
                    "random-nnnn": {
                      "type": "string",
                      "title": "random-4611765",
                      "description": "Used for sandbox/testing only. The parameter name includes a random set of numbers as part of the name and includes a random value in the response.\\\n\\\nThis parameter and value have no meaning except to remind you to create a flexible integration with the Nexio API.",
                      "example": "6fec4a03-3a9f-40de-90bc-23a513ac904c",
                      "x-tags": [
                        "component"
                      ]
                    }
                  }
                },
                "examples": {
                  "Example response": {
                    "value": {
                      "limit": 12,
                      "offset": 10,
                      "hasMore": true,
                      "rows": [
                        {
                          "key": "4f211fde-d135-4c91-afbc-bcdb73c0c504.5292712865664733",
                          "token": "6ee140a0-05d1-4958-8325-b38a690dbb9d",
                          "customerRef": "RP006",
                          "merchantId": "000999",
                          "cardType": "visa",
                          "cardHolderName": "John H Doe",
                          "firstSix": "479300",
                          "lastFour": "3313",
                          "expirationMonth": "12",
                          "expirationYear": "28",
                          "createdAt": "2020-04-28T19:19:33.185Z",
                          "updatedAt": "2022-03-28T19:19:33.185Z",
                          "shouldUpdateCard": true,
                          "accountUpdaterStatus": "isExcluded",
                          "lastAccountUpdaterUpdate": "cardNumber",
                          "pauseAccountUpdater": false
                        }
                      ],
                      "random-nnnn": "6fec4a03-3a9f-40de-90bc-23a513ac904c"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          }
        },
        "summary": "View card tokens"
      }
    }
  }
}
```