INFOTo invoice a customer through a Metronome billing integration, follow the steps in Invoice with Stripe or Invoice with the Marketplaces (AWS and Azure).
Prerequisites
Before provisioning a customer you must have:- Your usage events connected to Metronome
- A billable metric
- A product
- A rate card
Create a customer
Create an individual customer object in Metronome or build a flow to create customers programmatically from system triggers.Understand ingest aliases
Ingest aliases map your internal customer identifiers to Metronome’s customer ID. When you send usage keyed on an ingest alias, Metronome automatically associates it to the correct Metronome customer. This allows you to maintain your existing customer entities without needing to swap in a Metronome customer ID. Ingest aliases can also be used to maintain account hierarchy. Enterprise customers often have sub-organizations that roll up to a single contract. Use ingest aliases to model this. For example, you can represent the enterprise organization as a customer in Metronome, with each sub-organization represented by an ingest alias attached to that customer:IngestAlias1
and later add this ingest alias to an existing customer, Metronome retroactively associates that usage to the correct customer.
Create a customer with the Metronome app
To create a customer using the app:- Go to the Customers page → Add a customer.
- Add a name.
- Add an ingest alias.
- (Optional) Set a custom field for the customer on the Settings tab.
Build a customer creation flow with the API
Use the Metronome API to build a flow for creating customers in Metronome programmatically based on sales-led or product-led motions. For a sales-led motion, you might use Salesforce CPQ to capture opportunities. When an opportunity closes, you can schedule a job to create a customer using the Metronome API. This example request shows how to:- Create a mock customer, WidgetsExpress, in Metronome
- Codify the relationship between the Metronome customer and the SFDC account by storing the
sfdc_account_id
in a custom field
Provision a customer contract
Define a contract in Metronome that encodes the products customers can access, rates for each product, and access duration. Just as rate cards are built on products, contracts are built on rate cards. A contract references a specific rate card and bundles it with other Metronome models like commits, discounts, fixed products that don’t live on the rate card, and more. Create contracts with the Metronome app or with the /contracts/create endpoint.Create a contract
Consider an example where your customer, WidgetsExpress, purchased a prepaid commit for $10,000 that applies to your cloud products. This commit lasts for a year. As part of the contract, they also pay a $1,000 platform fee each quarter to use your service. They pay for the prepaid commit once upfront and for usage on a monthly basis. To provision this contract with the Metronome app:- Navigate to Customers and select your newly created customer.
- On the Overview tab, click the + Add button on the right hand side of the Contracts pane.
- Fill in the Basic info for the contract like the contract name, start date, and rate card to use.
- Under Terms, click Add -> Commit and fill in the details for the prepaid commit.
- Under Terms, click Add -> Scheduled charges and add the platform fee as a scheduled charge.

/contracts/create
API, execute this call:
Consolidate usage and scheduled invoices
You have the option to specify if scheduled invoices should consolidate onto a customer’s usage invoices. This setting applies to all charges (including commits) on the contract. It follows this logic to determine whether to consolidate invoices:- The last day of the usage service period (exclusive) falls on the same day as the scheduled date for the scheduled invoice.
- The corresponding usage invoice hasn’t finalized.
scheduled_charges_on_usage_invoices
is set to ALL
, the contract creates these invoices:
- Invoice 1: Issued and finalized on January 1 with one line item for the $75 monthly charge.
- Invoice 2: Created in draft with one line item for the $75 monthly charge in February in addition to all usage charges for January.
- Invoice X: Assuming no changes to the contract, all future invoices will model invoice 2.
Add contract discounts and overrides
Provide discounts during contract creation or by editing an existing contract. Apply discounts with credits, overrides for product rates, price tiers, and more. If you use dimensional pricing, set price overrides for each combination of group key and product. To add additional terms like credits, commits, overrides for product rates, and more, edit the contract. Consider the example with your mock customer WidgetsExpress to see this in practice. The customer negotiated a discount on cloud products. To address this, edit the contract by overriding products with thecloud
tag to be 5% off of the basic rate card.
To edit a contract with the Metronome app, go to the WidgetsExpress customer → Contracts -> and select the contract that you would like to edit.
To edit a contract through the API, execute this call:
Create a usage filter
You can provision a customer with multiple contracts simultaneously. These contracts can use distinct rate cards, have different start and end dates, discounts, and more. They can all draw down from shared customer-level commits and credits. To specify that usage should count against one contract instead of another, create a usage filter for that contract. For example, your mock customer WidgetsExpress has three sub-divisions: US, EU, and APAC. Each division negotiated different discounts. To model this in Metronome, create a contract for each sub-division and use usage filters to ensure only the appropriate usage gets routed to each contract. When creating the US contract, ensure that only events with the propertyregion
and value US
are included in this contract using this API call:
- For streaming billable metrics, you must define the usage filter as a group key on the underlying billable metric. If you’re also using dimensional pricing and presentation group keys, the usage filter group key must be defined in a compound group key on the underlying billable metric with the dimensional pricing and presentation group keys.
- For SQL billable metrics, the group key for the usage filter must be present as property value in the underlying events (for example,
properties.region
).
Add custom fields
Use custom fields to add additional metadata to the contract or commit. This metadata can power downstream processes like revenue recognition workflows. For example, if you’re integrating with SFDC, you can create a custom field forsalesforce_opportunity_id
to map Metronome contracts, and revenue derived from it, to the associated SFDC opportunity.