You are here:
Custom Usage Summaries
It’s possible to create custom usage summaries and associate them to order products derived from products configured with charge type Usage (legacy usage product) or with charge type Recurring plus one or more related consumption schedules (usage based pricing, or UBP). (Salesforce Billing Managed Package)
Required Editions
| Available in: All Salesforce Billing Editions |
Salesforce Billing recommends the consumption schedule model of usage.
In many use cases, the solution involves creating usage summaries beyond what is created with order product generation. Invoice line start and end dates align with the usage summary start and end dates so you can create custom usage summaries to support invoicing customers on different cadences that support your business requirements.
Use Case Example 1
This use case is a nonstandard cadence for invoicing a usage product that uses Salesforce Billing to rate Usage records against a usage summary.
You can create the usage summaries at any time before Usage records are loaded for rating. The order product can be in Activated status and still create and associate a new usage summary to it.
To get the best-performing environment, during your design phase, consider what other records are being created or updated and when.
Remember that four recurring billing frequencies (monthly, quarterly, annual, and semiannual) are supported. To avoid unpredictable results, don’t add a custom picklist value for the Billing Frequency global value set. Depending on the billing frequency of the product, you can end up with unneeded usage summaries that you must delete or ignore.
This table lists the required fields and relationships for creating a custom usage summary for loading usage.
| Required for Consumption Schedule Model | Required for Legacy Usage Model | Required Value | |
|---|---|---|---|
| Order Product | ![]() |
![]() |
Related order product |
| Summary Start Date | ![]() |
![]() |
Start date of period |
| Summary End Date | ![]() |
![]() |
End date of period |
Order Product Consumption Schedule (consumption schedule usage only) |
![]() |
Related order product consumption schedule | |
Price Schedule (legacy usage only) |
![]() |
Related price schedule | |
| Invoice Run Processing Status | ![]() |
![]() |
Pending Billing |
| Matching ID | ![]() |
![]() |
Per design |
Matching Attribute* (consumption schedule usage only) |
![]() |
Per design | |
Unit of Measure* (consumption schedule usage only) |
![]() |
Per design | |
| Status | ![]() |
![]() |
New |
| Unbilled Subtotal | |||
| Unbilled Quantity | |||
| Source | ![]() |
![]() |
External |
*Not technically required but highly recommended to incorporate in your overall design
Use Case Example 2
This use case is for generating an invoice from a custom usage summary with no Usage records loaded.
This method is typically used with an external usage mediation and rating process. It can also be used to bill on demand or on a nonstandard cadence. These usage summaries are used to generate invoices.
Because no usage is being rated, no order product consumption schedule is needed when you’re using the consumption schedule model. With legacy usage, a Price Schedule lookup is still required.
Remember that four billing frequencies (monthly, quarterly, annual, and semiannual) are supported. Depending on how the product is configured, you get unneeded usage summaries when the order product is created, which you must delete or ignore.
This table lists the required fields and relationships for creating a custom usage summary using direct invoicing.
| Required for Consumption Schedule Model | Required for Legacy Usage Model | Required Value | |
|---|---|---|---|
| Order Product |
|
|
Related order product |
| Summary Start Date |
|
|
Start date of period |
| Summary End Date |
|
|
End date of period |
Order Product Consumption Schedule (consumption schedule usage only) |
|
||
Price Schedule (legacy usage only) |
|
Related price schedule | |
| Invoice Run Processing Status |
|
|
Pending Billing |
| Matching ID |
|
|
|
Matching Attribute (consumption schedule usage only) |
|
||
Unit of Measure (consumption schedule usage only) |
|
||
| Status |
|
|
Queued for Invoice |
| Unbilled Subtotal |
|
|
Subtotal to be invoiced |
| Unbilled Quantity |
|
|
Quantity to appear on invoice line |
| Source |
|
|
External |
After you save the manually created usage summary, billing triggers populate these fields.
- Unique ID
- Next Billing Date (This date is derived from the criteria set at the related order product.)
Creating Usage Summaries
You can create custom usage summaries in these ways.
- Manually (by user)
- Flow or automated process via Apex
- Data Loader
Usage summaries created via standard functionality also have these fields populated.
- Status = New
- Source = Standard
- Unit Price
- Unbilled Quantity = 0
- Invoice Run Processing Status = Pending Billing
- Invoice Run Status (Index) = Pending Billing
Design Considerations
- If a custom usage summary is created manually and overlaps the time frame of another usage summary, make sure that you assign it a matching ID that’s different from the matching ID of the other usage summary. Otherwise, if usage is loaded that matches multiple usage summaries, the usage can be associated to any one of those summaries.
- For evergreen subscription products configured by consumption schedule, at order creation, 12 usage summaries are created, with the length of each summary corresponding to the billing term and billing term unit set on the consumption schedule. Whenever usages records are loaded with Matching ID, Matching Attribute, and Unit of Measure criteria that the system has a record of, the package creates other usage summaries to support loading and rating processes.
- Salesforce Billing doesn’t support configuring a product as Charge Type = Usage and Subscription Type = Evergreen and adding usage summaries via a custom process using the information in this topic.


