> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-docs-devrel-859-new-docs-org-pages-pr-branch.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Void an Authorization

> Return the remaining escrowed authorization to the payer or let the payer reclaim it after expiry.

Close an authorization that you will not capture. The operator can call `void` at any time to return all remaining capturable funds. If the operator becomes inactive, the payer can call `reclaim` at or after `authorizationExpiry`.

<Info>
  This guide's payment flow is based on the [Commerce Payments Protocol](https://github.com/base/commerce-payments).
</Info>

| Path | Caller | Available when |
| - | - | - |
| `void(paymentInfo)` | Operator | Any time a capturable balance remains |
| `reclaim(paymentInfo)` | Payer | At or after `authorizationExpiry` |

## Void the Remaining Authorization

`void` returns the complete `capturableAmount`; there is no partial-void operation. Capture the final fulfilled amount first, then void the remainder.

```typescript TypeScript lines wrap expandable highlight={5,8,13-14} theme={null}
export async function voidAuthorization(payment: StoredProtocolPayment) {
  const [, capturableAmount] = await publicClient.readContract({
    address: AUTH_CAPTURE_ESCROW,
    abi: authCaptureEscrowAbi,
    functionName: "paymentState",
    args: [payment.paymentInfoHash],
  });
  if (capturableAmount === 0n) throw new Error("Authorization has no remaining funds");
  const simulation = await publicClient.simulateContract({
    account,
    address: AUTH_CAPTURE_ESCROW,
    abi: authCaptureEscrowAbi,
    functionName: "void",
    args: [payment.paymentInfo],
  });
  const hash = await walletClient.writeContract(simulation.request);
  const receipt = await publicClient.waitForTransactionReceipt({ hash, confirmations: 2 });
  if (receipt.status !== "success") throw new Error("Payment void reverted");
  return receipt;
}
```

Both `void` and `reclaim` set `capturableAmount` to zero while leaving any previously captured `refundableAmount` unchanged.

<Check>
  Verify `PaymentVoided` or `PaymentReclaimed`, and match its amount to the capturable balance immediately before the return.
</Check>

<Warning>
  After authorization expiry, the operator and payer can race to return the same remainder through `void` or `reclaim`. One succeeds and the other reverts with `ZeroAuthorization`; process either event idempotently as the terminal authorization return.
</Warning>

## See Also

<CardGroup cols={2}>
  <Card title="Authorize a Payment" icon="signature" href="/build-on-base/accept-payments/authorize-a-payment">
    Configure the authorization and recovery windows.
  </Card>

  <Card title="Refund a Payment" icon="rotate-left" href="/build-on-base/accept-payments/refund-a-payment">
    Return value that was already captured.
  </Card>
</CardGroup>
