diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f38100a4..47775e91 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.126.0" + ".": "0.127.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 83440cb8..c73e93a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 213 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-a4afc884f86f30a87445552888031ac1ca18aed0476d7120da555bf457627e65.yml -openapi_spec_hash: ce8d0830986c702f0c7a693b1c3cc5a2 -config_hash: 4b618a1df59e555cebe6aa13e8c0218f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-8e691d2dedaea1906ebbe28b28c978855d5e4fe5fe595a8d23917df851123400.yml +openapi_spec_hash: c33e82abb4d7c979d05386ca230464d3 +config_hash: 5bb913c05ebeb301ec925b16e75bb251 diff --git a/CHANGELOG.md b/CHANGELOG.md index 23de39cc..1d170df9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.127.0 (2026-06-19) + +Full Changelog: [v0.126.0...v0.127.0](https://github.com/lithic-com/lithic-python/compare/v0.126.0...v0.127.0) + +### Features + +* **api:** add ACH_PAYMENT_UPDATE event stream, actions, and result types to auth_rules ([27f6d31](https://github.com/lithic-com/lithic-python/commit/27f6d315469a1388b17a644456e8df6515daa95f)) + ## 0.126.0 (2026-06-16) Full Changelog: [v0.125.0...v0.126.0](https://github.com/lithic-com/lithic-python/compare/v0.125.0...v0.126.0) diff --git a/api.md b/api.md index c7c82b8f..7a89bb78 100644 --- a/api.md +++ b/api.md @@ -101,6 +101,7 @@ Types: ```python from lithic.types.auth_rules import ( + ACHPaymentUpdateAction, AuthRule, AuthRuleCondition, AuthRuleVersion, @@ -108,6 +109,7 @@ from lithic.types.auth_rules import ( CardTransactionUpdateAction, Conditional3DSActionParameters, ConditionalACHActionParameters, + ConditionalACHPaymentUpdateActionParameters, ConditionalAttribute, ConditionalAuthorizationActionParameters, ConditionalAuthorizationAdjustmentParameters, diff --git a/pyproject.toml b/pyproject.toml index bb2dbd26..f8881486 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.126.0" +version = "0.127.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/lithic/_version.py b/src/lithic/_version.py index 9c42a542..0f07ebf8 100644 --- a/src/lithic/_version.py +++ b/src/lithic/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "lithic" -__version__ = "0.126.0" # x-release-please-version +__version__ = "0.127.0" # x-release-please-version diff --git a/src/lithic/resources/auth_rules/v2/v2.py b/src/lithic/resources/auth_rules/v2/v2.py index 105abc70..427f1c86 100644 --- a/src/lithic/resources/auth_rules/v2/v2.py +++ b/src/lithic/resources/auth_rules/v2/v2.py @@ -101,11 +101,11 @@ def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. account_tokens: Account tokens to which the Auth Rule applies. @@ -159,11 +159,11 @@ def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. event_stream: The event stream during which the rule will be evaluated. @@ -216,11 +216,11 @@ def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. event_stream: The event stream during which the rule will be evaluated. @@ -985,11 +985,11 @@ async def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. account_tokens: Account tokens to which the Auth Rule applies. @@ -1043,11 +1043,11 @@ async def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. event_stream: The event stream during which the rule will be evaluated. @@ -1100,11 +1100,11 @@ async def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. event_stream: The event stream during which the rule will be evaluated. diff --git a/src/lithic/types/auth_rules/__init__.py b/src/lithic/types/auth_rules/__init__.py index 01de1801..5230bb18 100644 --- a/src/lithic/types/auth_rules/__init__.py +++ b/src/lithic/types/auth_rules/__init__.py @@ -25,6 +25,7 @@ from .conditional_value_param import ConditionalValueParam as ConditionalValueParam from .merchant_lock_parameters import MerchantLockParameters as MerchantLockParameters from .v2_list_results_response import V2ListResultsResponse as V2ListResultsResponse +from .ach_payment_update_action import ACHPaymentUpdateAction as ACHPaymentUpdateAction from .auth_rule_condition_param import AuthRuleConditionParam as AuthRuleConditionParam from .v2_list_versions_response import V2ListVersionsResponse as V2ListVersionsResponse from .v2_retrieve_report_params import V2RetrieveReportParams as V2RetrieveReportParams @@ -39,6 +40,7 @@ from .v2_retrieve_features_response import V2RetrieveFeaturesResponse as V2RetrieveFeaturesResponse from .card_transaction_update_action import CardTransactionUpdateAction as CardTransactionUpdateAction from .merchant_lock_parameters_param import MerchantLockParametersParam as MerchantLockParametersParam +from .ach_payment_update_action_param import ACHPaymentUpdateActionParam as ACHPaymentUpdateActionParam from .typescript_code_parameters_param import TypescriptCodeParametersParam as TypescriptCodeParametersParam from .conditional_3ds_action_parameters import Conditional3DSActionParameters as Conditional3DSActionParameters from .conditional_ach_action_parameters import ConditionalACHActionParameters as ConditionalACHActionParameters @@ -59,6 +61,9 @@ from .conditional_authorization_adjustment_parameters import ( ConditionalAuthorizationAdjustmentParameters as ConditionalAuthorizationAdjustmentParameters, ) +from .conditional_ach_payment_update_action_parameters import ( + ConditionalACHPaymentUpdateActionParameters as ConditionalACHPaymentUpdateActionParameters, +) from .conditional_tokenization_action_parameters_param import ( ConditionalTokenizationActionParametersParam as ConditionalTokenizationActionParametersParam, ) @@ -71,6 +76,9 @@ from .conditional_card_transaction_update_action_parameters import ( ConditionalCardTransactionUpdateActionParameters as ConditionalCardTransactionUpdateActionParameters, ) +from .conditional_ach_payment_update_action_parameters_param import ( + ConditionalACHPaymentUpdateActionParametersParam as ConditionalACHPaymentUpdateActionParametersParam, +) from .conditional_card_transaction_update_action_parameters_param import ( ConditionalCardTransactionUpdateActionParametersParam as ConditionalCardTransactionUpdateActionParametersParam, ) diff --git a/src/lithic/types/auth_rules/ach_payment_update_action.py b/src/lithic/types/auth_rules/ach_payment_update_action.py new file mode 100644 index 00000000..841dc939 --- /dev/null +++ b/src/lithic/types/auth_rules/ach_payment_update_action.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel + +__all__ = ["ACHPaymentUpdateAction", "TagAction", "CreateCaseAction"] + + +class TagAction(BaseModel): + key: str + """The key of the tag to apply to the payment""" + + type: Literal["TAG"] + """Tag the payment with key-value metadata""" + + value: str + """The value of the tag to apply to the payment""" + + +class CreateCaseAction(BaseModel): + queue_token: str + """The token of the queue to create the case in""" + + scope: Literal["FINANCIAL_ACCOUNT"] + """The scope of the case to create""" + + type: Literal["CREATE_CASE"] + """Create a case for the payment""" + + +ACHPaymentUpdateAction: TypeAlias = Union[TagAction, CreateCaseAction] diff --git a/src/lithic/types/auth_rules/ach_payment_update_action_param.py b/src/lithic/types/auth_rules/ach_payment_update_action_param.py new file mode 100644 index 00000000..b4625d5c --- /dev/null +++ b/src/lithic/types/auth_rules/ach_payment_update_action_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = ["ACHPaymentUpdateActionParam", "TagAction", "CreateCaseAction"] + + +class TagAction(TypedDict, total=False): + key: Required[str] + """The key of the tag to apply to the payment""" + + type: Required[Literal["TAG"]] + """Tag the payment with key-value metadata""" + + value: Required[str] + """The value of the tag to apply to the payment""" + + +class CreateCaseAction(TypedDict, total=False): + queue_token: Required[str] + """The token of the queue to create the case in""" + + scope: Required[Literal["FINANCIAL_ACCOUNT"]] + """The scope of the case to create""" + + type: Required[Literal["CREATE_CASE"]] + """Create a case for the payment""" + + +ACHPaymentUpdateActionParam: TypeAlias = Union[TagAction, CreateCaseAction] diff --git a/src/lithic/types/auth_rules/auth_rule.py b/src/lithic/types/auth_rules/auth_rule.py index 8e3e80c7..c3ab6ff8 100644 --- a/src/lithic/types/auth_rules/auth_rule.py +++ b/src/lithic/types/auth_rules/auth_rule.py @@ -14,6 +14,7 @@ from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters from .conditional_authorization_adjustment_parameters import ConditionalAuthorizationAdjustmentParameters +from .conditional_ach_payment_update_action_parameters import ConditionalACHPaymentUpdateActionParameters from .conditional_card_transaction_update_action_parameters import ConditionalCardTransactionUpdateActionParameters __all__ = ["AuthRule", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] @@ -27,6 +28,7 @@ ConditionalACHActionParameters, ConditionalTokenizationActionParameters, ConditionalCardTransactionUpdateActionParameters, + ConditionalACHPaymentUpdateActionParameters, TypescriptCodeParameters, ConditionalAuthorizationAdjustmentParameters, ] @@ -52,6 +54,7 @@ class CurrentVersion(BaseModel): ConditionalACHActionParameters, ConditionalTokenizationActionParameters, ConditionalCardTransactionUpdateActionParameters, + ConditionalACHPaymentUpdateActionParameters, TypescriptCodeParameters, ConditionalAuthorizationAdjustmentParameters, ] @@ -135,11 +138,11 @@ class AuthRule(BaseModel): - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. """ excluded_account_tokens: Optional[List[str]] = None diff --git a/src/lithic/types/auth_rules/auth_rule_version.py b/src/lithic/types/auth_rules/auth_rule_version.py index e6287078..f395b3b7 100644 --- a/src/lithic/types/auth_rules/auth_rule_version.py +++ b/src/lithic/types/auth_rules/auth_rule_version.py @@ -14,6 +14,7 @@ from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters from .conditional_authorization_adjustment_parameters import ConditionalAuthorizationAdjustmentParameters +from .conditional_ach_payment_update_action_parameters import ConditionalACHPaymentUpdateActionParameters from .conditional_card_transaction_update_action_parameters import ConditionalCardTransactionUpdateActionParameters __all__ = ["AuthRuleVersion", "Parameters"] @@ -27,6 +28,7 @@ ConditionalACHActionParameters, ConditionalTokenizationActionParameters, ConditionalCardTransactionUpdateActionParameters, + ConditionalACHPaymentUpdateActionParameters, TypescriptCodeParameters, ConditionalAuthorizationAdjustmentParameters, ] diff --git a/src/lithic/types/auth_rules/conditional_ach_payment_update_action_parameters.py b/src/lithic/types/auth_rules/conditional_ach_payment_update_action_parameters.py new file mode 100644 index 00000000..a5e1901b --- /dev/null +++ b/src/lithic/types/auth_rules/conditional_ach_payment_update_action_parameters.py @@ -0,0 +1,64 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from .conditional_value import ConditionalValue +from .conditional_operation import ConditionalOperation +from .ach_payment_update_action import ACHPaymentUpdateAction + +__all__ = ["ConditionalACHPaymentUpdateActionParameters", "Condition"] + + +class Condition(BaseModel): + attribute: Literal[ + "TRANSACTION_AMOUNT", + "SEC_CODE", + "RETURN_REASON_CODE", + "ACCOUNT_AGE", + "EXTERNAL_BANK_ACCOUNT_AGE", + "EXTERNAL_BANK_ACCOUNT_VERIFICATION_METHOD", + "EXTERNAL_BANK_ACCOUNT_VERIFICATION_STATE", + "EXTERNAL_BANK_ACCOUNT_OWNER_TYPE", + ] + """The attribute to target. + + The following attributes may be targeted: + + - `TRANSACTION_AMOUNT`: The total amount of the ACH payment in minor units + (cents), calculated as the sum of the settled and pending amounts. Use an + integer value. + - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. + Valid values include PPD (Prearranged Payment and Deposit Entry), CCD + (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL + (Telephone-Initiated Entry), and others. + - `RETURN_REASON_CODE`: NACHA return reason code associated with the payment + (for example, `R01`). + - `ACCOUNT_AGE`: The age of the account in seconds at the time of the payment. + Use an integer value. For programs where Lithic does not manage or retain + account holder data, this attribute does not evaluate. + - `EXTERNAL_BANK_ACCOUNT_AGE`: The age of the external bank account in seconds + at the time of the payment. Use an integer value. + - `EXTERNAL_BANK_ACCOUNT_VERIFICATION_METHOD`: The method used to verify the + external bank account. Valid values are `MANUAL`, `MICRO_DEPOSIT`, `PRENOTE`, + `EXTERNALLY_VERIFIED`, or `UNVERIFIED`. + - `EXTERNAL_BANK_ACCOUNT_VERIFICATION_STATE`: The verification state of the + external bank account. Valid values are `PENDING`, `ENABLED`, + `FAILED_VERIFICATION`, or `INSUFFICIENT_FUNDS`. + - `EXTERNAL_BANK_ACCOUNT_OWNER_TYPE`: The owner type of the external bank + account. Valid values are `INDIVIDUAL` or `BUSINESS`. + """ + + operation: ConditionalOperation + """The operation to apply to the attribute""" + + value: ConditionalValue + """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" + + +class ConditionalACHPaymentUpdateActionParameters(BaseModel): + action: ACHPaymentUpdateAction + """The action to take if the conditions are met.""" + + conditions: List[Condition] diff --git a/src/lithic/types/auth_rules/conditional_ach_payment_update_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_ach_payment_update_action_parameters_param.py new file mode 100644 index 00000000..58a1994f --- /dev/null +++ b/src/lithic/types/auth_rules/conditional_ach_payment_update_action_parameters_param.py @@ -0,0 +1,68 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .conditional_operation import ConditionalOperation +from .conditional_value_param import ConditionalValueParam +from .ach_payment_update_action_param import ACHPaymentUpdateActionParam + +__all__ = ["ConditionalACHPaymentUpdateActionParametersParam", "Condition"] + + +class Condition(TypedDict, total=False): + attribute: Required[ + Literal[ + "TRANSACTION_AMOUNT", + "SEC_CODE", + "RETURN_REASON_CODE", + "ACCOUNT_AGE", + "EXTERNAL_BANK_ACCOUNT_AGE", + "EXTERNAL_BANK_ACCOUNT_VERIFICATION_METHOD", + "EXTERNAL_BANK_ACCOUNT_VERIFICATION_STATE", + "EXTERNAL_BANK_ACCOUNT_OWNER_TYPE", + ] + ] + """The attribute to target. + + The following attributes may be targeted: + + - `TRANSACTION_AMOUNT`: The total amount of the ACH payment in minor units + (cents), calculated as the sum of the settled and pending amounts. Use an + integer value. + - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. + Valid values include PPD (Prearranged Payment and Deposit Entry), CCD + (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL + (Telephone-Initiated Entry), and others. + - `RETURN_REASON_CODE`: NACHA return reason code associated with the payment + (for example, `R01`). + - `ACCOUNT_AGE`: The age of the account in seconds at the time of the payment. + Use an integer value. For programs where Lithic does not manage or retain + account holder data, this attribute does not evaluate. + - `EXTERNAL_BANK_ACCOUNT_AGE`: The age of the external bank account in seconds + at the time of the payment. Use an integer value. + - `EXTERNAL_BANK_ACCOUNT_VERIFICATION_METHOD`: The method used to verify the + external bank account. Valid values are `MANUAL`, `MICRO_DEPOSIT`, `PRENOTE`, + `EXTERNALLY_VERIFIED`, or `UNVERIFIED`. + - `EXTERNAL_BANK_ACCOUNT_VERIFICATION_STATE`: The verification state of the + external bank account. Valid values are `PENDING`, `ENABLED`, + `FAILED_VERIFICATION`, or `INSUFFICIENT_FUNDS`. + - `EXTERNAL_BANK_ACCOUNT_OWNER_TYPE`: The owner type of the external bank + account. Valid values are `INDIVIDUAL` or `BUSINESS`. + """ + + operation: Required[ConditionalOperation] + """The operation to apply to the attribute""" + + value: Required[Annotated[ConditionalValueParam, PropertyInfo(format="iso8601")]] + """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" + + +class ConditionalACHPaymentUpdateActionParametersParam(TypedDict, total=False): + action: Required[ACHPaymentUpdateActionParam] + """The action to take if the conditions are met.""" + + conditions: Required[Iterable[Condition]] diff --git a/src/lithic/types/auth_rules/event_stream.py b/src/lithic/types/auth_rules/event_stream.py index 6a91de00..166abb67 100644 --- a/src/lithic/types/auth_rules/event_stream.py +++ b/src/lithic/types/auth_rules/event_stream.py @@ -11,4 +11,5 @@ "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT", "CARD_TRANSACTION_UPDATE", + "ACH_PAYMENT_UPDATE", ] diff --git a/src/lithic/types/auth_rules/rule_feature.py b/src/lithic/types/auth_rules/rule_feature.py index 452e631f..132095b2 100644 --- a/src/lithic/types/auth_rules/rule_feature.py +++ b/src/lithic/types/auth_rules/rule_feature.py @@ -14,6 +14,7 @@ "TokenizationFeature", "ACHReceiptFeature", "CardTransactionFeature", + "ACHPaymentFeature", "CardFeature", "AccountHolderFeature", "IPMetadataFeature", @@ -57,6 +58,13 @@ class CardTransactionFeature(BaseModel): """The variable name for this feature in the rule function signature""" +class ACHPaymentFeature(BaseModel): + type: Literal["ACH_PAYMENT"] + + name: Optional[str] = None + """The variable name for this feature in the rule function signature""" + + class CardFeature(BaseModel): type: Literal["CARD"] @@ -109,6 +117,7 @@ class TransactionHistorySignalsFeature(BaseModel): TokenizationFeature, ACHReceiptFeature, CardTransactionFeature, + ACHPaymentFeature, CardFeature, AccountHolderFeature, IPMetadataFeature, diff --git a/src/lithic/types/auth_rules/rule_feature_param.py b/src/lithic/types/auth_rules/rule_feature_param.py index 8b947b82..85976075 100644 --- a/src/lithic/types/auth_rules/rule_feature_param.py +++ b/src/lithic/types/auth_rules/rule_feature_param.py @@ -15,6 +15,7 @@ "TokenizationFeature", "ACHReceiptFeature", "CardTransactionFeature", + "ACHPaymentFeature", "CardFeature", "AccountHolderFeature", "IPMetadataFeature", @@ -58,6 +59,13 @@ class CardTransactionFeature(TypedDict, total=False): """The variable name for this feature in the rule function signature""" +class ACHPaymentFeature(TypedDict, total=False): + type: Required[Literal["ACH_PAYMENT"]] + + name: str + """The variable name for this feature in the rule function signature""" + + class CardFeature(TypedDict, total=False): type: Required[Literal["CARD"]] @@ -110,6 +118,7 @@ class TransactionHistorySignalsFeature(TypedDict, total=False): TokenizationFeature, ACHReceiptFeature, CardTransactionFeature, + ACHPaymentFeature, CardFeature, AccountHolderFeature, IPMetadataFeature, diff --git a/src/lithic/types/auth_rules/v2_create_params.py b/src/lithic/types/auth_rules/v2_create_params.py index 309a6f42..bb4cfaee 100644 --- a/src/lithic/types/auth_rules/v2_create_params.py +++ b/src/lithic/types/auth_rules/v2_create_params.py @@ -16,6 +16,7 @@ from .conditional_tokenization_action_parameters_param import ConditionalTokenizationActionParametersParam from .conditional_authorization_action_parameters_param import ConditionalAuthorizationActionParametersParam from .conditional_authorization_adjustment_parameters_param import ConditionalAuthorizationAdjustmentParametersParam +from .conditional_ach_payment_update_action_parameters_param import ConditionalACHPaymentUpdateActionParametersParam from .conditional_card_transaction_update_action_parameters_param import ( ConditionalCardTransactionUpdateActionParametersParam, ) @@ -49,11 +50,11 @@ class AccountLevelRule(TypedDict, total=False): - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. """ account_tokens: SequenceNotStr[str] @@ -78,6 +79,7 @@ class AccountLevelRule(TypedDict, total=False): ConditionalACHActionParametersParam, ConditionalTokenizationActionParametersParam, ConditionalCardTransactionUpdateActionParametersParam, + ConditionalACHPaymentUpdateActionParametersParam, TypescriptCodeParametersParam, ConditionalAuthorizationAdjustmentParametersParam, ] @@ -104,11 +106,11 @@ class CardLevelRule(TypedDict, total=False): - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. """ event_stream: EventStream @@ -127,6 +129,7 @@ class CardLevelRule(TypedDict, total=False): ConditionalACHActionParametersParam, ConditionalTokenizationActionParametersParam, ConditionalCardTransactionUpdateActionParametersParam, + ConditionalACHPaymentUpdateActionParametersParam, TypescriptCodeParametersParam, ConditionalAuthorizationAdjustmentParametersParam, ] @@ -153,11 +156,11 @@ class ProgramLevelRule(TypedDict, total=False): - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event - stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or + ACH_PAYMENT_UPDATE event stream. """ event_stream: EventStream @@ -185,6 +188,7 @@ class ProgramLevelRule(TypedDict, total=False): ConditionalACHActionParametersParam, ConditionalTokenizationActionParametersParam, ConditionalCardTransactionUpdateActionParametersParam, + ConditionalACHPaymentUpdateActionParametersParam, TypescriptCodeParametersParam, ConditionalAuthorizationAdjustmentParametersParam, ] diff --git a/src/lithic/types/auth_rules/v2_draft_params.py b/src/lithic/types/auth_rules/v2_draft_params.py index 90e0c054..b3329576 100644 --- a/src/lithic/types/auth_rules/v2_draft_params.py +++ b/src/lithic/types/auth_rules/v2_draft_params.py @@ -14,6 +14,7 @@ from .conditional_tokenization_action_parameters_param import ConditionalTokenizationActionParametersParam from .conditional_authorization_action_parameters_param import ConditionalAuthorizationActionParametersParam from .conditional_authorization_adjustment_parameters_param import ConditionalAuthorizationAdjustmentParametersParam +from .conditional_ach_payment_update_action_parameters_param import ConditionalACHPaymentUpdateActionParametersParam from .conditional_card_transaction_update_action_parameters_param import ( ConditionalCardTransactionUpdateActionParametersParam, ) @@ -35,6 +36,7 @@ class V2DraftParams(TypedDict, total=False): ConditionalACHActionParametersParam, ConditionalTokenizationActionParametersParam, ConditionalCardTransactionUpdateActionParametersParam, + ConditionalACHPaymentUpdateActionParametersParam, TypescriptCodeParametersParam, ConditionalAuthorizationAdjustmentParametersParam, ] diff --git a/src/lithic/types/auth_rules/v2_list_results_response.py b/src/lithic/types/auth_rules/v2_list_results_response.py index 7ef3805d..2cc038bb 100644 --- a/src/lithic/types/auth_rules/v2_list_results_response.py +++ b/src/lithic/types/auth_rules/v2_list_results_response.py @@ -22,6 +22,14 @@ "ACHResultAction", "ACHResultActionApproveActionACH", "ACHResultActionReturnAction", + "CardTransactionUpdateResult", + "CardTransactionUpdateResultAction", + "CardTransactionUpdateResultActionTagAction", + "CardTransactionUpdateResultActionCreateCaseAction", + "ACHPaymentUpdateResult", + "ACHPaymentUpdateResultAction", + "ACHPaymentUpdateResultActionTagAction", + "ACHPaymentUpdateResultActionCreateCaseAction", ] @@ -386,4 +394,135 @@ class ACHResult(BaseModel): """The token of the transaction that triggered the rule evaluation""" -V2ListResultsResponse: TypeAlias = Union[AuthorizationResult, Authentication3DSResult, TokenizationResult, ACHResult] +class CardTransactionUpdateResultActionTagAction(BaseModel): + key: str + """The key of the tag to apply to the transaction""" + + type: Literal["TAG"] + """Tag the transaction with key-value metadata""" + + value: str + """The value of the tag to apply to the transaction""" + + explanation: Optional[str] = None + """Optional explanation for why this action was taken""" + + +class CardTransactionUpdateResultActionCreateCaseAction(BaseModel): + queue_token: str + """The token of the queue to create the case in""" + + scope: Literal["CARD", "ACCOUNT"] + """The scope of the case to create""" + + type: Literal["CREATE_CASE"] + """Create a case for the transaction""" + + explanation: Optional[str] = None + """Optional explanation for why this action was taken""" + + +CardTransactionUpdateResultAction: TypeAlias = Union[ + CardTransactionUpdateResultActionTagAction, CardTransactionUpdateResultActionCreateCaseAction +] + + +class CardTransactionUpdateResult(BaseModel): + token: str + """Globally unique identifier for the evaluation""" + + actions: List[CardTransactionUpdateResultAction] + """Actions returned by the rule evaluation""" + + auth_rule_token: str + """The Auth Rule token""" + + evaluation_time: datetime + """Timestamp of the rule evaluation""" + + event_stream: Literal["CARD_TRANSACTION_UPDATE"] + """The event stream during which the rule was evaluated""" + + event_token: str + """Token of the event that triggered the evaluation""" + + mode: Literal["ACTIVE", "INACTIVE"] + """The state of the Auth Rule""" + + rule_version: int + """Version of the rule that was evaluated""" + + transaction_token: Optional[str] = None + """The token of the transaction that triggered the rule evaluation""" + + +class ACHPaymentUpdateResultActionTagAction(BaseModel): + key: str + """The key of the tag to apply to the payment""" + + type: Literal["TAG"] + """Tag the payment with key-value metadata""" + + value: str + """The value of the tag to apply to the payment""" + + explanation: Optional[str] = None + """Optional explanation for why this action was taken""" + + +class ACHPaymentUpdateResultActionCreateCaseAction(BaseModel): + queue_token: str + """The token of the queue to create the case in""" + + scope: Literal["FINANCIAL_ACCOUNT"] + """The scope of the case to create""" + + type: Literal["CREATE_CASE"] + """Create a case for the payment""" + + explanation: Optional[str] = None + """Optional explanation for why this action was taken""" + + +ACHPaymentUpdateResultAction: TypeAlias = Union[ + ACHPaymentUpdateResultActionTagAction, ACHPaymentUpdateResultActionCreateCaseAction +] + + +class ACHPaymentUpdateResult(BaseModel): + token: str + """Globally unique identifier for the evaluation""" + + actions: List[ACHPaymentUpdateResultAction] + """Actions returned by the rule evaluation""" + + auth_rule_token: str + """The Auth Rule token""" + + evaluation_time: datetime + """Timestamp of the rule evaluation""" + + event_stream: Literal["ACH_PAYMENT_UPDATE"] + """The event stream during which the rule was evaluated""" + + event_token: str + """Token of the event that triggered the evaluation""" + + mode: Literal["ACTIVE", "INACTIVE"] + """The state of the Auth Rule""" + + rule_version: int + """Version of the rule that was evaluated""" + + transaction_token: Optional[str] = None + """The token of the transaction that triggered the rule evaluation""" + + +V2ListResultsResponse: TypeAlias = Union[ + AuthorizationResult, + Authentication3DSResult, + TokenizationResult, + ACHResult, + CardTransactionUpdateResult, + ACHPaymentUpdateResult, +]