Validate usage and metering
Invoice accuracy starts with usage ingestion. Verifying and matching required usage event fields to active billable metrics ensures customers are charged what they used. Verify and check that:- all required event fields are present:
transaction_id
customer_id
(or alias)timestamp
event_type
properties
Follow a maximalist approach for properties: send as much metadata as possible, even if not pricing-relevant today, to future-proof your integration.
- idempotency is enabled for ingest events via
transaction_id
. Visit the docs here for guidance on choosing a goodtransaction_id
. - billable metrics are active and correctly match events by sampling Metronome’s searchEvents endpoint.
- usage events are queued through a reliable message queue (e.g., SQS, RabbitMQ) and that backdated usage up to 14 days is correctly ingested.
- the ingestion pipeline is load tested to handle expected peak throughput.
- fault injection tests are performed by simulating ingestion failures. Coordinate with Metronome if you need help setting this up.
Confirm pricing and product setup
Pricing accuracy is critical. Double-check that rate cards and overrides in production reflect your intended setup so invoices remain consistent and predictable. Verify and check that:- the correct products (usage, composite, subscription, fixed) are being used; and configure tags, conversions, and group keys.
- usage products are mapped to the intended billable metric.
- the rate card is correct (currency, products, tiers/changes).
Provision customers and contracts
Customers must exist in Metronome and be linked to contracts for billing to start. This mapping ensures all usage is attributed to the right account with the right pricing. Verify and check that:- customers are created and, optionally, the ingest aliases are mapped correctly.
- contracts are provisioned against the correct rate card and billing frequency.
Verify invoicing and payment flows
Customers expect smooth, accurate billing. Confirm invoices and payments are flowing correctly before launch. Verify and check that:- that the invoice lifecycle is understood by your teams (draft → grace period → finalized).
- that the
invoice.finalized
webhook is enabled and tested. - the delivery path is confirmed for your chosen integration.
Secure production environment
Before launch, ensure that you’re running against production credentials, not sandbox. Using the correct API tokens gives you the foundation for secure, auditable billing that finance can reconcile and trust. Verify and check that:- the production API token is created and stored securely.
- IP allowlisting is enabled, if required.
- all API endpoints point to production URLs (
https://api.metronome.com
)
Configure webhooks and error handling
Billing is only reliable if your system knows when things go wrong or statuses change. Webhooks keep your systems in sync (invoice finalization, alert triggers), and retry/backoff/error-handling ensure no usage or revenue is lost. Verify and check that:- the webhook endpoint is online and secured with signature verification using your Metronome webhook secret.
- your retry/backoff policy is functional: retry on 5xx/network, backoff on 429, DLQ + alert on 4xx.
- webhook processing is idempotent (safe on duplicate deliveries).
Set up monitoring
You can’t improve what you can’t see. Alerts keep you ahead of customer balance issues. Verify and check that:- spend, credit, and commit alerts are configured.
- webhook notifications are firing for alerts in a timely manner.
- monitoring is in place on webhook delivery and ingest error rates.
Configure data export
Data Export provides an auditable record of invoices, usage, and customer data outside Metronome. Enabling it ensures finance and RevOps can reconcile billing independently. Verify and check that:- Data Export is enabled for your production environment.
- the export destination (e.g., warehouse, S3) is configured and receiving data.
- sample exports contain the expected objects (invoices, customers, usage).
- reconciliation processes are defined so finance can validate invoice data against exported usage.
Run final end-to-end test
Finally, simulate one end-to-end cycle in production. This gives confidence that invoices, totals, and payments line up in the real environment, to avoid exposing customers to errors.- Verify and check that sandbox-to-production migration is complete.
- Run a production dry run with a test customer: send events → confirm invoice totals → verify webhook → confirm successful payment processing.
- Document rollback procedures in case of critical issues.