Skip to content

Auth Rules

Auth Rules

Last updated: (timestamp)

Auth Rules

auth_rules

Auth RulesV2

auth_rules.v2
Methods
Create a new rule
post/v2/auth_rules

Creates a new V2 Auth rule in draft mode

Fetch a rule
get/v2/auth_rules/{auth_rule_token}

Fetches a V2 Auth rule by its token

Update a rule
patch/v2/auth_rules/{auth_rule_token}

Updates a V2 Auth rule's properties

If account_tokens, card_tokens, program_level, or excluded_card_tokens is provided, this will replace existing associations with the provided list of entities.

List rules
get/v2/auth_rules

Lists V2 Auth rules

Delete a rule
delete/v2/auth_rules/{auth_rule_token}

Deletes a V2 Auth rule

Apply a rule
post/v2/auth_rules/{auth_rule_token}/apply

Associates a V2 Auth rule with a card program, the provided account(s) or card(s).

Prefer using the PATCH method for this operation.

Draft a new rule version
post/v2/auth_rules/{auth_rule_token}/draft

Creates a new draft version of a rule that will be ran in shadow mode.

This can also be utilized to reset the draft parameters, causing a draft version to no longer be ran in shadow mode.

Promote a rule version
post/v2/auth_rules/{auth_rule_token}/promote

Promotes the draft version of an Auth rule to the currently active version such that it is enforced in the respective stream.

Request a performance report
post/v2/auth_rules/{auth_rule_token}/report

This endpoint is deprecated and will be removed in the future. Requests a performance report of an Auth rule to be asynchronously generated. Reports can only be run on rules in draft or active mode and will included approved and declined statistics as well as examples. The generated report will be delivered asynchronously through a webhook with event_type = auth_rules.performance_report.created. See the docs on setting up webhook subscriptions.

Reports are generated based on data collected by Lithic's processing system in the trailing week. The performance of the auth rule will be assessed on the configuration of the auth rule at the time the report is requested. This implies that if a performance report is requested, right after updating an auth rule, depending on the number of events processed for a card program, it may be the case that no data is available for the report. Therefore Lithic recommends to decouple making updates to an Auth Rule, and requesting performance reports.

To make this concrete, consider the following example:

  1. At time t, a new Auth Rule is created, and applies to all auth events on a card program. The Auth Rule has not yet been promoted, causing the draft version of the rule to be applied in shadow mode.
  2. At time t + 1 hour a performance report is requested for the Auth Rule. This performance report will only contain data for the Auth Rule being executed in the window between t and t + 1 hour. This is because Lithic's transaction processing system will only start capturing data for the Auth Rule at the time it is created.
  3. At time t + 2 hours the draft version of the Auth Rule is promoted to the active version of the Auth Rule by calling the /v2/auth_rules/{auth_rule_token}/promote endpoint. If a performance report is requested at this moment it will still only contain data for this version of the rule, but the window of available data will now span from t to t + 2 hours.
  4. At time t + 3 hours a new version of the rule is drafted by calling the /v2/auth_rules/{auth_rule_token}/draft endpoint. If a performance report is requested right at this moment, it will only contain data for events to which both the active version and the draft version is applied. Lithic does this to ensure that performance reports represent a fair comparison between rules. Because there may be no events in this window, and because there may be some lag before data is available in a performance report, the requested performance report could contain no to little data.
  5. At time t + 4 hours another performance report is requested: this time the performance report will contain data from the window between t + 3 hours and t + 4 hours, for any events to which both the current version of the Auth rule (in enforcing mode) and the draft version of the Auth rule (in shadow mode) applied.

Note that generating a report may take up to 15 minutes and that delivery is not guaranteed. Customers are required to have created an event subscription to receive the webhook. Additionally, there is a delay of approximately 15 minutes between when Lithic's transaction processing systems have processed the transaction, and when a transaction will be included in the report.

Retrieve a performance report
get/v2/auth_rules/{auth_rule_token}/report

Retrieves a performance report for an Auth rule containing daily statistics and evaluation outcomes.

Time Range Limitations:

  • Reports are supported for the past 3 months only
  • Maximum interval length is 1 month
  • Report data is available only through the previous day in UTC (current day data is not available)

The report provides daily statistics for both current and draft versions of the Auth rule, including approval, decline, and challenge counts along with sample events.

Domain Types
Auth Rule
AuthRuleobject
ShowShow
tokenstring

Globally unique identifier.

formatuuid
stateenum
Accepts one of the following: "ACTIVE", "INACTIVE"

Indicates whether the Auth Rule is ACTIVE or INACTIVE

Hide ParametersShow Parameters
"ACTIVE"
"INACTIVE"
account_tokensarray of string
optional

Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note that only this field or card_tokens can be provided for a given Auth Rule.

allowed_countriesarray of string
optional

Countries in which the Auth Rule permits transactions. Note that Lithic maintains a list of countries in which all transactions are blocked; "allowing" those countries in an Auth Rule does not override the Lithic-wide restrictions.

allowed_mccarray of string
optional

Merchant category codes for which the Auth Rule permits transactions.

blocked_countriesarray of string
optional

Countries in which the Auth Rule automatically declines transactions.

blocked_mccarray of string
optional

Merchant category codes for which the Auth Rule automatically declines transactions.

card_tokensarray of string
optional

Array of card_token(s) identifying the cards that the Auth Rule applies to. Note that only this field or account_tokens can be provided for a given Auth Rule.

program_levelboolean
optional

Boolean indicating whether the Auth Rule is applied at the program level.

Auth Rule Condition
AuthRuleConditionobject
ShowShow
attributeConditionalAttribute
optional

The attribute to target.

The following attributes may be targeted:

  • MCC: A four-digit number listed in ISO 18245. An MCC is used to classify a business by the types of goods or services it provides.
  • COUNTRY: Country of entity of card acceptor. Possible values are: (1) all ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles.
  • CURRENCY: 3-character alphabetic ISO 4217 code for the merchant currency of the transaction.
  • MERCHANT_ID: Unique alphanumeric identifier for the payment card acceptor (merchant).
  • DESCRIPTOR: Short description of card acceptor.
  • LIABILITY_SHIFT: Indicates whether chargeback liability shift to the issuer applies to the transaction. Valid values are NONE, 3DS_AUTHENTICATED, or TOKEN_AUTHENTICATED.
  • PAN_ENTRY_MODE: The method by which the cardholder's primary account number (PAN) was entered. Valid values are AUTO_ENTRY, BAR_CODE, CONTACTLESS, ECOMMERCE, ERROR_KEYED, ERROR_MAGNETIC_STRIPE, ICC, KEY_ENTERED, MAGNETIC_STRIPE, MANUAL, OCR, SECURE_CARDLESS, UNSPECIFIED, UNKNOWN, CREDENTIAL_ON_FILE, or ECOMMERCE.
  • TRANSACTION_AMOUNT: The base transaction amount (in cents) plus the acquirer fee field in the settlement/cardholder billing currency. This is the amount the issuer should authorize against unless the issuer is paying the acquirer fee on behalf of the cardholder.
  • RISK_SCORE: Network-provided score assessing risk level associated with a given authorization. Scores are on a range of 0-999, with 0 representing the lowest risk and 999 representing the highest risk. For Visa transactions, where the raw score has a range of 0-99, Lithic will normalize the score by multiplying the raw score by 10x.
  • CARD_TRANSACTION_COUNT_15M: The number of transactions on the card in the trailing 15 minutes before the authorization.
  • CARD_TRANSACTION_COUNT_1H: The number of transactions on the card in the trailing hour up and until the authorization.
  • CARD_TRANSACTION_COUNT_24H: The number of transactions on the card in the trailing 24 hours up and until the authorization.
  • CARD_STATE: The current state of the card associated with the transaction. Valid values are CLOSED, OPEN, PAUSED, PENDING_ACTIVATION, PENDING_FULFILLMENT.
  • PIN_ENTERED: Indicates whether a PIN was entered during the transaction. Valid values are TRUE, FALSE.
  • PIN_STATUS: The current state of card's PIN. Valid values are NOT_SET, OK, BLOCKED.
  • WALLET_TYPE: For transactions using a digital wallet token, indicates the source of the token. Valid values are APPLE_PAY, GOOGLE_PAY, SAMSUNG_PAY, MASTERPASS, MERCHANT, OTHER, NONE.
operationenum
optional
Accepts one of the following: "IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", 3 more

The operation to apply to the attribute

Hide ParametersShow Parameters
"IS_ONE_OF"
"IS_NOT_ONE_OF"
"MATCHES"
"DOES_NOT_MATCH"
"IS_GREATER_THAN"
"IS_LESS_THAN"
valueunion
optional
Accepts one of the following: string, number, array of string

A regex string, to be used with MATCHES or DOES_NOT_MATCH

Hide ParametersShow Parameters
Regexstring

A regex string, to be used with MATCHES or DOES_NOT_MATCH

Numbernumber

A number, to be used with IS_GREATER_THAN or IS_LESS_THAN

ListOfStringsarray of string

An array of strings, to be used with IS_ONE_OF or IS_NOT_ONE_OF

Conditional Attribute
ConditionalAttributeenum

The attribute to target.

The following attributes may be targeted:

  • MCC: A four-digit number listed in ISO 18245. An MCC is used to classify a business by the types of goods or services it provides.
  • COUNTRY: Country of entity of card acceptor. Possible values are: (1) all ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles.
  • CURRENCY: 3-character alphabetic ISO 4217 code for the merchant currency of the transaction.
  • MERCHANT_ID: Unique alphanumeric identifier for the payment card acceptor (merchant).
  • DESCRIPTOR: Short description of card acceptor.
  • LIABILITY_SHIFT: Indicates whether chargeback liability shift to the issuer applies to the transaction. Valid values are NONE, 3DS_AUTHENTICATED, or TOKEN_AUTHENTICATED.
  • PAN_ENTRY_MODE: The method by which the cardholder's primary account number (PAN) was entered. Valid values are AUTO_ENTRY, BAR_CODE, CONTACTLESS, ECOMMERCE, ERROR_KEYED, ERROR_MAGNETIC_STRIPE, ICC, KEY_ENTERED, MAGNETIC_STRIPE, MANUAL, OCR, SECURE_CARDLESS, UNSPECIFIED, UNKNOWN, CREDENTIAL_ON_FILE, or ECOMMERCE.
  • TRANSACTION_AMOUNT: The base transaction amount (in cents) plus the acquirer fee field in the settlement/cardholder billing currency. This is the amount the issuer should authorize against unless the issuer is paying the acquirer fee on behalf of the cardholder.
  • RISK_SCORE: Network-provided score assessing risk level associated with a given authorization. Scores are on a range of 0-999, with 0 representing the lowest risk and 999 representing the highest risk. For Visa transactions, where the raw score has a range of 0-99, Lithic will normalize the score by multiplying the raw score by 10x.
  • CARD_TRANSACTION_COUNT_15M: The number of transactions on the card in the trailing 15 minutes before the authorization.
  • CARD_TRANSACTION_COUNT_1H: The number of transactions on the card in the trailing hour up and until the authorization.
  • CARD_TRANSACTION_COUNT_24H: The number of transactions on the card in the trailing 24 hours up and until the authorization.
  • CARD_STATE: The current state of the card associated with the transaction. Valid values are CLOSED, OPEN, PAUSED, PENDING_ACTIVATION, PENDING_FULFILLMENT.
  • PIN_ENTERED: Indicates whether a PIN was entered during the transaction. Valid values are TRUE, FALSE.
  • PIN_STATUS: The current state of card's PIN. Valid values are NOT_SET, OK, BLOCKED.
  • WALLET_TYPE: For transactions using a digital wallet token, indicates the source of the token. Valid values are APPLE_PAY, GOOGLE_PAY, SAMSUNG_PAY, MASTERPASS, MERCHANT, OTHER, NONE.
ShowShow
"MCC"
"COUNTRY"
"CURRENCY"
"MERCHANT_ID"
"DESCRIPTOR"
"LIABILITY_SHIFT"
"PAN_ENTRY_MODE"
"TRANSACTION_AMOUNT"
"RISK_SCORE"
"CARD_TRANSACTION_COUNT_15M"
"CARD_TRANSACTION_COUNT_1H"
"CARD_TRANSACTION_COUNT_24H"
"CARD_STATE"
"PIN_ENTERED"
"PIN_STATUS"
"WALLET_TYPE"
Conditional Block Parameters
ConditionalBlockParametersobject
ShowShow
conditionsarray of attributeConditionalAttributeoperationenumvalueunionAuthRuleCondition
Rule Stats
RuleStatsobject
ShowShow
approvednumber
optional

The total number of historical transactions approved by this rule during the relevant period, or the number of transactions that would have been approved if the rule was evaluated in shadow mode.

challengednumber
optional

The total number of historical transactions challenged by this rule during the relevant period, or the number of transactions that would have been challenged if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth Rules.

declinednumber
optional

The total number of historical transactions declined by this rule during the relevant period, or the number of transactions that would have been declined if the rule was evaluated in shadow mode.

examplesarray of object
optional

Example events and their outcomes.

Hide ParametersShow Parameters
approvedboolean
optional

Whether the rule would have approved the request.

decisionenum
optional
Accepts one of the following: "APPROVED", "DECLINED", "CHALLENGED"

The decision made by the rule for this event.

Hide ParametersShow Parameters
"APPROVED"
"DECLINED"
"CHALLENGED"
event_tokenstring
optional

The event token.

formatuuid
timestampstring
optional

The timestamp of the event.

formatdate-time
versionnumber
optional

The version of the rule, this is incremented whenever the rule's parameters change.

Velocity Limit Params
VelocityLimitParamsobject
ShowShow
filtersobject
Hide ParametersShow Parameters
exclude_countriesarray of string
optional

ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Transactions matching any of the provided will be excluded from the calculated velocity.

exclude_mccsarray of string
optional

Merchant Category Codes to exclude from the velocity calculation. Transactions matching this MCC will be excluded from the calculated velocity.

include_countriesarray of string
optional

ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transactions not matching any of the provided will not be included in the calculated velocity.

include_mccsarray of string
optional

Merchant Category Codes to include in the velocity calculation. Transactions not matching this MCC will not be included in the calculated velocity.

periodunion
Accepts one of the following: number, VelocityLimitParamsPeriodWindow

The size of the trailing window to calculate Spend Velocity over in seconds. The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days).

Hide ParametersShow Parameters
TrailingWindownumber

The size of the trailing window to calculate Spend Velocity over in seconds. The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days).

scopeenum
Accepts one of the following: "CARD", "ACCOUNT"
Hide ParametersShow Parameters
"CARD"
"ACCOUNT"
limit_amountnumber
optional

The maximum amount of spend velocity allowed in the period in minor units (the smallest unit of a currency, e.g. cents for USD). Transactions exceeding this limit will be declined.

formatint64
minimum0
limit_countnumber
optional

The number of spend velocity impacting transactions may not exceed this limit in the period. Transactions exceeding this limit will be declined. A spend velocity impacting transaction is a transaction that has been authorized, and optionally settled, or a force post (a transaction that settled without prior authorization).

formatint64
minimum0
Velocity Limit Params Period Window
VelocityLimitParamsPeriodWindowenum

The window of time to calculate Spend Velocity over.

  • DAY: Velocity over the current day since midnight Eastern Time.
  • WEEK: Velocity over the current week since 00:00 / 12 AM on Monday in Eastern Time.
  • MONTH: Velocity over the current month since 00:00 / 12 AM on the first of the month in Eastern Time.
  • YEAR: Velocity over the current year since 00:00 / 12 AM on January 1st in Eastern Time.
ShowShow
"DAY"
"WEEK"
"MONTH"
"YEAR"

Auth RulesV2Backtests

auth_rules.v2.backtests
Methods
Request a backtest
post/v2/auth_rules/{auth_rule_token}/backtests

Initiates a request to asynchronously generate a backtest for an Auth rule. During backtesting, both the active version (if one exists) and the draft version of the Auth Rule are evaluated by replaying historical transaction data against the rule's conditions. This process allows customers to simulate and understand the effects of proposed rule changes before deployment. The generated backtest report provides detailed results showing whether the draft version of the Auth Rule would have approved or declined historical transactions which were processed during the backtest period. These reports help evaluate how changes to rule configurations might affect overall transaction approval rates.

The generated backtest report will be delivered asynchronously through a webhook with event_type = auth_rules.backtest_report.created. See the docs on setting up webhook subscriptions. It is also possible to request backtest reports on-demand through the /v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token} endpoint.

Lithic currently supports backtesting for CONDITIONAL_BLOCK / CONDITIONAL_3DS_ACTION rules. Backtesting for VELOCITY_LIMIT rules is generally not supported. In specific cases (i.e. where Lithic has pre-calculated the requested velocity metrics for historical transactions), a backtest may be feasible. However, such cases are uncommon and customers should not anticipate support for velocity backtests under most configurations. If a historical transaction does not feature the required inputs to evaluate the rule, then it will not be included in the final backtest report.

Retrieve backtest results
get/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}

Returns the backtest results of an Auth rule (if available).

Backtesting is an asynchronous process that requires time to complete. If a customer retrieves the backtest results using this endpoint before the report is fully generated, the response will return null for results.current_version and results.draft_version. Customers are advised to wait for the backtest creation process to complete (as indicated by the webhook event auth_rules.backtest_report.created) before retrieving results from this endpoint.

Backtesting is an asynchronous process, while the backtest is being processed, results will not be available which will cause results.current_version and results.draft_version objects to contain null. The entries in results will also always represent the configuration of the rule at the time requests are made to this endpoint. For example, the results for current_version in the served backtest report will be consistent with which version of the rule is currently activated in the respective event stream, regardless of which version of the rule was active in the event stream at the time a backtest is requested.

Domain Types
Backtest Results
BacktestResultsobject
ShowShow
backtest_tokenstring

Auth Rule Backtest Token

formatuuid
resultsobject
Hide ParametersShow Parameters
current_versionapprovednumberchallengednumberdeclinednumberexamplesarray of objectversionnumberRuleStats
optional
draft_versionapprovednumberchallengednumberdeclinednumberexamplesarray of objectversionnumberRuleStats
optional
simulation_parametersobject
Hide ParametersShow Parameters
auth_rule_tokenstring
optional

Auth Rule Token

formatuuid
endstring
optional

The end time of the simulation.

formatdate-time
startstring
optional

The start time of the simulation.

formatdate-time