> ## Documentation Index
> Fetch the complete documentation index at: https://developer.hellgate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Void a Payment

> Void open or authorized payments before capture.

Any payment which is not `captured` yet, can be voided. Commerce supports both voiding an `open` and `authorized` payment.

## Voiding open payments

This is a very simple operation that stops any activities in preparation for processing the payment. The prerequisite is that the payment is in `open` state.

## Voiding authorized payments

If a payment was successfully authorized, it can be voided as well. In such cases the authorized amount will be cleared on the processor. The prerequisite is, that the payment is in `authorized` state. In contrast to voiding an open payment, this modification might fail, which could lead to a failed payment depending on the setup.

## Request

Find the API documentation for the request [here](/products/commerce/v2/api-reference/payments_modifications/void).

```text theme={null}
POST /payments/{payment_id}/void
```

## Response

The payment will be in `voiding` state during handling the request. As soon as the voiding is completed, the payment will be in `voided` state.

Voided Payment (from authorized state)

```json theme={null}
{
  "id": "54ba1fdb-7e4e-402b-aebb-66f9d5345cf8",
  "amount": {
    "requested": 1000,
    "authorized": 1000,
    "voided": 1000
  },
  "created_at": "2023-10-10T00:00:00Z",
  "currency_code": "EUR",
  "flow": "e-commerce flow",
  "reference": "Order #12345",
  "status": "voided",
  "source": {
    "type": "card",
    "cardholder_name": "Bob Holder",
    "expiry_month": 12,
    "expiry_year": 2030,
    "masked_account_number": "424242XXXXXX4242",
    "pan_type": "FPAN"
  },
  "use_case": "ONE_OFF"
}
```
