Using placeholders for event handlers
The following table includes the list of events and corresponding placeholders that can be used in the Query parameter of an event handler (see Creating an event handler).
The following operations with placeholders are available for the query:
>
<
>=
<=
=
!=
include? (for example,
order.type = "SalesOrder" and (order.plans_ids include? 2000030))
— the event handler works if the plan with id =2000030 is included in the order)- exclude? (to exclude certain entities (using an id, key, or name) from the massive of entities. For example, to exclude sending messages about the order creation for a plan with the id = 2000000, use the following rule:
order.plans_ids exclude? 2000000
) and
- or. For several
or
afterand
, use additional parentheses:order.type = "RenewalOrder" and order.renewal_is_positive = true and subscription.payment_model = "prepay" and ((order.plans_ids include? 293827) or (order.plans_ids include? 293824) or (order.plans_ids include? 294340))
- % (for example, 30% of the financial blocking threshold:
account.financial_blocking_threshold % 30
)
Event | Placeholder | Description | Type | Example |
---|---|---|---|---|
For all events | owner.status | The status of the Owner of an account | string | owner.status = "active" |
owner.country | The Owner's address: the two-letter ISO code ISO 3166-1 alpha-2 of the country | string | owner.country = "BY" | |
owner.city | The Owner's address: city | string | owner.city = "Minsk" | |
current_date | The current date | date | current_date | |
Account credit hold is coming Account changed Account created Financial blocking threshold was changed Account manager changed Low balance Closing documents generated Create instance Reset instance password | account.balance | The current value of the account balance (see Viewing the list of charges) | number | account.balance = 1000 |
account.balance.was | The previous value of the account balance (see Viewing the list of charges) Can be used only for the Low balance event. | number | account.balance.was = 100 | |
account.city | The account address: city | string | account.city = "Minsk" | |
account.class_id | The account class ID (see Account classes) | integer | account.class_id = 1 | |
account.class_key | The account class key (see Account classes) | string | account.class_key = "manual" | |
account.country | The account address: the two-letter ISO code ISO 3166-1 alpha-2 of the country | string | account.country = "BY" | |
account.financial_blocking_threshold | The limit within which the account balance can be negative without moving the account to the Credit hold status during the subzero period | number | account.financial_blocking_threshold = 100 | |
account.has_endless_trial_subscriptions | Indicates whether an account has at least one commercial subscription with the endless period | boolean | account.has_endless_trial_subscriptions = true | |
account.has_manager | Indicates whether an account is linked to a manager | boolean | account.has_manager = true | |
account.regular_sending |
| boolean | account.regular_sending = true | |
account.status | The current status of an account | string | account.status = "inactive" | |
account.status.was | The previous status of an account Can be used only for the Account changed event. | string | account.status.was = "inactive" | |
account.subscription_credit_limit | The value of the subscription credit limit of an account | number | account.subscription_credit_limit = 100 | |
account.type_id | The account type ID | integer | account.type_id = 1 | |
account.type_key | The account type key | string | account.type_key = "business" | |
account.owner_reset_password_url | A one-time link to set the Owner's password Can be used only for the Account created event. | string | account.owner_reset_password_url = "http://example.com/password/edit?reset_password_token=1q2w3e" | |
Invoice closed The Invoice was approved | invoice.status | The status of an invoice | string | invoice.status = "open" |
invoice.has_attached | Indicates whether a third-party invoice is attached to a payment for an approved postpaid invoice with external management (see Managing invoices for the Postpay model by a third-party ERP system) | boolean | invoice.has_attached = true | |
account.type.key | The account type key | string | account.type_key = "business" | |
Manual Operation | operation.id | The manual operation ID (see Manual operations) | integer | operation.id = 1 |
operation.status | The manual operation | string | operation.status = "approval_required" operation.status = "declined" | |
operation.type | The manual operation type. For example, when a subscription stops:
| string | operation.type = "postpay_subscription_verify" operation.type = "manual_provisioning_plugin_application_install" operation.type = "subscription_stop" | |
product.id | The product ID | integer | product.id = 1 | |
product.name | The product name | string | product.name = "ESET" | |
product_category.id | The product category ID | integer | product_category.id = 1 | |
plan.id | The plan ID | integer | plan.id = 1 | |
plan_category.key | The plan category ID | string | plan_category.key = "default" | |
subscription.id | The subscription ID | integer | subscription.id = 1 | |
subscription.status.was | The previous status of a subscription | string | subscription.status.was="installing" | |
subscription.status | The current status of a subscription | string | subscription.status.was="active" | |
account.type_key | The account type key (see Account types) | string | account.type_key = "personal" | |
account.class_key | The account class key (see Account classes) | string | account.class_key = "default" | |
Payment due date has come | payment.due_date_passed | The number of days after a payment gets the Expired status | integer | payment.due_date_passed = 1 |
User invitation | - | - | - | - |
Payment has been changed (previously — Payment has been received) | account.type_key | The account type key (see Account types) | string | account.type_key = "business" |
account.class_key | The account class key (see Account classes) | string | account.class_key = "manual" | |
account.billing_day | The billing day (see Managing service terms). | integer | account.billing_day = 30 | |
account.financial_blocking_threshold | integer | account.financial_blocking_threshold = 100 | ||
account.balance | The current value of the account balance (see Viewing the list of charges) | integer | account.balance = 1000 | |
account.status | The current status of an account | string | account.status = "inactive" | |
account.country | The account address: the two-letter ISO code ISO 3166-1 alpha-2 of the country | string | account.country = "BY" | |
account.city | The account address: city | string | account.city = "Minsk" | |
payment.total | The payment amount | integer | payment.total = 100 | |
payment.status | The payment status | string | payment.status = "completed" | |
Password reset request Verify email | user.id | The user ID | integer | user.id = 1 |
Manager password reset request | manager.id | The manager ID | integer | manager.id = 1 |
Before subscription expiration After subscription expiration After subscription switched from trial to no-trial Subscription changed Credit limit for postpaid subscription was changed Credit limit for postpaid subscription is approaching | account.balance | The current value of the account balance (see Viewing the list of charges) | number | account.balance = 1000 |
account.status | The current status of an account | string | account.status = "inactive" | |
account.type_key | The account type key (see Account types) | string | account.type_key = "business" | |
account.class_key | The account class key (see Account classes) | string | account.class_key = "manual" | |
account.financial_blocking_threshold | The limit within which the account balance can be negative without moving the account to the Credit hold status during the subzero period | number | account.financial_blocking_threshold = 100 | |
account.subscription_credit_limit | The value of the subscription credit limit of an account | number | account.subscription_credit_limit = 100 | |
account.country | The account address: the two-letter ISO code ISO 3166-1 alpha-2 of the country | string | account.country = "BY" | |
account.city | The account address: city | string | account.city = "Minsk" | |
plan.auto_renewal_disabled | Indicates whether the Disable the Auto-renew option option of the linked plan is active | boolean | plan.auto_renewal_disabled = false | |
plan.id | The plan ID | integer | plan.id = 1 | |
plan.status | The plan status | string | plan.status = "completed" | |
plan_period.duration_value | The plan period duration | integer | plan_period.duration_value = 30 | |
plan_period.duration_type | The units of the plan period (year, month, day) | string | plan_period.duration_type = "months" | |
plan_period.trial | Indicated whether the plan period is trial The true and false values require quotation marks. | string ("boolean") | plan_period.trial = "false" | |
plan_period.setup_fee | The setup fee of the plan period | number | plan_period.setup_fee = 100 | |
plan_period.recurring_fee | The recurring fee of the plan period | number | plan_period.recurring_fee = 100 | |
plan_period.renewal_fee | The renewal fee of the plan period | number | plan_period.renewal_fee = 100 | |
plan_category.key | The plan category key (see Managing plan categories) | string | plan_category.key = "streaming" | |
plan_category.id | The plan category ID | integer | plan_category.id= 1 | |
subscription.id | The subscription ID | integer | subscription.id = 1 | |
subscription.csp | Indicated whether a subscription belongs to the Microsoft CSP program | boolean | subscription.csp = true | |
subscription.individual_price | Indicated whether a subscription is ordered at the individual prices (see Ordering a subscription at the individual prices) | boolean | subscription.individual_price = true | |
subscription.status | The current status of a subscription | string | subscription.status = "active" | |
subscription.status.was | The previous status of a subscription The placeholder is not supported by the Credit limit for postpaid subscription was changed and Credit limit for postpaid subscription is approaching events. | string | subscription.status.was="installing" | |
subscription.auto_renewal | Indicated whether the Auto-renew option of a subscription is active | boolean | subscription.auto_renewal = true | |
subscription.auto_renewal_disabled | Indicated whether the Disable the Auto-renew option option of a subscription is active | boolean | subscription.auto_renewal_disabled = false | |
subscription.auto_renewal.was | The previous status of the Auto-renew option of a subscription For the Subscription changed event only — regarding a created manual operation. For details, see Manual operations. | boolean | subscription.auto_renewal.was = true | |
subscription.days_left | The number of days before the expiration day of a subscription | integer | subscription.days_left = 7 | |
subscription.days_passed | The number of days after the creation day of a subscription | integer | subscription.days_passed = 15 | |
subscription.plan_class | The name of a service term (see Managing service terms) | string | subscription.plan_class = "default" | |
subscription.payment_model | The payment model: prepay or postpay | string | subscription.payment_model = "postpay" | |
subscription_postpay.current_debt | The subscription debt as the total amount of all blocked charges for a subscription for the current billing period | number | subscription_postpay.current_debt = 100 | |
subscription_postpay.credit_limit | The value of the subscription debt above which a postpaid subscription will be blocked | number | subscription_postpay.credit_limit = 100 | |
product.id | The product ID (see Editing general information about the plan) | integer | product.id = 1 | |
product.name | The product name (see Editing general information about the plan) | integer | product.name = "Default" | |
order.type | The order type The placeholder is not supported by the Credit limit for postpaid subscription was changed and Credit limit for postpaid subscription is approaching events. | string | order.type = "RenewalOrder" | |
Order changed Order created Resend the order | order.id | The order ID The placeholder is not supported by the Order changed and Order created events. | integer | order.id = 1 |
order.plans_ids | The IDs of the ordered plans | integer | order.type = "SalesOrder" and (order.plans_ids include? 2000030) | |
order.status | The current status of an order | string | order.status = "waiting_for_payment" | |
order.status.was | The previous status of an order The placeholder is not supported by the Order created event. | string | order.status.was = "provisioning" | |
order.total | The total amount of an order | integer | order.total = 100 | |
order.type | The order type | string | order.type = "RenewalOrder" | |
order.renewal_point | The placeholder is deprecated. In the current version of the platform, See also Indicates whether the value in the Auto-renew point (days) field is set on the subscription details page (see Viewing and updating subscription's details) | boolean | order.renewal_point = true | |
order.renewal_is_positive | Indicates whether Auto-renew point (days) > 0 for a subscription (see Viewing and updating subscription's details) | boolean | order.renewal_is_positive = true | |
subscription.status | The status of a subscription | string | subscription.status = "active" | |
product.id | The product ID included in an order (see Viewing order details) | integer | product.id = 1 | |
product.name | The product name included in an order (see Viewing order details) | integer | product.name = "Default" | |
subscription.payment_model | The payment model: prepay or postpay | string | subscription.payment_model = "postpay" | |
plan_category.key | The plan category key | string | plan_category.key = "Default" | |
Resend the order | order.days_passed | The number of days passed after creating an order | integer | order.days_passed = 5 |
Guaranteed payment created Guaranteed payment changed | account.type_id | The account type ID (see Account types) | integer | account.type_id = 1 |
account.type_key | The account type key | string | account.type_key = "business" | |
account.class_id | The account class ID (see Account classes) | integer | account.class_id = 1 | |
account.class_key | The account class key | string | account.class_key = "manual" | |
guaranteed_payment.status.was | The previous status of a guaranteed payment (see Managing Guaranteed Payments) Can be used only for the Guaranteed payment changed event. | string | guaranteed_payment.status.was = "provided" | |
guaranteed_payment.status | The current status of a guaranteed payment | string | guaranteed_payment.status = "revoked" | |
guaranteed_payment.days_left | The number of days before the expiration date of a guaranteed payment | integer | guaranteed_payment.days_left = 1 | |
Billing day is coming | billing_day | The billing day date (see Creating a service term) | integer | billing_day = 5 |
billing_day_left | The number of days left to the billing day caused the event to occur (see Creating an event handler) On the billing day caused the event to occur, the placeholder returns the number of days left to the next billing day | integer | billing_day_left = 7 | |
billing_day_open_charges_amount | The total amount of charges in the Open status that will be closed or blocked on the billing day caused the event to occur. Only subscriptions with Auto-renew point (days) = 0 are counted. If there are no open charges, preliminary charge generation for the next billing period is used for the calculation | number | billing_day_open_charges_amount = 120.1 | |
plan_ids | A list of the plan IDs with active subscriptions of an account | array(int) | plan_ids include? 200023 | |
product_ids | A list of the product IDs with active subscriptions of an account | array(int) | product_ids include? 100022 | |
product_names | A list of the product names with active subscriptions of an account | array(str) | product_names include? "Default" | |
monthly_billing | Indicates whether an account has active subscriptions with any monthly billing type (for example, Monthly Prolongation or Monthly Commitment) and the billing day caused the event to occur | boolean | monthly_billing = true | |
account.type_key | The account type key (see Account types) | string | account.type_key = "personal" | |
account.class_key | The account class key (see Account classes) | string | account.class_key = "default" | |
account.balance | The available account balance | number | account.balance = 58.5 | |
account.financial_blocking_threshold | The limit within which the account balance can be negative without moving an account to the Credit hold status during the subzero period | number | account.financial_blocking_threshold = 10000 | |
subscription.expiration_date | The subscription expiration date | date DD.MM.YYYY | 01.01.2019 | |
subscription.payment_model | The payment model: prepay or postpay | string | subscription.payment_model = "postpay" | |
Payment due date is coming | payment.days_left | The number of days before the latest date for completing a payment (see Due date in Viewing payment details) when a notification is sent | integer | payment.days_left = 5 |
Billing day for manager's subscriptions has come (former Billing day has come) | billing_day | The date of the billing day when the event occurs | integer | billing_day = 5 |
subscriptions_plan_category_keys | The plan category keys to check whether a manager has at least one account with a subscription in any status, except for Deleted, within the specified plan categories | array | subscriptions_plan_category_keys include? "azure" | |
subscriptions_statuses | The subscription statuses to check whether a manager has at least one account with a subscription in any specified status | array | subscriptions_statuses include? "active" | |
Joined payment created Resend the joined payment | account.class_id | The account class ID (see Account classes) | integer | account.class_id = 1 |
account.class_key | The account class key (see Account classes) | string | account.class_key = "manual" | |
payment.days_passed | The number of days passed after creating the joined payment Can be used only for the Resend the joined payment event. | integer | payment.days_passed = 5 | |
Billing day for account's subscription has come | billing_day_passed | The number of days passed after the billing day to trigger the event for the previous billing period The
| integer | billing_day_passed = 5 |
plan_category_key | The key of a plan category of a subscription to trigger the event | string | plan_category_key = "azure" | |
subscription_status | The status of a subscription to trigger the event | string | subscription_status = "active' | |
account_class_key | The key of an account class required for an account to trigger the event | string | account_class_key = "default" | |
Correction approved | correction.approved_manager_id | The list of IDs of managers who approved a correction to trigger the event | integer | correction.approved_manager_id = 221 |
Before account's postpaid subscriptions expiration | before_subscriptions_expirations | A list of days before a subscription expiration date | integer | before_subscriptions_expirations include? 1 |
Paid amount has been received from external system | payment_transaction.amount | The paid amount specified in a Complete payment by document ID request body | number | payment_transaction.amount = 15 |
payment.total | The payment amount in the platform | number | payment.total = 10 | |
payment.status.was | The previous status of the payment | string | payment.status.was = "completed" | |
payment.status | The current status of the payment | string | payment.status = "completed" | |
VSP subscription created VSP resources changed | plan.id | The ID of a plan linked to the subscription | integer | plan.id = 123 |
product.id | The ID of a product linked to the subscription | integer | product.id = 123 | |
product.name | The name of a product linked to the subscription | string | product.name = "Product Name" | |
plan_category.id | The ID of a plan category linked to the subscription | integer | plan_category.id = 123 | |
plan_category.key | The key of a plan category linked to the subscription | string | plan_category.key = "plan_category_key" | |
product_category.id | The ID of a product category linked to the subscription | integer | product_category.id = 123 | |
product_category.key | The key of a product category linked to the subscription | string | product_category.key = "product_category_key" | |
subscription.payment_model | The payment model: prepay or postpay | string | subscription.payment_model = "postpay" | |
The report with daily consumptions of pay-as-you-go subscriptions is ready
| consumption_report.status | The report status:
| string | consumption_report.status = "completed" |
consumption_report.scheduled | Indicates whether it is a scheduled monthly report | boolean | consumption_report.scheduled = true |