Dillo Flows
Money & expenses, template v1

Payment received → ledger row

The moment a payment succeeds, it is written as a row in the ledger sheet — amount, currency, customer, and invoice — assembled mechanically from the payment event itself, so the books are never waiting on someone to type it in.

Starts when: stripe.payment.succeeded. Produces: Ledger row result. Steps: 4
Sample run — illustrative, not a record of a real run
paymentId
pay_881
amountCents
800
currency
usd
customerEmail
client@example.com
invoiceId
inv_104
paidAt
2026-11-09T22:00:00Z
1Shape the note2Write it back3Send it onward4The result

Sample result: Ledger row written for payment pay_881.

What each step does

Step 1 · Shape the note

The wording of the note is shaped from the fields picked below.

Payment · IDPayment · Amount (cents)Payment · CurrencyPayment · CustomerPayment · Invoice

Step 2 · Write it back

The outcome is posted back through the connection you name. The secret stays sealed; the step carries the name only.

Payment · IDPayment · Amount (cents)Payment · CurrencyPayment · CustomerPayment · InvoicePayment · Paid at

Step 3 · Send it onward

Step 4 · The result

This is what the run hands back, written into the run's record where you can read it.

Payment · ID

What you'll fill in

These are the only things the template asks of you. Examples teach the shape — they are never values your flow runs on; what you type (or the stated starting value) is what gets used.

FieldWhat to put in itExample
Ledger sheetThe connection, by name, that can append rows to the ledger sheet.A connection you name — never a key pasted here

Set it up

  1. Fill in the fields below.
  2. Name the connections it needs — by name only.
  3. Look at the trigger preview: what would start a run, counted before anything is armed.
  4. Review the steps, the rules, and every place a person is asked.
  5. Create it — then run it once yourself, and read the run's record.
Creating never arms the trigger. The flow is created switched off: no runs start for things that already match. Arming is a separate tap on the created flow, after you have seen the preview count.

Use this template

The connection, by name, that can append rows to the ledger sheet.

Connections are named, sealed, and never shown again. Add one in the console's setup, then pick it here by name.

Sign in to preview what this trigger would match in your space.

The definition

The whole mechanism, before you take it. Package checksums: sha256:de57cd96437d… · sha256:bacd419eab2e… · sha256:f6da176bc05b…. A flow made from this template carries this template's name and version in its record, and exports in the standard bundle with that provenance.

Advanced · the three files, as written
{
  "trigger.json": {
    "template": {
      "slug": "payment-received-ledger-row",
      "version": 1,
      "name": "Payment received → ledger row",
      "category": "money-expenses",
      "outcome": "The moment a payment succeeds, it is written as a row in the ledger sheet — amount, currency, customer, and invoice — assembled mechanically from the payment event itself, so the books are never waiting on someone to type it in.",
      "outputName": "Ledger row result",
      "fits_when": [
        "online_payments"
      ],
      "needs": [
        "connection:sheet"
      ]
    },
    "trigger": {
      "type": "stripe.payment.succeeded",
      "source": "stripe",
      "manifestFields": {
        "paymentId": "string!",
        "amountCents": "int!",
        "currency": "string!",
        "customerEmail": "string",
        "invoiceId": "string",
        "paidAt": "iso!"
      }
    },
    "inputConvention": "envelope",
    "variables": [
      {
        "name": "sheetConnection",
        "kind": "connection",
        "label": "Ledger sheet",
        "instruction": "The connection, by name, that can append rows to the ledger sheet."
      }
    ],
    "sample": {
      "input": {
        "paymentId": "pay_881",
        "amountCents": 800,
        "currency": "usd",
        "customerEmail": "client@example.com",
        "invoiceId": "inv_104",
        "paidAt": "2026-11-09T22:00:00Z"
      },
      "output": "Ledger row written for payment pay_881."
    }
  },
  "flow.json": {
    "name": "Payment received → ledger row",
    "inputConvention": "envelope",
    "clefIn": [
      {
        "ruleset": "payment-ledger-guard",
        "ids": [
          "payment-has-amount"
        ]
      }
    ],
    "steps": [
      {
        "type": "transform",
        "template": {
          "segments": [
            {
              "text": "Payment "
            },
            {
              "field": {
                "source": "trigger",
                "name": "paymentId",
                "label": "Payment · ID"
              }
            },
            {
              "text": ": "
            },
            {
              "field": {
                "source": "trigger",
                "name": "amountCents",
                "label": "Payment · Amount (cents)"
              }
            },
            {
              "text": " "
            },
            {
              "field": {
                "source": "trigger",
                "name": "currency",
                "label": "Payment · Currency"
              }
            },
            {
              "text": " from "
            },
            {
              "field": {
                "source": "trigger",
                "name": "customerEmail",
                "label": "Payment · Customer"
              }
            },
            {
              "text": ", invoice "
            },
            {
              "field": {
                "source": "trigger",
                "name": "invoiceId",
                "label": "Payment · Invoice"
              }
            },
            {
              "text": "."
            }
          ]
        }
      },
      {
        "type": "http",
        "method": "POST",
        "connectionFromVariable": "sheetConnection",
        "url": "https://sheets.example.com/rows",
        "body": {
          "segments": [
            {
              "text": "{\"paymentId\": \""
            },
            {
              "field": {
                "source": "trigger",
                "name": "paymentId",
                "label": "Payment · ID"
              }
            },
            {
              "text": "\", \"amountCents\": "
            },
            {
              "field": {
                "source": "trigger",
                "name": "amountCents",
                "label": "Payment · Amount (cents)"
              }
            },
            {
              "text": ", \"currency\": \""
            },
            {
              "field": {
                "source": "trigger",
                "name": "currency",
                "label": "Payment · Currency"
              }
            },
            {
              "text": "\", \"customerEmail\": \""
            },
            {
              "field": {
                "source": "trigger",
                "name": "customerEmail",
                "label": "Payment · Customer"
              }
            },
            {
              "text": "\", \"invoiceId\": \""
            },
            {
              "field": {
                "source": "trigger",
                "name": "invoiceId",
                "label": "Payment · Invoice"
              }
            },
            {
              "text": "\", \"paidAt\": \""
            },
            {
              "field": {
                "source": "trigger",
                "name": "paidAt",
                "label": "Payment · Paid at"
              }
            },
            {
              "text": "\"}"
            }
          ]
        }
      },
      {
        "type": "dispatch",
        "channel": "event",
        "name": "finance.payment.logged"
      },
      {
        "type": "output",
        "value": {
          "segments": [
            {
              "text": "Ledger row written for payment "
            },
            {
              "field": {
                "source": "trigger",
                "name": "paymentId",
                "label": "Payment · ID"
              }
            },
            {
              "text": "."
            }
          ]
        }
      }
    ]
  },
  "rules.json": {
    "rulesets": [
      {
        "name": "payment-ledger-guard",
        "version": 1,
        "rules": [
          {
            "id": "payment-has-amount",
            "on": "step.payload.amountCents",
            "op": "missing",
            "action": "block",
            "msg": "A payment event without an amount cannot be entered in the ledger."
          }
        ]
      }
    ],
    "permissions": {
      "approvals": {
        "approveBeforeSteps": [],
        "rejectRequiresComment": true,
        "dueSeconds": 259200,
        "onExpire": "continue"
      },
      "connections": {
        "required": [
          {
            "nameFromVariable": "sheetConnection",
            "usedBySteps": [
              1
            ]
          }
        ],
        "optional": []
      }
    }
  }
}

All templates   See the system: Link Map