Skip to content

Commit 7599000

Browse files
feat(api): add ACH_PAYMENT_UPDATE event stream, actions, and result types to auth_rules
1 parent 6955dd1 commit 7599000

16 files changed

Lines changed: 421 additions & 44 deletions

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 213
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-a4afc884f86f30a87445552888031ac1ca18aed0476d7120da555bf457627e65.yml
3-
openapi_spec_hash: ce8d0830986c702f0c7a693b1c3cc5a2
4-
config_hash: 4b618a1df59e555cebe6aa13e8c0218f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-8e691d2dedaea1906ebbe28b28c978855d5e4fe5fe595a8d23917df851123400.yml
3+
openapi_spec_hash: c33e82abb4d7c979d05386ca230464d3
4+
config_hash: 5bb913c05ebeb301ec925b16e75bb251

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ Types:
101101

102102
```python
103103
from lithic.types.auth_rules import (
104+
ACHPaymentUpdateAction,
104105
AuthRule,
105106
AuthRuleCondition,
106107
AuthRuleVersion,
107108
BacktestStats,
108109
CardTransactionUpdateAction,
109110
Conditional3DSActionParameters,
110111
ConditionalACHActionParameters,
112+
ConditionalACHPaymentUpdateActionParameters,
111113
ConditionalAttribute,
112114
ConditionalAuthorizationActionParameters,
113115
ConditionalAuthorizationAdjustmentParameters,

src/lithic/resources/auth_rules/v2/v2.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ def create(
101101
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
102102
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
103103
- `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
104-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
105-
stream.
104+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
105+
ACH_PAYMENT_UPDATE event stream.
106106
- `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
107-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
108-
stream.
107+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
108+
ACH_PAYMENT_UPDATE event stream.
109109
110110
account_tokens: Account tokens to which the Auth Rule applies.
111111
@@ -159,11 +159,11 @@ def create(
159159
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
160160
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
161161
- `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
162-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
163-
stream.
162+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
163+
ACH_PAYMENT_UPDATE event stream.
164164
- `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
165-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
166-
stream.
165+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
166+
ACH_PAYMENT_UPDATE event stream.
167167
168168
event_stream: The event stream during which the rule will be evaluated.
169169
@@ -216,11 +216,11 @@ def create(
216216
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
217217
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
218218
- `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
219-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
220-
stream.
219+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
220+
ACH_PAYMENT_UPDATE event stream.
221221
- `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
222-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
223-
stream.
222+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
223+
ACH_PAYMENT_UPDATE event stream.
224224
225225
event_stream: The event stream during which the rule will be evaluated.
226226
@@ -985,11 +985,11 @@ async def create(
985985
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
986986
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
987987
- `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
988-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
989-
stream.
988+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
989+
ACH_PAYMENT_UPDATE event stream.
990990
- `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
991-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
992-
stream.
991+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
992+
ACH_PAYMENT_UPDATE event stream.
993993
994994
account_tokens: Account tokens to which the Auth Rule applies.
995995
@@ -1043,11 +1043,11 @@ async def create(
10431043
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
10441044
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
10451045
- `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
1046-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
1047-
stream.
1046+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
1047+
ACH_PAYMENT_UPDATE event stream.
10481048
- `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
1049-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
1050-
stream.
1049+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
1050+
ACH_PAYMENT_UPDATE event stream.
10511051
10521052
event_stream: The event stream during which the rule will be evaluated.
10531053
@@ -1100,11 +1100,11 @@ async def create(
11001100
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
11011101
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
11021102
- `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
1103-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
1104-
stream.
1103+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
1104+
ACH_PAYMENT_UPDATE event stream.
11051105
- `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
1106-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
1107-
stream.
1106+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
1107+
ACH_PAYMENT_UPDATE event stream.
11081108
11091109
event_stream: The event stream during which the rule will be evaluated.
11101110

src/lithic/types/auth_rules/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from .conditional_value_param import ConditionalValueParam as ConditionalValueParam
2626
from .merchant_lock_parameters import MerchantLockParameters as MerchantLockParameters
2727
from .v2_list_results_response import V2ListResultsResponse as V2ListResultsResponse
28+
from .ach_payment_update_action import ACHPaymentUpdateAction as ACHPaymentUpdateAction
2829
from .auth_rule_condition_param import AuthRuleConditionParam as AuthRuleConditionParam
2930
from .v2_list_versions_response import V2ListVersionsResponse as V2ListVersionsResponse
3031
from .v2_retrieve_report_params import V2RetrieveReportParams as V2RetrieveReportParams
@@ -39,6 +40,7 @@
3940
from .v2_retrieve_features_response import V2RetrieveFeaturesResponse as V2RetrieveFeaturesResponse
4041
from .card_transaction_update_action import CardTransactionUpdateAction as CardTransactionUpdateAction
4142
from .merchant_lock_parameters_param import MerchantLockParametersParam as MerchantLockParametersParam
43+
from .ach_payment_update_action_param import ACHPaymentUpdateActionParam as ACHPaymentUpdateActionParam
4244
from .typescript_code_parameters_param import TypescriptCodeParametersParam as TypescriptCodeParametersParam
4345
from .conditional_3ds_action_parameters import Conditional3DSActionParameters as Conditional3DSActionParameters
4446
from .conditional_ach_action_parameters import ConditionalACHActionParameters as ConditionalACHActionParameters
@@ -59,6 +61,9 @@
5961
from .conditional_authorization_adjustment_parameters import (
6062
ConditionalAuthorizationAdjustmentParameters as ConditionalAuthorizationAdjustmentParameters,
6163
)
64+
from .conditional_ach_payment_update_action_parameters import (
65+
ConditionalACHPaymentUpdateActionParameters as ConditionalACHPaymentUpdateActionParameters,
66+
)
6267
from .conditional_tokenization_action_parameters_param import (
6368
ConditionalTokenizationActionParametersParam as ConditionalTokenizationActionParametersParam,
6469
)
@@ -71,6 +76,9 @@
7176
from .conditional_card_transaction_update_action_parameters import (
7277
ConditionalCardTransactionUpdateActionParameters as ConditionalCardTransactionUpdateActionParameters,
7378
)
79+
from .conditional_ach_payment_update_action_parameters_param import (
80+
ConditionalACHPaymentUpdateActionParametersParam as ConditionalACHPaymentUpdateActionParametersParam,
81+
)
7482
from .conditional_card_transaction_update_action_parameters_param import (
7583
ConditionalCardTransactionUpdateActionParametersParam as ConditionalCardTransactionUpdateActionParametersParam,
7684
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Union
4+
from typing_extensions import Literal, TypeAlias
5+
6+
from ..._models import BaseModel
7+
8+
__all__ = ["ACHPaymentUpdateAction", "TagAction", "CreateCaseAction"]
9+
10+
11+
class TagAction(BaseModel):
12+
key: str
13+
"""The key of the tag to apply to the payment"""
14+
15+
type: Literal["TAG"]
16+
"""Tag the payment with key-value metadata"""
17+
18+
value: str
19+
"""The value of the tag to apply to the payment"""
20+
21+
22+
class CreateCaseAction(BaseModel):
23+
queue_token: str
24+
"""The token of the queue to create the case in"""
25+
26+
scope: Literal["FINANCIAL_ACCOUNT"]
27+
"""The scope of the case to create"""
28+
29+
type: Literal["CREATE_CASE"]
30+
"""Create a case for the payment"""
31+
32+
33+
ACHPaymentUpdateAction: TypeAlias = Union[TagAction, CreateCaseAction]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Union
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
7+
8+
__all__ = ["ACHPaymentUpdateActionParam", "TagAction", "CreateCaseAction"]
9+
10+
11+
class TagAction(TypedDict, total=False):
12+
key: Required[str]
13+
"""The key of the tag to apply to the payment"""
14+
15+
type: Required[Literal["TAG"]]
16+
"""Tag the payment with key-value metadata"""
17+
18+
value: Required[str]
19+
"""The value of the tag to apply to the payment"""
20+
21+
22+
class CreateCaseAction(TypedDict, total=False):
23+
queue_token: Required[str]
24+
"""The token of the queue to create the case in"""
25+
26+
scope: Required[Literal["FINANCIAL_ACCOUNT"]]
27+
"""The scope of the case to create"""
28+
29+
type: Required[Literal["CREATE_CASE"]]
30+
"""Create a case for the payment"""
31+
32+
33+
ACHPaymentUpdateActionParam: TypeAlias = Union[TagAction, CreateCaseAction]

src/lithic/types/auth_rules/auth_rule.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters
1515
from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters
1616
from .conditional_authorization_adjustment_parameters import ConditionalAuthorizationAdjustmentParameters
17+
from .conditional_ach_payment_update_action_parameters import ConditionalACHPaymentUpdateActionParameters
1718
from .conditional_card_transaction_update_action_parameters import ConditionalCardTransactionUpdateActionParameters
1819

1920
__all__ = ["AuthRule", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"]
@@ -27,6 +28,7 @@
2728
ConditionalACHActionParameters,
2829
ConditionalTokenizationActionParameters,
2930
ConditionalCardTransactionUpdateActionParameters,
31+
ConditionalACHPaymentUpdateActionParameters,
3032
TypescriptCodeParameters,
3133
ConditionalAuthorizationAdjustmentParameters,
3234
]
@@ -52,6 +54,7 @@ class CurrentVersion(BaseModel):
5254
ConditionalACHActionParameters,
5355
ConditionalTokenizationActionParameters,
5456
ConditionalCardTransactionUpdateActionParameters,
57+
ConditionalACHPaymentUpdateActionParameters,
5558
TypescriptCodeParameters,
5659
ConditionalAuthorizationAdjustmentParameters,
5760
]
@@ -135,11 +138,11 @@ class AuthRule(BaseModel):
135138
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
136139
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
137140
- `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
138-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
139-
stream.
141+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
142+
ACH_PAYMENT_UPDATE event stream.
140143
- `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
141-
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event
142-
stream.
144+
ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
145+
ACH_PAYMENT_UPDATE event stream.
143146
"""
144147

145148
excluded_account_tokens: Optional[List[str]] = None

src/lithic/types/auth_rules/auth_rule_version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters
1515
from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters
1616
from .conditional_authorization_adjustment_parameters import ConditionalAuthorizationAdjustmentParameters
17+
from .conditional_ach_payment_update_action_parameters import ConditionalACHPaymentUpdateActionParameters
1718
from .conditional_card_transaction_update_action_parameters import ConditionalCardTransactionUpdateActionParameters
1819

1920
__all__ = ["AuthRuleVersion", "Parameters"]
@@ -27,6 +28,7 @@
2728
ConditionalACHActionParameters,
2829
ConditionalTokenizationActionParameters,
2930
ConditionalCardTransactionUpdateActionParameters,
31+
ConditionalACHPaymentUpdateActionParameters,
3032
TypescriptCodeParameters,
3133
ConditionalAuthorizationAdjustmentParameters,
3234
]
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List
4+
from typing_extensions import Literal
5+
6+
from ..._models import BaseModel
7+
from .conditional_value import ConditionalValue
8+
from .conditional_operation import ConditionalOperation
9+
from .ach_payment_update_action import ACHPaymentUpdateAction
10+
11+
__all__ = ["ConditionalACHPaymentUpdateActionParameters", "Condition"]
12+
13+
14+
class Condition(BaseModel):
15+
attribute: Literal[
16+
"TRANSACTION_AMOUNT",
17+
"SEC_CODE",
18+
"RETURN_REASON_CODE",
19+
"ACCOUNT_AGE",
20+
"EXTERNAL_BANK_ACCOUNT_AGE",
21+
"EXTERNAL_BANK_ACCOUNT_VERIFICATION_METHOD",
22+
"EXTERNAL_BANK_ACCOUNT_VERIFICATION_STATE",
23+
"EXTERNAL_BANK_ACCOUNT_OWNER_TYPE",
24+
]
25+
"""The attribute to target.
26+
27+
The following attributes may be targeted:
28+
29+
- `TRANSACTION_AMOUNT`: The total amount of the ACH payment in minor units
30+
(cents), calculated as the sum of the settled and pending amounts. Use an
31+
integer value.
32+
- `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction.
33+
Valid values include PPD (Prearranged Payment and Deposit Entry), CCD
34+
(Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL
35+
(Telephone-Initiated Entry), and others.
36+
- `RETURN_REASON_CODE`: NACHA return reason code associated with the payment
37+
(for example, `R01`).
38+
- `ACCOUNT_AGE`: The age of the account in seconds at the time of the payment.
39+
Use an integer value. For programs where Lithic does not manage or retain
40+
account holder data, this attribute does not evaluate.
41+
- `EXTERNAL_BANK_ACCOUNT_AGE`: The age of the external bank account in seconds
42+
at the time of the payment. Use an integer value.
43+
- `EXTERNAL_BANK_ACCOUNT_VERIFICATION_METHOD`: The method used to verify the
44+
external bank account. Valid values are `MANUAL`, `MICRO_DEPOSIT`, `PRENOTE`,
45+
`EXTERNALLY_VERIFIED`, or `UNVERIFIED`.
46+
- `EXTERNAL_BANK_ACCOUNT_VERIFICATION_STATE`: The verification state of the
47+
external bank account. Valid values are `PENDING`, `ENABLED`,
48+
`FAILED_VERIFICATION`, or `INSUFFICIENT_FUNDS`.
49+
- `EXTERNAL_BANK_ACCOUNT_OWNER_TYPE`: The owner type of the external bank
50+
account. Valid values are `INDIVIDUAL` or `BUSINESS`.
51+
"""
52+
53+
operation: ConditionalOperation
54+
"""The operation to apply to the attribute"""
55+
56+
value: ConditionalValue
57+
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
58+
59+
60+
class ConditionalACHPaymentUpdateActionParameters(BaseModel):
61+
action: ACHPaymentUpdateAction
62+
"""The action to take if the conditions are met."""
63+
64+
conditions: List[Condition]

0 commit comments

Comments
 (0)