Track Payment
track_paymentRecord analytics payments and refunds to attribute revenue without charging customers or moving money; skip it when a connected payment provider already tracks revenue to avoid double counting.
Instructions
Record an analytics payment; this never charges a customer, moves money, or issues a refund. Revenue appears in get_overview, get_timeseries, every breakdown's revenue column, and the visitor profile. Skip it when the site's provider (Stripe, LemonSqueezy, Polar, and other connected providers) is tracked automatically, or the revenue is counted twice; use track_goal for conversions without revenue. transactionId must be unique: a repeated id is rejected, not deduplicated. A new payment also records a payment goal completion (free_trial when amount is 0); isRenewal skips that. isRefund with an existing transactionId overwrites that payment's recorded refund amount and any supplied customer attribution instead of adding a row. Attribution looks up a known visitor by visitorUid, customerId, or email; with no match the revenue is kept but its source shows as Unknown. Send email and name only when the user supplied them and wants the payment attributed. Undo with delete_payments. Requires websiteId or domain with a workspace token.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"amount": "<amount>",
"currency": "<currency>",
"transactionId": "<transactionId>"
},
"name": "track_payment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Customer name shown on the payment | |
| No | Customer email, used only to attribute the payment to a known visitor | ||
| amount | Yes | Payment amount in major currency units (e.g. 29.99). With isRefund, the amount refunded. 0 records a free_trial goal instead of a payment goal. | |
| domain | No | Website domain from list_websites (e.g. "example.com"). Alternative to websiteId with a workspace token. | |
| currency | Yes | Currency code (e.g. "USD", "EUR") | |
| isRefund | No | True to record a refund that already happened. With an existing transactionId, marks that payment refunded by amount instead of creating a new record. | |
| timezone | No | The visitor's IANA timezone (e.g. "Europe/Berlin"). Helps place the visitor in a country when the call comes from a server or proxy. | |
| isRenewal | No | True for recurring or renewal charges. Renewals count in revenue but do not record the automatic payment goal. | |
| timestamp | No | ISO 8601 time the payment happened (e.g. "2026-01-15T10:30:00Z"), for backfilling. Defaults to now. | |
| websiteId | No | Website ID from list_websites. Required with a workspace token unless domain is given; ignored with a website key. | |
| customerId | No | Customer ID from the payment provider. Also used to find the visitor when visitorUid is absent. | |
| customerIp | No | The buyer's IP address at checkout, for a server-side call that cannot match the payment to a visitor. Flowsery keeps only the country it resolves from it. | |
| sessionUid | No | Session ID of the visitor's current session (the _fs_sid value), so the payment is tied to that session | |
| visitorUid | No | Anonymous visitor ID Flowsery assigned on the user's own website (the _fs_vid value). Without it, or a customerId or email matching a known visitor, the payment is attributed to Unknown. | |
| workspaceId | No | Workspace to act in: an id from list_workspaces. Omit to use the default workspace. Use the same workspaceId for every call about the same workspace, since ids from one workspace do not exist in another | |
| transactionId | Yes | Unique transaction ID from the payment provider. Must not repeat across payments; reuse it only with isRefund to mark that payment refunded. | |
| customerUserAgent | No | The buyer's User-Agent at checkout, for the same case. Flowsery keeps the browser, OS and device it resolves from it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |