# Apple Shortcuts

URL: https://docs.clatri.com/en/apple-shortcuts/

> Log your Apple Pay payments, your bank's SMS, its app notifications and its emails in Clatri with Shortcuts automations.

**Shortcuts** is the iPhone tool launched in 2018 to create automations on your phone. Below we'll see how you can use it to automate logging your expenses in Clatri using Apple Pay and the notifications your bank sends you by text message.

The first thing to do is open the Shortcuts app and tap **+** to create a new automation. If you have iOS 27 on an iPhone 15 Pro or later, the app will probably let you create your automation just by describing it with a prompt; either way, here we'll see the manual way to do it.

You need to be signed in to Clatri and have an active subscription. Open Clatri once after installing or updating it: that connects the automations to your account.

## How to read an automation

An automation has two parts, and on screen each one is a **box**:

1. **The trigger** ("When…"): what has to happen. For example, paying with a card or receiving an SMS.
2. **The actions**: what the iPhone does when it happens. For example, sending the payment details to Clatri.

(1) **Trigger.** You recognise it by the icon of the app behind it: the blue Wallet card, the green Messages bubble, the red notification bell or the Mail envelope.
(2) **Action.** Clatri's actions carry the Clatri icon. The › arrow expands their fields.

The grey boxes with the branch icon are **If**, **Otherwise** and **End If**: they decide which action runs. The orange box with an **x** is **Set Variable**.

## Finding a trigger

Tap **+**. A search sheet opens with the **Automation** filter. Triggers are grouped: under **Apps** you'll find **Wallet** and **Notification**.

(1) **Wallet**: when you pay with a Wallet card.
(2) **Notification**: when an app, such as your bank's, sends you a notification. This trigger arrived with iOS 27.

For **Message** (SMS) and **Email**, type their name in the search field.

An automation can have **several triggers**. The word **or** appears between them: any one of them is enough.

## Outputs: what each trigger brings

When a trigger fires, it hands over an **output**: a bundle with the details of what happened. That output shows up as a blue pill with its icon, and you use it to fill in the actions' fields.

| Trigger | Output | What it contains |
|---|---|---|
| Wallet | Transaction | Card or Pass, Merchant, Amount, Name |
| Message | Message | Content, Sender… |
| Notification | Notification | App, Title, Body… |
| Email | Email | Subject, Content, Sender, Recipients, Attachments |

When you tap a field and choose **Select Variable**, the iPhone lists the available outputs. Tapping a pill opens its **Get** menu so you can pick the part you want:

On the left, the field receives the **merchant**. On the right, the **amount**. Never type an amount, merchant or card by hand: that way each payment sends its own data.

## Variables: when to use them and when not

You almost never need to create variables. **The trigger's output already is a variable**: the iPhone creates and names it for you (Transaction, Message, Notification, Email). Connecting a field straight to that output is the norm, even when you use several of its parts in the same action.

There is only one case where you do need **Set Variable**: when you need **a part that sits inside another part**. An output's **Get** menu only goes **one level** down.

**Amount** is not a plain number: it is an amount with its currency. Clatri needs both separately, and the Transaction menu won't let you reach them. The fix is to store Amount in a variable of its own. That variable sits at the first level, and its menu does show **Currency Code** and **Currency Amount**:

(1) There are **two "Currency Amount" rows**. For the number, use the lower one, **below Currency Code**. The upper one is the full amount with its currency. For the currency, choose **Currency Code** in this same menu.

In short:

| If you need… | Do this |
|---|---|
| One part of the output (Merchant, Content, Title, Body, Subject…) | Connect it directly. No variable. |
| Several parts of the same output | Connect each directly to its field. No variable. |
| A part inside another part (the currency inside Amount) | One **Set Variable** holding the outer part; then pick the inner part from the variable's menu. |

That is why this guide has **a single** variable, `WalletAmount`, and only for Apple Pay. SMS, notifications and emails need none.

## Clatri's actions

Clatri offers one action per source. They are all called **Record transaction from…** and each one already knows where the data comes from: there is no source to choose.

| Action | What Clatri does |
|---|---|
| **Record transaction from Apple Pay** | Receives the exact amount, currency, merchant and card, and records the expense. **Last 4 digits** is optional: leave it empty unless Clatri doesn't recognise the card. |
| **Record transaction from SMS** | Reads the message and records **one purchase** when the text includes amount, currency, merchant and date. |
| **Record transaction from notification** | Same as SMS, reading title and body together. In the chat it shows as "Notification from Nu". |
| **Record transaction from email** | Shows the email in the chat, imports its **PDF attachments** (up to 5, 20 MB in total) as documents, and the assistant reads body and attachments together. If a statement has many movements, it imports them. |

On an iPhone set to Spanish they appear as «Registrar transacción desde Apple Pay», «…desde SMS», «…desde una notificación» and «…desde un correo». **Ask Clatri** is for talking to the assistant and is not used in these flows.

:::info A transfer is not always a move between your own accounts
If the bank says you transferred money, Clatri does not automatically treat it as a move between your own accounts: it can also be a payment, an expense or a loan. It is only an internal transfer if the other account is yours. For now, transfers that arrive by SMS or notification stay in the chat for you to review; they are not recorded on their own.
:::

## The complete automation, step by step

This example uses a single automation with three triggers:

- **Apple Cash** with Apple Pay.
- **SMS** from a bank (in the example, Bancolombia, which texts from **85540**), only for two cards.
- **Notifications** from the Nu app.

When a trigger fires, **only its output has data**; the others stay empty. So with two **If … has any value** checks, the automation knows which path to take:

### 1. The triggers

(1) In the Wallet trigger, select **only the cards that don't come in another way**. Here that's Apple Cash, because Nu comes in by notification and the bank cards by SMS. If a card is in two triggers, every purchase is recorded twice.
(2) The filter is optional. Apps also notify you about things that aren't purchases; Clatri doesn't record them, but leaves a card in the chat for you to review.

Keep **Automation** on so it runs by itself without asking for confirmation. **Notify** can stay off: Clatri tells you the result on its own.

### 2. The SMS path

(1) **If Message has any value**: only enters when the trigger was an SMS. It must have **a single** condition; delete any empty "Condition" row.
(2) Filters the cards you want to record by SMS. The card endings in the example are made up: use yours. To build this If: add the first condition, tap **+** at its end to add the second, and change **All** to **Any**.

:::warning Use "contains", not "is"
With **is**, the whole SMS would have to be exactly "\*0042", which never happens. The right condition is **contains**.
:::

### 3. The notification path and the Apple Pay path

(1) Type **Nu** by hand: this trigger is only for Nu, so the name is always the same.
(2) The automation's only variable, as explained above.
(3) Amount = WalletAmount → the **second** Currency Amount. Currency Code = WalletAmount → Currency Code. Merchant and Card connect directly to Transaction; Card is **Card or Pass**, not the whole Transaction.

To add an action, use the search bar at the bottom of the editor and type **Clatri**. For If, Otherwise and Set Variable, type **If** or **Set Variable**.

Turn **Show When Run** off in all three Clatri actions so they don't interrupt you. Save and reopen the automation to check the connections: tapping each pill should show the right option checked in its **Get** menu.

### 4. Emails with statements (optional)

If your bank emails you statements or receipts, create another automation with the **Email** trigger, filtered by the bank's sender:

Clatri only processes **PDF** attachments; it ignores logos, images and other files. If the PDF has a password, it tries the ones saved in Clatri and, if none work, asks you in the chat. If the body and the PDF describe the same movement, it records it once. The example address is made up.

## One source per card

Each purchase must reach Clatri through **one** path only. If the same payment comes in through Apple Pay and through the bank's notification, it is recorded twice.

| Card or account | Recommended path |
|---|---|
| Cards whose bank sends SMS | **SMS**, filtering their endings |
| Cards whose bank sends notifications (for example, Nu) | **Notification**. It also covers physical-card and online purchases, not just Apple Pay. |
| Cards with no useful SMS or notifications (for example, Apple Cash) | **Apple Pay** |
| Accounts connected with Plaid | None: they already arrive on their own. Don't select them in the triggers. |

## Check that it works

Make a real purchase and open the Clatri chat. You'll see a card with the source ("Apple Pay", "Messages", "Notification from Nu" or the email) and, below it, the assistant's reply. Clatri also sends you a notification with the result.

**Don't tap ▶ to test.** A manual run has no real purchase and can create a new event.

"Received for processing" doesn't yet mean "expense recorded": the result is in the chat. If Clatri needs to know which card or account it was, it asks you there.

## If an error appears

| Message | What to do |
|---|---|
| **Connect the message content in this action** | The Content field is empty. Connect it to the trigger's output. |
| **Clatri did not receive a payment amount / currency** | Check Amount and Currency Code: they must come from `WalletAmount`. Nothing was sent. |
| **Open Clatri once to connect automations to your signed-in account** | Open Clatri while signed in. It also happens when the connection expires. |
| **Event saved on this iPhone, awaiting delivery** | There was no connection. Open Clatri so it resends it. **Don't run the action again**: you would create another event. |
| **Clatri accepts up to 5 PDF attachments and 20 MB per email** | The email has too many attachments or they are too large. |
| **Couldn’t communicate with a helper application** | It is an iOS failure. Check the Clatri chat before repeating anything. |

Signing out or switching users discards the events that were pending on this iPhone.

## Details

<details>
<summary>How Clatri picks the card, account and entity</summary>

Clatri looks for the received ending among your user's active cards. An identified card also determines its entity. It doesn't infer the card just because it says Visa or Mastercard.

**Debit:** if all candidate cards are debit, in the same entity, on the same account and in the same currency, Clatri records the expense on that account even if it can't tell the physical card from the virtual one. It never invents the last four digits.

**Credit:** always needs a specific card. If in doubt, Clatri asks in the chat before recording.

Wallet may hand over the ending of the device's virtual card, which differs from the physical one. If Clatri doesn't recognise your card, type its last four digits in **Last 4 digits** in an automation that uses **only that card**. Never fix digits in an automation that accepts several cards.

<details>
<summary>Purchases in another currency</summary>

The currency Wallet hands over is the purchase currency. Clatri converts the amount to the card's or account's currency using a market rate from the time of payment, and marks it as an **estimated conversion**: the bank may apply another rate or fees. You can correct the amount and tap **Confirm final amount** on the expense. If the payment already comes in the card's currency, there is no conversion.

<details>
<summary>Delivery, retries and notices</summary>

Each event is first saved on the iPhone and then sent with a fixed identifier. Without a connection it is retried when you open Clatri; a resend never creates a second expense. Email PDFs wait on the iPhone, excluded from backups, and are deleted once they reach the server.

Clatri sends a notification with the result: expense recorded, needs clarification, review the message, or the email reached the chat. Notices never show amounts, merchants or cards on the lock screen.

Several identical purchases on the same day (for example, metro fares) are separate purchases and are recorded separately.
