Payment Integration predicates

Elevate, May 20-22-2025, Miami Beach, Florida

Learn how to display Payment Integrations based on specific conditions.

With Payment Integration predicates you can define the conditions for displaying Payment Integrations in the checkout process. By setting predicates, you can tailor the availability of Payment Integrations based on particular criteria, such as the cart amount or the customer group, to offer an optimized checkout experience to your customers.

Predicates are conditional statements with a specific syntax that operate on a true/false logic. If the predicate evaluates as true, the Payment Integration is displayed. If it evaluates as false, the Payment Integration is not displayed.

You can set Payment Integration predicates when creating or editing an Application for both Checkout modes.

You can set Payment Integration predicates only for Payment Integrations rendered via the web components Payment Integration Type.

Predicate syntax

Payment Integration predicates follow the JSONata query syntax and consist of the following elements:

  • Predicate field identifiers, which can reference all fields of a Cart.
  • Operators, which create logical comparisons between values.
  • Values, which are data to compare with the values of the Cart fields.

For example, let's see this predicate:

billingAddress.country = "DE"

In this example:

  • The predicate field identifier is billingAddress.country.
  • The operator is =.
  • The value is "DE".

In plain English the predicate reads: The country of the billing address is Germany.

You can also combine conditions within a predicate using either the and or or operators, as in the following example:

customerGroup.id = "aef9cf41-94ad-4794-8122-62d308900430" and billingAddress.country = "DE"

In plain English, the predicate reads: The ID of the customer group is aef9cf41-94ad-4794-8122-62d308900430 and the country of the billing address is Germany.

Predicate logic

Payment Integration predicates operate on a true/false logic and they are evaluated against the values of the Cart fields, including Custom Fields.

If the predicate evaluates as true, the Payment Integration is displayed among those available for the checkout. If it evaluates as false, the Payment Integration is not displayed.

For example, if you set a predicate to display the PayPal Payment Integration when the total price of the cart is greater than or equal to 100 Euro, then the predicate is evaluated in one of the following ways:

  • The total amount of the cart is 120 Euro, so PayPal is displayed.
  • The total amount of the cart is 90 Euro, so PayPal is not displayed.

Now let's look at this example from a technical point of view. The following is the predicate you set to determine the condition for the PayPal Payment Integration:

totalPrice.centAmount >= 10000 and totalPrice.currencyCode = "EUR"

If, for the totalPrice field of the current Cart, the value of the centAmount field is 12000 and the value of the currencyCode field is "EUR", PayPal is displayed as a Payment Integration.

If, for the totalPrice field of the current Cart, the value of the centAmount field is 9000 and the value of the currencyCode field is "EUR", PayPal is not displayed as a Payment Integration.

Payment Integration predicates do not affect the order in which Payment Integrations are displayed. For example, it is not possible to set a predicate to display credit card as the first Payment Integration if the country is Germany and as the second Payment Integration if the country is Italy.

When a Payment Integration is not displayed due to the predicate's conditions, it is replaced by the next eligible one, according to the order in the Application's settings Payment integrations tab.

To change the display order, when creating or editing an Application, click Reorder in the Payment integrations tab, then drag the Payment Integration into the desired order and click Save.

Predicate examples

Following are some examples of predicates that you can set to determine Payment Integration conditions. If they evaluate as true, the Payment Integration is displayed. If they evaluate as false, the Payment Integration is not displayed.

This predicate checks that the country of the billing address for the Cart is Germany:

billingAddress.country = "DE"

This predicate checks that the country of the billing address for the Cart is not Germany:

billingAddress.country != "DE"

This predicate checks that the amount of the total price of the Cart is greater than or equal to 100 and less than 200, and that the currency is Euro:

totalPrice.centAmount >= 10000 and totalPrice.centAmount < 20000 and totalPrice.currencyCode = "EUR"

This predicate checks that the Product Type id of the Line Items in the Cart is c2f93298-c967-44af-8c2a-d2220bf39eb2 or 67751a034a-8691-4a4d-b7be-2f959cb4b65c890:

lineItems.productType.id = "c2f93298-c967-44af-8c2a-d2220bf39eb2" or lineItems.productType.id = "751a034a-8691-4a4d-b7be-2f959cb4b65c"

This predicate checks that the Customer Group id of the Customer to which the Cart belongs is aef9cf41-94ad-4794-8122-62d308900430 or 266f3f1c-d86e-4376-94ec-b41d657040ae:

customerGroup.id = "aef9cf41-94ad-4794-8122-62d308900430" or customerGroup.id = "266f3f1c-d86e-4376-94ec-b41d657040ae"

This predicate checks that the Customer Group id of the Customer to which the Cart belongs is not c2f93298-c967-44af-8c2a-d2220bf39eb2:

customerGroup.id != "c2f93298-c967-44af-8c2a-d2220bf39eb2"

This predicate checks that the Cart contains at least one Line Item:

$sum(lineItems.quantity) = 1

This predicate checks that the Customer Group of the Customer to which the Cart belongs is aef9cf41-94ad-4794-8122-62d308900430 and that the country of the shipping address is The Netherlands or Germany:

customerGroup.id = "aef9cf41-94ad-4794-8122-62d308900430" and (shippingAddress.country = "NL" or shippingAddress.country = "DE")

This predicate checks that the id of the Shipping Method for the Cart is not eb8991df-2dcd-4e24-83fe-5df46ec04422:

shippingInfo.shippingMethod.id != "eb8991df-2dcd-4e24-83fe-5df46ec04422"

Set predicates

You can set a predicate for a Payment Integration when:

  • Creating an Application: when adding the Payment Integration, enter the text of the predicate in the Payment integration conditions via predicates field in the Payment integrations tab.
  • Editing an Application: go to the Payment integrations tab, select the Payment Integration, and enter the text of the predicate in the Payment integration conditions via predicates field. Then, click Save.