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

# Cancel payment Action

## What does this Action do?

The "Cancel payment" Action is responsible for sending the cancel request. It enables you to define rules where you wish to automatically cancel a payment after its authorization.

Learn more about canceling payments [here](https://primer.io/docs/manage-payments/cancel-payment.md).

![Workflow example](https://mintcdn.com/primer-cc826789/xLgoTOSuc1hi-Q-M/images/workflows/cancel-payment/auth_cancel.png?fit=max\&auto=format\&n=xLgoTOSuc1hi-Q-M\&q=85\&s=1398473e44278cb0d2c042c50969bfa4)

Workflow example

> [!WARNING]
>
> In order to cancel a payment, the payment must **not** have reached SETTLED status.

## How to use the Action

* Assign a `payment ID` - this will usually be the "Payment ID" from the ["Payment created" Trigger](https://primer.io/docs/workflows/apps/native-apps/primer-payments-app/payment-created-trigger.md) output or ["Payment status updated" Trigger](https://primer.io/docs/workflows/apps/native-apps/primer-payments-app/payment-status-updated-trigger.md) output
* \[Optional] Set `reason`, which can be used for your own records

## Use cases

Based on your needs, you can utilize this Action in a few ways. Below is an example for inspiration:

> [!TIP]
>
> Cancel the payment if it failed the CVV and AVS checks by the processor during authorization.

![Use Case 1](https://mintcdn.com/primer-cc826789/xLgoTOSuc1hi-Q-M/images/workflows/cancel-payment/capture_check.png?fit=max\&auto=format\&n=xLgoTOSuc1hi-Q-M\&q=85\&s=321e9aef48fd609e20d340836b275449)

Use Case 1


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.