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

# Payment Status Changed

> Start a workflow when a payment is paid, partly paid, fails, is refunded, expires or is cancelled.

## What is this?

**Payment Status Changed** starts a workflow when a payment of a contact changes status — for example to send a thank-you or receipt when it is **Paid**, or a follow-up when it **Expired**. Contact data is already available as variables, so you don't need to ask again.

Payments come from store orders, payment requests, hand-recorded payments and the [Send Payment](https://docs.skyfree.io/workspace/automation/steps/send-messages.md#send-payment) step. See [Payments](https://docs.skyfree.io/workspace/contacts/payments.md).

## What can I do here?

* Run only for the events you pick: **Paid**, **Partially paid**, **Failed**, **Refunded**, **Expired**, **Cancelled**
* Limit the flow to certain kinds of payment, or leave all unticked to run for every kind
* Use the payment details in your messages

## How to use it

**1. Choose the trigger**

When creating the automation, pick **Payment status changed** as the trigger.

**2. Pick the events**

Under **Run when a payment is**, tick one or more events. At least one is always on; the default is **Paid**.

**3. Pick what the payment is for (optional)**

Under **For payments of**, tick any of: **Store orders**, **Bookings**, **Event registrations**, **Payment requests**, **Payments recorded by hand**, **Requests sent by an automation**, **Other payments received on the account**. Leave all unticked to run for every kind.

**4. Build the flow**

Add your steps. Use the **Payment** variables in messages.

## Payment variables

Use these as `{{payment.<name>}}`:

| Variable | What it holds |
| - | - |
| `amount` | Total amount |
| `amount_paid` | Amount received (less than the total for a partial payment) |
| `amount_refunded` | Amount refunded |
| `currency` | Currency |
| `status` | Status |
| `previous_status` | Status before the change |
| `event` | The event that started the flow |
| `method` | Payment method |
| `reference` | Reference |
| `source` | What the payment is for |
| `source_id` | Order, booking or event ID |
| `id` | Payment ID |

## Good to know

* A **Pending** payment starts nothing — only the six events above do.
* A flow paused on a **Send Payment** step resumes by itself when that payment is paid or expires; you don't need this trigger for that.

## Troubleshooting / Technical Notes

* **The flow didn't run.** Check the event ticked matches the payment's new status, and that **For payments of** isn't excluding its source.
* **It ran twice.** Two automations may share this trigger. Review them in [Manage Live Flows](https://docs.skyfree.io/workspace/automation/manage-live-flows.md).
* **No payments arrive from Stripe or Razorpay.** Check **Payment confirmations** are on for the account in [Integrations](https://docs.skyfree.io/workspace/integrations/overview.md).

## Related docs

* [Payments](https://docs.skyfree.io/workspace/contacts/payments.md)
* [Triggers](https://docs.skyfree.io/workspace/automation/triggers/overview.md)
* [Send Payment step](https://docs.skyfree.io/workspace/automation/steps/send-messages.md#send-payment)


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