---
updatedAt: 2026-08-17T16:30:44.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/developers/llms.txt
---

# Void Transaction

Voids an entire transaction.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Merchant Transaction API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://sandbox.affirm.com/api/v1"
    },
    {
      "url": "https://api.affirm.com/api/v1"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/transactions/{transaction_id}/void": {
      "post": {
        "tags": [
          "Transactions API"
        ],
        "summary": "Void Transaction",
        "description": "Voids an entire transaction.",
        "operationId": "void_transaction",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique identifier pre-generated by the client and used by the server to recognize successive calls to the same endpoint. This is required for Split Capture and encouraged for single transaction functionality. Note: If a request fails or times out, use the same idempotency key to retry the operation without risk of double-processing. For details, see the [Idempotency section on About Split Capture](https://docs.affirm.com/payments/docs/split-capture#idempotency).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "transaction_id",
            "in": "path",
            "description": "A unique ID representing the transaction’s loan or charge ID.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "ABCD-1234"
            }
          }
        ],
        "requestBody": {
          "description": "The request body used to void a transaction.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidRequest"
              }
            }
          },
          "x-nullable": true
        },
        "responses": {
          "200": {
            "description": "HTTP 200 OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionEvent5"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400 Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401 Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorUnauthorized"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404 Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorNotFound"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409 Conflict",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Conflict"
                }
              }
            }
          }
        },
        "x-swagger-router-controller": "affirm.http.api.merchant.transaction.v1.api"
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorBadRequest": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message.",
            "example": "Bad Request"
          },
          "status_code": {
            "type": "integer",
            "description": "The HTTP status code.",
            "example": 400
          },
          "type": {
            "type": "string",
            "description": "The error type.",
            "example": "BAD_REQUEST"
          },
          "code": {
            "type": "string",
            "description": "The error type.",
            "example": "BAD_REQUEST"
          }
        }
      },
      "ErrorNotFound": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message.",
            "example": "Not Found"
          },
          "status_code": {
            "type": "integer",
            "description": "The HTTP status code.",
            "example": 404
          },
          "type": {
            "type": "string",
            "description": "The error type.",
            "example": "NOT_FOUND"
          },
          "code": {
            "type": "string",
            "description": "The error type.",
            "example": "NOT_FOUND"
          }
        }
      },
      "Conflict": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message.",
            "example": "Conflict"
          },
          "status_code": {
            "type": "integer",
            "description": "The HTTP status code.",
            "example": 409
          },
          "type": {
            "type": "string",
            "description": "The error type.",
            "example": "capture_greater_than_balance"
          },
          "code": {
            "type": "string",
            "description": "The error type.",
            "example": "capture_greater_than_balance"
          }
        }
      },
      "ErrorUnauthorized": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message.",
            "example": "Unauthorized"
          },
          "status_code": {
            "type": "integer",
            "description": "The HTTP status code.",
            "example": 401
          },
          "type": {
            "type": "string",
            "description": "The error type.",
            "example": "UNAUTHORIZED"
          },
          "code": {
            "type": "string",
            "description": "The error type.",
            "example": "UNAUTHORIZED"
          }
        }
      },
      "VoidRequest": {
        "type": "object",
        "properties": {
          "reference_id": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string",
            "description": "An optional, unique identifier that may be associated with each transaction event and reconciled with the system of record used by the merchant.",
            "example": "W1X2Y3Z4",
            "x-nullable": true
          },
          "amount": {
            "minimum": 1,
            "type": "integer",
            "description": "The amount to void, used only for merchants that are enabled with split capture. The value is positive and is represented in the smallest currency unit, such as cents instead of dollars.",
            "example": 10000,
            "x-nullable": true
          }
        }
      },
      "TransactionEvent5": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of event, such as auth, auth_expired, capture, charge_off, confirm, confirmation_expired, expire_authorization, expire_confirmation, refund, split_capture, update, void, partial_void, and refund_voided.",
            "example": "void"
          },
          "created": {
            "type": "string",
            "description": "The time when the transaction event was created. The value is formatted in RFC 3339.",
            "example": "2019-01-01T00:00:00.000Z"
          },
          "id": {
            "type": "string",
            "description": "A unique ID for the transaction event.",
            "example": "ABCD-1234"
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```

# Sibling pages

* [List Transactions](https://docs.affirm.com/developers/reference/list_transactions.md)
* [Authorize Transaction](https://docs.affirm.com/developers/reference/authorize_transaction.md)
* [List Transaction Events](https://docs.affirm.com/developers/reference/list_transaction_events.md)
* [Read Transaction](https://docs.affirm.com/developers/reference/read_transaction.md)
* [Update Transaction](https://docs.affirm.com/developers/reference/update_transaction.md)
* [Capture Transaction](https://docs.affirm.com/developers/reference/capture_transaction.md)
* [Refund Transaction](https://docs.affirm.com/developers/reference/refund_transaction.md)
* [List Settlement Events](https://docs.affirm.com/developers/reference/list_settlement_events.md)
* [List Settlement Event Summaries](https://docs.affirm.com/developers/reference/list_settlement_event_summaries.md)