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
CustomInstallment
field on invoice as formula - Setting installment type to
Custom
- Creating
CustomInstallment
field on invoice as text area - Creating
ON_CustomInstallment
on subscription or GIR source as formula - Creating
ON_InstallmentType
on subscription or GIR source set toCustom
Configuring Installment on Invoice
Creating Formula Field Custom Installment
Create the field to hold the 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 CustomInstallment
Formula (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
Custom
to theInstallment Type
field picklist on Invoice object.To allow for applying variable installments, you must add the value
Custom
to the value picklist for theInstallment Type
field of the Invoice object.- Navigate to the
Installment Type
field of the Invoice object. - In the Values section, click New.
- Type
Custom
into the text area. - Click Save.
- Navigate to the
-
Set
Installment Type
toCustom
on 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 Type
field 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 CustomInstallment
Text 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_CustomInstallment
Formula (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
CustomInstallment
on 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_InstallmentType
Text Custom
This will copy the value
Custom
to the Invoice fieldInstallment Type
on invoice generation, enabling the custom installment.