action.skip

Enabling Multiple Party Billing

← Setting Up Billing Automation

Generally, JustOn Billing & Invoice Management is set up to issue invoices to one recipient, usually via the account associated to the corresponding source record. Certain business use cases require billing to multiple parties, however – like, for example, in a marketplace scenario.

Typical multiple billing scenario

In a typical setup, the marketplace operator connects merchants (the providers of the traded products) and the buyers (the recipients of the products), processing all transactions between these players. Consequently, the marketplace operator bills the same products to multiple parties: they issue credits to merchants for payouts, and invoices to buyers to receive payments.

marketplace
Billing products to merchants and buyers

This document assumes this example to illustrate how to set up your source data to be billed to multiple recipients.

Generally, JustOn supports multiple party billing in the following contexts:

Enabling multiple party billing usually involves the following tasks:

Info

The individual scenarios may require additional configuration tasks. This is covered with the corresponding topics.

Once having set up multiple billing, you can execute two different invoice runs – one for each filter in order to create individual invoices for the merchant and the buyer.

Creating Recipient-Specific Controlling Fields

As explained in Enabling Usage Data Billing and Billing Arbitrary Objects, the objects based on which usage data is itemized or, respectively, invoices are built require a number of ON fields as controlling fields. To support multiple party billing, these source objects require individual, recipient-specific sets of these controlling fields in order to allocate the correct data to the different recipients. To this end, you add an individual suffix string to the controlling fields – following the marketplace example, Merch and Buy.

Note

The suffix length must not exceed five characters.

  1. Navigate to the fields list of the source object.
  2. Create and configure the required controlling fields for both the merchant and the buyer.

    For the fields required for usage data billing, see Configuring Custom Object.

    For the fields required for the generic invoice run, see Configuring Parent Object or Configuring Source Object.

Recipient-specific fields for usage data billing

Merchant-Specific Fields Buyer-Specific Fields
ON_TypeMerch ON_TypeBuy
ON_OrderNoMerch ON_OrderNoBuy
ON_SubscriptionMerch ON_SubscriptionBuy
ON_InvoiceMerch ON_InvoiceBuy
... ...

Recipient-specific fields for the generic invoice run

Merchant-Specific Fields Buyer-Specific Fields
ON_AccountMerch ON_AccountBuy
ON_TemplateMerch ON_TemplateBuy
ON_ServiceDateMerch ON_ServiceDateBuy
ON_InvoiceMerch ON_InvoiceBuy
ON_LastInvoiceRunMerch ON_LastInvoiceRunBuy
ON_InvoiceBuildErrorMerch ON_InvoiceBuildErrorBuy
... ...

Info

Remember that with usage data billing, JustOn makes a distinction between controlling fields and data fields (see Fields on Custom Objects). When billing usage data to multiple parties, be aware that JustOn does not support suffixed data fields. To use recipient-specific data fields required for usage data billing, configure them individually on the recipient-specific items (subscription items).

Creating Recipient-Specific Filters

To support multiple billing, you must configure recipient-specific filters. To this end, you add an individual suffix string to the transaction filters – following the example, Merch and Buy.

Note

The suffix length must not exceed five characters.

  1. Click to enter Setup, then open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Filters.

  3. Create the filters as necessary.

    For details about the filter for usage data billing, see Creating Transaction Filter.

    For details about the filter for the generic invoice run, see Creating Invoice Run Filter.

Recipient-specific filters for usage data billing

Field Merchant-Specific Filter Value Buyer-Specific Filter Value
Name Merchant Buyer
Target MyObject__c MyObject__c
Use Case Transaction
Continuous
Transaction
Continuous
Condition SOQL WHERE clause SOQL WHERE clause
Transactional Suffix Merch Buy

Recipient-specific filters for the generic invoice run

Field Merchant-Specific Filter Value Buyer-Specific Filter Value
Name Merchant Buyer
Target Order Order
Child Relation OrderItems OrderItems
Use Case Generic Generic
Transactional Suffix Merch Buy

Configuring Recipient-Specific Templates

To support multiple billing, you can configure two recipient-specific invoice templates with individually configured texts or table definitions.

  1. Create and configure two recipient-specific templates – one for the merchant, and one for the buyer.
  2. For each template, specify the text field values and table configurations as required.

    For details, see Working With Templates.

Info

In table configurations (invoice line item table, transaction table, etc.), you must use the invoiceFieldName variable to retrieve the recipient-specific records.

Merchant-specific transaction table configuration:

[{
"active" : true,
"title" : "Billed Orders",
"name" : "Order",
"fields" : [ "EffectiveDate", "TotalAmount" ],
"invoiceFieldName" : [ "ON_InvoiceMerch__c" ]
}]

Buyer-specific transaction table configuration:

[{
"active" : true,
"title" : "Billed Orders",
"name" : "Order",
"fields" : [ "EffectiveDate", "TotalAmount" ],
"invoiceFieldName" : [ "ON_InvoiceBuy__c" ]
}]

Next steps:

Configuring Multiple Currency Billing
Enabling Usage Data Billing
Billing Arbitrary Objects