Before you begin
- Create a meter in Billing > Meters with a sum aggregation. CostGraph reports against its event name.
- Attach a usage-based price to the meter. Price per cent, or use a transform quantity to group 100 units into one priced dollar.
- Copy a secret key from Developers > API keys. A test key exercises the whole flow without invoicing anyone.
Connect
1
Connect the account
In Integrations, click Stripe and enter the secret key. CostGraph
verifies the key against Stripe before it saves anything, and stores it
encrypted.
2
Bind a meter
Bind a
stripe_ tag key to one of your active meters. CostGraph lists
meters by event name.Tag spend by customer
The tag value must be a Stripe customer id, such ascus_NciAYcXfLnqBoz.
Stripe rejects an event for a customer that doesn’t exist, and CostGraph
records the day with the rejection instead of billing it. Customer ids are
opaque, so check the tag’s values against your Stripe customers before you
bind the meter.
Event payload
Each customer-day is one meter event. Itsidentifier is derived from the day
and the totals, so a run retried inside Stripe’s deduplication window counts
once. The payload carries the following keys along with the shared
reconciliation fields:
Stripe reads the keys your meter is configured with and stores the rest with
the event.
Corrections are sent as the difference, so a day revised downward sends a
negative value. The meter must use a sum aggregation for the total to
settle.