> ## 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](/manage-payments/cancel-payment).

<Frame caption="Workflow example">
  <img src="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" alt="Workflow example" width="1536" height="662" data-path="images/workflows/cancel-payment/auth_cancel.png" />
</Frame>

<Warning>
  In order to cancel a payment, the payment must **not** have reached SETTLED status.
</Warning>

## How to use the Action

* Assign a `payment ID` - this will usually be the "Payment ID" from the ["Payment created" Trigger](/workflows/apps/native-apps/primer-payments-app/payment-created-trigger) output or ["Payment status updated" Trigger](/workflows/apps/native-apps/primer-payments-app/payment-status-updated-trigger) 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.
</Tip>

<Frame caption="Use Case 1">
  <img src="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" alt="Use Case 1" width="1536" height="774" data-path="images/workflows/cancel-payment/capture_check.png" />
</Frame>
