# Void

## Overview

The `void` method cancels an authorized payment before capture.

## Request Fields

| Field                    | Type   | Required | Description        |
| ------------------------ | ------ | -------- | ------------------ |
| `merchantTransactionId`  | String | Yes      | Your reference     |
| `connectorTransactionId` | String | Yes      | Connector's ID     |
| `voidReason`             | String | No       | Reason for voiding |

## Response Fields

| Field    | Type          | Description |
| -------- | ------------- | ----------- |
| `status` | PaymentStatus | VOIDED      |

## Example

```java
Map<String, Object> request = new HashMap<>();
request.put("merchantTransactionId", "txn_001");
request.put("connectorTransactionId", "pi_xxx");

Map<String, Object> response = paymentClient.void(request);
```

## Next Steps

* [authorize](https://docs.hyperswitch.io/integrations/prism/java/payment-service/authorize) - Create authorization
