Loading
Manage Your Billing Processes with Salesforce Billing
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Custom Usage Summaries

          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.

          Tip
          Tip To indicate to your code that a certain usage summary is to be deleted or ignored, create an attribute, or update the Matching ID or attribute with a value.

          This table lists the required fields and relationships for creating a custom usage summary for loading usage.

           Required for Consumption Schedule ModelRequired for Legacy Usage ModelRequired Value
          Order Product Checkmark icon indicating true Checkmark icon indicating true Related order product
          Summary Start Date Checkmark icon indicating true Checkmark icon indicating true Start date of period
          Summary End Date Checkmark icon indicating true Checkmark icon indicating true End date of period

          Order Product Consumption Schedule

          (consumption schedule usage only)

          Checkmark icon indicating true   Related order product consumption schedule

          Price Schedule

          (legacy usage only)

            Checkmark icon indicating true Related price schedule
          Invoice Run Processing Status Checkmark icon indicating true Checkmark icon indicating true Pending Billing
          Matching ID Checkmark icon indicating true Checkmark icon indicating true Per design

          Matching Attribute*

          (consumption schedule usage only)

          Checkmark icon indicating true   Per design

          Unit of Measure*

          (consumption schedule usage only)

          Checkmark icon indicating true   Per design
          Status Checkmark icon indicating true Checkmark icon indicating true New
          Unbilled Subtotal      
          Unbilled Quantity      
          Source Checkmark icon indicating true Checkmark icon indicating true 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.

          Tip
          Tip To reduce the number of unneeded records in your system, create an attribute, or update the Matching ID or attribute with a value to indicate to your code that a certain usage summary is to be deleted.

          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 Checkmark icon indicating true Checkmark icon indicating true Related order product
          Summary Start Date Checkmark icon indicating true Checkmark icon indicating true Start date of period
          Summary End Date Checkmark icon indicating true Checkmark icon indicating true End date of period

          Order Product Consumption Schedule

          (consumption schedule usage only)

          Checkmark icon indicating true    

          Price Schedule

          (legacy usage only)

            Checkmark icon indicating true Related price schedule
          Invoice Run Processing Status Checkmark icon indicating true Checkmark icon indicating true Pending Billing
          Matching ID Checkmark icon indicating true Checkmark icon indicating true  

          Matching Attribute

          (consumption schedule usage only)

          Checkmark icon indicating true    

          Unit of Measure

          (consumption schedule usage only)

          Checkmark icon indicating true    
          Status Checkmark icon indicating true Checkmark icon indicating true Queued for Invoice
          Unbilled Subtotal Checkmark icon indicating true Checkmark icon indicating true Subtotal to be invoiced
          Unbilled Quantity Checkmark icon indicating true Checkmark icon indicating true Quantity to appear on invoice line
          Source Checkmark icon indicating true Checkmark icon indicating true 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.
           
          Loading
          Salesforce Help | Article