Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This page contains the available variables and examplesexample algorithms using User Based Pricing Scripts.
To see how Pricing Scripts work, read General Rules for Pricing Scripts - General Usage .

All price formulas support some basic User Based Pricing.
More functionality (User Grouping / Lableing) is coming soon is supported throughout the entire ordering processes. This allows your service to customize pricing based on specific roles within the organization.

Available Variables

Variable

Description

user.full_name

Full name of the user

user.email

Email address of the user

user.domain

The domain of the current site

user.customer_number

Number of the customer

user.country_code

Code of the country

The country which is assigned in the address.

Example: DE for Germany

user.language

User language

Example Use Cases

Syntax

Meaning

Examples

user.email && user.email.includes()

Determines whether a user email address includes a specific phrase

user.email && user.email.includes(‘3yourmind’);

is true for user@3yourmind.comuser@3yourmind.de3yourmind@mail.com

user.email && user.email.startsWith()

Determines whether a user email address starts with a specific phrase

user.email && user.email.startsWith(‘user’);

is true for user@3yourmind.comuser@3yd.de, false for test.user@3yourmind.com

user.email && user.email.endsWith()

...

Checks if user email address ends with a specific phrase

user.email && user.email.endsWith(‘3yourmind.com’);

is true for user@3yourmind.com, but false for user@3yourmind.de

user.email && user.email.match()

Compares if user email matches a regular expression

user.email && user.email.match(‘user@3yourmind.com);


Sample User Pricing

Offer a 10% discount if the email address ends with “@3yourmind.com“

Code Block
languagejs
let price = model.volume * 0.0002;

if (user.email && user.email.endsWith("@3yourmind.com")) {
  price = 0.9 * price;
}
price;  // Last line contains the final price

...