Transactions
Shipped In the web app (CRM → Customer data → Transactions), the REST API and the MCP server.
A brand’s transactions are the money it takes and gives back: payments, refunds, chargebacks and credits, one row each. They are the record of revenue that metrics, product lifecycle stages, reports and Query read.
Where they come from
Section titled “Where they come from”- A billing connection. Connect Stripe or another billing tool on your own account, and each charge and refund it reads after its first full read becomes a transaction of the brand. Transactions start when the connection does: nothing from before is rebuilt.
- Your own billing, from the API:
POST /v1/brands/{brand}/transactions, or MCPrecord_transaction. - Order Completed events with revenue, sent from your servers (product events).
However a payment arrives, it is kept once and counted once: see One payment, counted once.
curl -X POST https://app.outflare.ai/v1/brands/$BRAND/transactions \ -H "Authorization: Bearer $OUTFLARE_TOKEN" -H "Content-Type: application/json" \ -d '{"kind": "payment", "amount_minor": 4900, "currency": "EUR", "source_id": "inv_1042", "record_id": "…", "product": "pro", "status": "succeeded"}'kindispayment,refund,chargebackorcredit.amount_minoris in the currency’s smallest unit (cents) and never negative: the kind says which way the money went. A refund or chargeback names the payment it gives back withrefund_of: see Refunds, counted once.source_idis your own id for it. Sending the same one again never adds it twice: the answer is the transaction already saved (200 instead of 201), with itsstatusupdated if it changed (succeeded,pending,failedorreversed).record_idis the person or company who paid. If you don’t have it, senduser_idinstead: your own id for them, theuserIdyour events send, and Outflare finds the person.productis one of the brand’s products by id or key. All three are optional, but sendrecord_idoruser_idwith every payment: without a person, a payment can’t count toward revenue by channel or your ad networks.occurred_atis when it happened. It defaults to now.
One payment, counted once
Section titled “One payment, counted once”Revenue, attribution and the conversions sent back to your ad networks count each payment as a payment.succeeded event, and each refund as payment.refunded. Every payment becomes exactly one, whichever way it arrives:
- A transaction from the API. A
succeededpayment with a person counts. Apendingone counts when you send it again assucceeded. A refund or chargeback comes off the payment it names inrefund_of. Credits never count. - An Order Completed event, sent from your server for a known person, with
revenue(ortotal, orvalue) above zero in dollars, not cents (49.00), and acurrency(the brand’s if left out). It is saved as a transaction and counted as a payment. Events from the website snippet never count as money, because anyone can send them. - A billing connection, such as Stripe.
If the same payment arrives twice, from two of these, Outflare keeps it once. It takes them as one payment when:
- They share an id. The event’s
order_idis the transaction’ssource_id(or the billing tool’s charge id). This is the reliable way, so put the same id in both. - Or, with no shared id, the same person paid the same amount in the same currency within 15 minutes.
Whichever arrives second is answered as the first. The API returns the transaction already saved (200), a billing sync skips the charge, and the order event gets an outflare_payment property naming the payment it counts as. A transaction sent without a person picks them up from its order event.
To count each payment once in reports and ad networks, use payment.succeeded, valued at amount_minor, in conversion definitions and in Send conversions back rules on the Paid ads page, not order_completed.
An Order Completed event, from your server to POST /v1/brands/{brand}/events:
{"type": "track", "userId": "u_123", "event": "Order Completed", "messageId": "order-ch_1042", "properties": {"order_id": "ch_1042", "revenue": 49.00, "currency": "USD"}}The same payment as a transaction, counted once with the event above:
{"kind": "payment", "amount_minor": 4900, "currency": "USD", "source_id": "ch_1042", "user_id": "u_123"}Send every payment that brings money in. Topping up a prepaid balance is a payment; spending that balance on a plan is not, or the same money would count twice.
Refunds, counted once
Section titled “Refunds, counted once”Refunds follow the same rule as payments. Send them as a transaction, as an event, or both, and each one counts once. The transactions API is the simplest single path for money: payments and refunds there, and events for what people do.
- A refund transaction has
kindrefund(orchargeback) and names its payment inrefund_of. Any id the payment has works: itssource_id(the order’sorder_id), its Order CompletedmessageId(order-ch_1042), or Outflare’s transaction id. - An Order Refunded event, from your server for a known person, refunds the payment its
order_idnames, the same forgiving way. Its amount isamount(orrevenue,total,value) in dollars, and the whole payment when you leave it out. Its own id isrefund_id, else itsmessageId. - If the same refund arrives both ways, it is kept once: the same refund id (the transaction’s
source_idis the event’srefund_id), or else a refund of the same payment of the same amount within 15 minutes.
A refund counts once Outflare has its payment. One that arrives first waits, and counts when the payment comes. One that names an id no payment has is listed on Developer setup under Refunds to match, to link by hand. A counted refund comes off its payment’s revenue and lowers its conversion in your ad networks.
{"kind": "refund", "amount_minor": 4900, "currency": "USD", "source_id": "re_2001", "refund_of": "ch_1042", "user_id": "u_123"}The same refund as an event, counted once with the transaction above:
{"type": "track", "userId": "u_123", "event": "Order Refunded", "messageId": "refund-re_2001", "properties": {"order_id": "ch_1042", "refund_id": "re_2001", "amount": 49.00, "currency": "USD"}}Failed payments and disputes
Section titled “Failed payments and disputes”Two more events say when a payment went wrong for a known person. Neither is money: revenue, attribution and ad conversions never count them.
payment.failed: a payment transaction sent withstatusfailed, such as a declined card. When the retry goes through, send the samesource_idassucceeded: the payment then counts, and the failure stays in the person’s history.payment.disputed: a transaction ofkindchargeback. The money still comes off as apayment.refunded.
Each is written once per source_id. Use them in segments, journeys, lifecycle moves and alerts, for example everyone whose payment failed in the last 7 days. They come from transactions sent to the API; a billing connection doesn’t write them yet.
Subscriptions from your own billing
Section titled “Subscriptions from your own billing”A billing connection writes each customer’s subscriptions as it reads them. When you bill with your own system, send them yourself: POST /v1/brands/{brand}/billing-subscriptions (MCP save_billing_subscription), once when a subscription starts and again whenever it changes.
{ "source_id": "sub_1042", "user_id": "u_123", "status": "active", "plan": "Pro", "price_id": "pro_monthly", "interval": "month", "amount_minor": 4900, "currency": "USD", "started_at": "2026-08-01T09:00:00Z"}source_idis your id for the subscription. The same one sent again updates the subscription saved and never adds a second.record_idoruser_idsays whose it is. Auser_idmust already be known: send an identify for them first.statusistrialing,active,past_dueorcanceled.amount_minoris what oneinterval(day,week,monthoryear) costs, in minor units.
What changes is written on the person’s timeline: subscription.started once, subscription.changed when the price or amount moves, and subscription.canceled once. Their monthly revenue, billing status and plan, and the brand’s Revenue page, follow. To bring in history, send every existing subscription once with its real started_at.
A subscription says what someone is signed up to pay; each charge is still a payment, sent as a transaction or an Order Completed event. GET /v1/brands/{brand}/billing-subscriptions lists them (MCP list_billing_subscriptions).
Currencies
Section titled “Currencies”Each amount is kept in its own currency and also converted to the brand’s currency (USD unless you change it on the brand) at that day’s European Central Bank rate, as brand_amount_minor. If the day’s rate isn’t published yet, it is empty and filled in within the hour.
Reading them
Section titled “Reading them”GET /v1/brands/{brand}/transactionslists them newest first. Add?record=for one person or company, or?kind=refund,chargebackfor some kinds (MCPlist_transactions).GET .../transactions/{transaction}reads one.- In Query they are the
transactionstable. For example, revenue by month:SELECT date_trunc('month', occurred_at), sum(brand_amount_minor) FILTER (WHERE kind = 'payment') FROM transactions GROUP BY 1. - Webhooks:
transaction.createdonce per transaction, andtransaction.updatedwhen its status changes.
Deleting and restoring
Section titled “Deleting and restoring”A wrong or test transaction can be deleted with Delete on the Transactions tab, POST /v1/brands/{brand}/transactions/{transaction}/delete or MCP delete_transaction. It needs permission to manage customers. The transaction goes to Recently deleted, like everything in the 7-day recovery window:
- While it is there, the list, Query and the person’s record leave it out.
- Sending the same
source_idagain doesn’t bring it back: a billing sync skips it, and the API answers409 transaction_deleted. Restore it instead. - Restoring it within 7 days puts it back as it was.
transaction.createdisn’t sent again;deletion.restoredis. If its person or company was merged since, it comes back on the record that was kept. - After 7 days it is gone for good, and the same
source_idcan be sent again. - The webhook event is
transaction.deleted.
A transaction is your business’s record of money. Merging two records moves their transactions to the one kept, and erasing a person keeps their transactions without their name, including any waiting in Recently deleted.