Configuring Variable Installments
DE Ratenzahlung
FR versements échelonnés
Variable installments use a JSON configuration that can include variable data for complex, customer-specific payment terms that cannot be handled by fixed settings.
When to use service period-based installments
Typical use cases for service period-based installments include, for example
- Individual customer negotiations requiring custom terms
- Account-specific payment amounts or schedules
- Complex payment calculations based on variable invoice data
- Dynamic payment plans that change based on certain conditions
Understanding JSON configuration
The JSON configuration for installments uses the same information and follows the same rules as the custom setting. The keys amount, dateReference, period, and rate are used and work exactly the same way. The titles key, however, differs – it expects the data in a map structure like "index" : { "language" : "value" } (see Overwriting Titles for Individual Installments and Languages).
Assume, for example, a payment plan that involves two installments, with a fixed first amount of 100. The corresponding JSON configuration would look like this:
{
"period": "1m(2)",
"amount": "100",
"titles": {
"default":{
"default":"Installment [PosNo]",
"de":"Rate [PosNo]"
}
}
}
As another example, assume you want to create installments for every quarter between the service period start and the service period end of an invoice. Note that in this case, you do not need to provide an amount or rate, as JustOn calculates the installments as the sum of the proportional distribution of the invoice line item amounts. The corresponding JSON configuration would look like this:
{
"period": "Service Quarter",
"titles": {
"default":{
"default":"Installment [PosNo]",
"de":"Rate [PosNo]"
}
}
}
As an example, assume that you want to create a payment plan that involves six monthly installments, with a fixed first installment whose amount is fetched from the custom Account field First Installment, and the remainder evenly split into five subsequent payments.
The setup differs depending on whether you define the installment configuration on the invoice or fetch it from the subscription or the GIR source object.
- Creating
CustomInstallmentfield on invoice as formula - Setting installment type to
Custom
- Creating
CustomInstallmentfield on invoice as text area - Creating
ON_CustomInstallmenton subscription or GIR source as formula - Creating
ON_InstallmentTypeon subscription or GIR source set toCustom
Configuring Installment on Invoice
Creating Formula Field Custom Installment
Create the field to hold the formula that yields the JSON configuration:
- Navigate to the fields list of the Invoice object (
ONB2__Invoice__c). -
Create the following new field.
Field Name API Name Data Type Custom Installment CustomInstallmentFormula (Text) As soon as you want to retrieve values from other fields, you use a formula. Make sure that in this case, you must apply Salesforce's rules for building formula fields (see Build a Formula Field in the Salesforce Help), namely enclosing the strings with quotation marks and combining the strings with the concatenation operator.
Following the example, the formula to produce the JSON as required would look as follows:
'{' & ' "period": "1m(6)",' & ' "amount": "' & TEXT(ONB2__Account__r.First_Installment__c) & '",' & ' "titles": {' & ' "default":{' & ' "default":"Installment [PosNo]",' & ' "de":"Rate [PosNo]"' & ' },' & ' "1":{' & ' "default":"Deposit",' & ' "de":"Anzahlung"' & ' }' & ' }' & '}'
Setting Installment Type to Custom
If you apply variable installments using the CustomInstallment field, make sure to set the Installment Type field on the invoice (or the source object) to Custom.
-
Add
Customto theInstallment Typefield picklist on Invoice object.To allow for applying variable installments, you must add the value
Customto the value picklist for theInstallment Typefield of the Invoice object.- Navigate to the
Installment Typefield of the Invoice object. - In the Values section, click New.
- Type
Custominto the text area. - Click Save.
- Navigate to the
-
Set
Installment TypetoCustomon invoices using variable installments.You can have users apply the custom installment manually, or use the ON field mechanism, Salesforce flows or other automation tools to have the
Installment Typefield set automatically.
Fetching Installment Configuration From Source
Creating Text Field Custom Installment
Create the target field to hold the fetched JSON configuration on the invoice:
- Navigate to the fields list of the Invoice object (
ONB2__Invoice__c). -
Create the following new field.
Field Name API Name Data Type Custom Installment CustomInstallmentText Area This field will be filled from a source object on invoice creation.
Creating Custom Installment Formula Field on Invoice Source
Create the field to hold the formula that yields the JSON configuration on the subscription or the source object for the generic invoice run:
- Navigate to the fields list of the Subscription object or the relevant GIR source object.
-
Create the following new field.
Field Name API Name Data Type Custom Installment ON_CustomInstallmentFormula (Text) As soon as you want to retrieve values from other fields, you use a formula. Make sure that in this case, you must apply Salesforce's rules for building formula fields (see Build a Formula Field in the Salesforce Help), namely enclosing the strings with quotation marks and combining the strings with the concatenation operator.
Following the example, the formula to produce the JSON as required would look as follows:
'{' & ' "period": "1m(6)",' & ' "amount": "' & TEXT(ONB2__Account__r.First_Installment__c) & '",' & ' "titles": {' & ' "default":{' & ' "default":"Installment [PosNo]",' & ' "de":"Rate [PosNo]"' & ' },' & ' "1":{' & ' "default":"Deposit",' & ' "de":"Anzahlung"' & ' }' & ' }' & '}'The produced JSON will be copied to the Invoice field
CustomInstallmenton invoice generation.
Creating Installment Type Field on Invoice Source
To set the installment type to Custom on invoice creation, you create the field ON_InstallmentType on the subscription or the GIR source object:
- Navigate to the fields list of the Subscription object or the relevant GIR source object.
-
Create the following new field.
Field Name API Name Data Type Value Custom Installment ON_InstallmentTypeText CustomThis will copy the value
Customto the Invoice fieldInstallment Typeon invoice generation, enabling the custom installment.