# Margin per customer

Available on Pro and Team.

## Connect Stripe

1. In your Stripe dashboard, create a **restricted key** (`rk_live_...`) with **Read** access to **Invoices** and **Customers**, and nothing else.
2. Paste it under Settings › Connections › Stripe revenue.

Veqen imports 90 days of paid invoices right away, then refreshes the last 35 days every six hours.

## Matching customers

Revenue is the paid amount of each USD invoice, excluding tax, on the day it was paid. It's matched to your calls' `customer` tag by:

1. `metadata.veqen_customer` on the Stripe customer, if set, otherwise
2. the Stripe customer id (`cus_...`).

The simplest setup is to tag calls with the same id you store on the Stripe customer. If your tags are your own org ids, add them to each Stripe customer as `veqen_customer` metadata.

## The report

The Customers page then shows revenue, AI cost, margin in dollars and margin percent per customer, sorted with unprofitable customers first, plus totals for the period. The MCP tools `get_margin` and `get_customer_cost` answer the same questions from Claude or Cursor.

Invoices in other currencies are skipped for now; contact us if you bill in more than one currency.
