diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bd34dce0..3e05ae56 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.107.0" + ".": "0.108.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d3e6ead4..9d7ea8ff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 169 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1a0e3a42c88b88140af0f9ad05ab0026fc87f0a500d6879c86b93dfa7f923810.yml -openapi_spec_hash: 2b4db6185c6e4ab3626461a448c97d4b -config_hash: 7a6a0c0bab3306093c6c171cd7407a45 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-b1839661d8405911184d5cb7230f16e626a616e5b744634bd7f0bb4e730bf899.yml +openapi_spec_hash: c1c2c5a5c2a4067a714b35f873e3846f +config_hash: 98214f2eab6804b5c0048331e32c08e3 diff --git a/CHANGELOG.md b/CHANGELOG.md index d481f1cc..ba4158b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.108.0 (2025-10-08) + +Full Changelog: [v0.107.0...v0.108.0](https://github.com/lithic-com/lithic-python/compare/v0.107.0...v0.108.0) + +### Features + +* **api:** adds support for Auto-Collections ([28a777b](https://github.com/lithic-com/lithic-python/commit/28a777be2f54096fee954a1bb7fe7c717d5f7de1)) + ## 0.107.0 (2025-09-30) Full Changelog: [v0.106.0...v0.107.0](https://github.com/lithic-com/lithic-python/compare/v0.106.0...v0.107.0) diff --git a/pyproject.toml b/pyproject.toml index 5b975b6f..2e4e1522 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.107.0" +version = "0.108.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 47b14d42..a58912ad 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.107.0" # x-release-please-version +__version__ = "0.108.0" # x-release-please-version diff --git a/src/lithic/resources/account_activity.py b/src/lithic/resources/account_activity.py index dd9a6aa1..ec727ae9 100644 --- a/src/lithic/resources/account_activity.py +++ b/src/lithic/resources/account_activity.py @@ -52,6 +52,11 @@ def list( category: Literal[ "ACH", "BALANCE_OR_FUNDING", + "FEE", + "REWARD", + "ADJUSTMENT", + "DERECOGNITION", + "DISPUTE", "CARD", "EXTERNAL_ACH", "EXTERNAL_CHECK", @@ -215,6 +220,11 @@ def list( category: Literal[ "ACH", "BALANCE_OR_FUNDING", + "FEE", + "REWARD", + "ADJUSTMENT", + "DERECOGNITION", + "DISPUTE", "CARD", "EXTERNAL_ACH", "EXTERNAL_CHECK", diff --git a/src/lithic/resources/auth_rules/v2/v2.py b/src/lithic/resources/auth_rules/v2/v2.py index 78ce83f9..eb7d1bb8 100644 --- a/src/lithic/resources/auth_rules/v2/v2.py +++ b/src/lithic/resources/auth_rules/v2/v2.py @@ -304,6 +304,8 @@ def update( self, auth_rule_token: str, *, + account_tokens: SequenceNotStr[str] | Omit = omit, + business_account_tokens: SequenceNotStr[str] | Omit = omit, name: Optional[str] | Omit = omit, state: Literal["INACTIVE"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -321,46 +323,10 @@ def update( entities. Args: - name: Auth Rule Name - - state: The desired state of the Auth Rule. - - Note that only deactivating an Auth Rule through this endpoint is supported at - this time. If you need to (re-)activate an Auth Rule the /promote endpoint - should be used to promote a draft to the currently active version. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def update( - self, - auth_rule_token: str, - *, - name: Optional[str] | Omit = omit, - state: Literal["INACTIVE"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> V2UpdateResponse: - """ - Updates a V2 Auth rule's properties + account_tokens: Account tokens to which the Auth Rule applies. - If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` - is provided, this will replace existing associations with the provided list of - entities. + business_account_tokens: Business Account tokens to which the Auth Rule applies. - Args: name: Auth Rule Name state: The desired state of the Auth Rule. @@ -472,6 +438,8 @@ def update( self, auth_rule_token: str, *, + account_tokens: SequenceNotStr[str] | Omit = omit, + business_account_tokens: SequenceNotStr[str] | Omit = omit, name: Optional[str] | Omit = omit, state: Literal["INACTIVE"] | Omit = omit, card_tokens: SequenceNotStr[str] | Omit = omit, @@ -490,6 +458,8 @@ def update( f"/v2/auth_rules/{auth_rule_token}", body=maybe_transform( { + "account_tokens": account_tokens, + "business_account_tokens": business_account_tokens, "name": name, "state": state, "card_tokens": card_tokens, @@ -1282,6 +1252,8 @@ async def update( self, auth_rule_token: str, *, + account_tokens: SequenceNotStr[str] | Omit = omit, + business_account_tokens: SequenceNotStr[str] | Omit = omit, name: Optional[str] | Omit = omit, state: Literal["INACTIVE"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1299,46 +1271,10 @@ async def update( entities. Args: - name: Auth Rule Name - - state: The desired state of the Auth Rule. - - Note that only deactivating an Auth Rule through this endpoint is supported at - this time. If you need to (re-)activate an Auth Rule the /promote endpoint - should be used to promote a draft to the currently active version. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def update( - self, - auth_rule_token: str, - *, - name: Optional[str] | Omit = omit, - state: Literal["INACTIVE"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> V2UpdateResponse: - """ - Updates a V2 Auth rule's properties + account_tokens: Account tokens to which the Auth Rule applies. - If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens` - is provided, this will replace existing associations with the provided list of - entities. + business_account_tokens: Business Account tokens to which the Auth Rule applies. - Args: name: Auth Rule Name state: The desired state of the Auth Rule. @@ -1450,6 +1386,8 @@ async def update( self, auth_rule_token: str, *, + account_tokens: SequenceNotStr[str] | Omit = omit, + business_account_tokens: SequenceNotStr[str] | Omit = omit, name: Optional[str] | Omit = omit, state: Literal["INACTIVE"] | Omit = omit, card_tokens: SequenceNotStr[str] | Omit = omit, @@ -1468,6 +1406,8 @@ async def update( f"/v2/auth_rules/{auth_rule_token}", body=await async_maybe_transform( { + "account_tokens": account_tokens, + "business_account_tokens": business_account_tokens, "name": name, "state": state, "card_tokens": card_tokens, diff --git a/src/lithic/resources/book_transfers.py b/src/lithic/resources/book_transfers.py index db2beb05..f2eb20ef 100644 --- a/src/lithic/resources/book_transfers.py +++ b/src/lithic/resources/book_transfers.py @@ -46,11 +46,22 @@ def create( self, *, amount: int, - category: Literal["ADJUSTMENT", "BALANCE_OR_FUNDING", "DERECOGNITION", "DISPUTE", "FEE", "REWARD", "TRANSFER"], + category: Literal[ + "ADJUSTMENT", + "BALANCE_OR_FUNDING", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", + "PROGRAM_FUNDING", + "TRANSFER", + ], from_financial_account_token: str, subtype: str, to_financial_account_token: str, type: Literal[ + "ATM_BALANCE_INQUIRY", "ATM_WITHDRAWAL", "ATM_DECLINE", "INTERNATIONAL_ATM_WITHDRAWAL", @@ -105,8 +116,6 @@ def create( amount: Amount to be transferred in the currency's smallest unit (e.g., cents for USD). This should always be a positive value. - category: Category of the book transfer - from_financial_account_token: Globally unique identifier for the financial account or card that will send the funds. Accepted type dependent on the program's use case. @@ -198,7 +207,17 @@ def list( account_token: str | Omit = omit, begin: Union[str, datetime] | Omit = omit, business_account_token: str | Omit = omit, - category: Literal["BALANCE_OR_FUNDING", "FEE", "REWARD", "ADJUSTMENT", "DERECOGNITION", "DISPUTE", "INTERNAL"] + category: Literal[ + "ADJUSTMENT", + "BALANCE_OR_FUNDING", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", + "PROGRAM_FUNDING", + "TRANSFER", + ] | Omit = omit, end: Union[str, datetime] | Omit = omit, ending_before: str | Omit = omit, @@ -342,11 +361,22 @@ async def create( self, *, amount: int, - category: Literal["ADJUSTMENT", "BALANCE_OR_FUNDING", "DERECOGNITION", "DISPUTE", "FEE", "REWARD", "TRANSFER"], + category: Literal[ + "ADJUSTMENT", + "BALANCE_OR_FUNDING", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", + "PROGRAM_FUNDING", + "TRANSFER", + ], from_financial_account_token: str, subtype: str, to_financial_account_token: str, type: Literal[ + "ATM_BALANCE_INQUIRY", "ATM_WITHDRAWAL", "ATM_DECLINE", "INTERNATIONAL_ATM_WITHDRAWAL", @@ -401,8 +431,6 @@ async def create( amount: Amount to be transferred in the currency's smallest unit (e.g., cents for USD). This should always be a positive value. - category: Category of the book transfer - from_financial_account_token: Globally unique identifier for the financial account or card that will send the funds. Accepted type dependent on the program's use case. @@ -494,7 +522,17 @@ def list( account_token: str | Omit = omit, begin: Union[str, datetime] | Omit = omit, business_account_token: str | Omit = omit, - category: Literal["BALANCE_OR_FUNDING", "FEE", "REWARD", "ADJUSTMENT", "DERECOGNITION", "DISPUTE", "INTERNAL"] + category: Literal[ + "ADJUSTMENT", + "BALANCE_OR_FUNDING", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", + "PROGRAM_FUNDING", + "TRANSFER", + ] | Omit = omit, end: Union[str, datetime] | Omit = omit, ending_before: str | Omit = omit, diff --git a/src/lithic/resources/financial_accounts/credit_configuration.py b/src/lithic/resources/financial_accounts/credit_configuration.py index 6428ba59..0ab13dbe 100644 --- a/src/lithic/resources/financial_accounts/credit_configuration.py +++ b/src/lithic/resources/financial_accounts/credit_configuration.py @@ -76,6 +76,7 @@ def update( self, financial_account_token: str, *, + auto_collection_configuration: credit_configuration_update_params.AutoCollectionConfiguration | Omit = omit, credit_limit: int | Omit = omit, credit_product_token: str | Omit = omit, external_bank_account_token: str | Omit = omit, @@ -111,6 +112,7 @@ def update( f"/v1/financial_accounts/{financial_account_token}/credit_configuration", body=maybe_transform( { + "auto_collection_configuration": auto_collection_configuration, "credit_limit": credit_limit, "credit_product_token": credit_product_token, "external_bank_account_token": external_bank_account_token, @@ -184,6 +186,7 @@ async def update( self, financial_account_token: str, *, + auto_collection_configuration: credit_configuration_update_params.AutoCollectionConfiguration | Omit = omit, credit_limit: int | Omit = omit, credit_product_token: str | Omit = omit, external_bank_account_token: str | Omit = omit, @@ -219,6 +222,7 @@ async def update( f"/v1/financial_accounts/{financial_account_token}/credit_configuration", body=await async_maybe_transform( { + "auto_collection_configuration": auto_collection_configuration, "credit_limit": credit_limit, "credit_product_token": credit_product_token, "external_bank_account_token": external_bank_account_token, diff --git a/src/lithic/types/account_activity_list_params.py b/src/lithic/types/account_activity_list_params.py index a10e3424..23c24a1f 100644 --- a/src/lithic/types/account_activity_list_params.py +++ b/src/lithic/types/account_activity_list_params.py @@ -27,6 +27,11 @@ class AccountActivityListParams(TypedDict, total=False): category: Literal[ "ACH", "BALANCE_OR_FUNDING", + "FEE", + "REWARD", + "ADJUSTMENT", + "DERECOGNITION", + "DISPUTE", "CARD", "EXTERNAL_ACH", "EXTERNAL_CHECK", diff --git a/src/lithic/types/account_activity_list_response.py b/src/lithic/types/account_activity_list_response.py index 1bf9c440..356927b1 100644 --- a/src/lithic/types/account_activity_list_response.py +++ b/src/lithic/types/account_activity_list_response.py @@ -53,12 +53,14 @@ class FinancialTransactionEvent(BaseModel): "ACH_ORIGINATION_INITIATED", "ACH_ORIGINATION_PROCESSED", "ACH_ORIGINATION_RELEASED", + "ACH_ORIGINATION_REJECTED", "ACH_ORIGINATION_REVIEWED", "ACH_ORIGINATION_SETTLED", "ACH_RECEIPT_PROCESSED", "ACH_RECEIPT_SETTLED", "ACH_RETURN_INITIATED", "ACH_RETURN_PROCESSED", + "ACH_RETURN_REJECTED", "ACH_RETURN_SETTLED", "AUTHORIZATION", "AUTHORIZATION_ADVICE", @@ -128,6 +130,11 @@ class FinancialTransaction(BaseModel): category: Literal[ "ACH", "BALANCE_OR_FUNDING", + "FEE", + "REWARD", + "ADJUSTMENT", + "DERECOGNITION", + "DISPUTE", "CARD", "EXTERNAL_ACH", "EXTERNAL_CHECK", @@ -203,6 +210,7 @@ class BookTransferTransactionEvent(BaseModel): """The program specific subtype code for the specified category/type.""" type: Literal[ + "ATM_BALANCE_INQUIRY", "ATM_WITHDRAWAL", "ATM_DECLINE", "INTERNATIONAL_ATM_WITHDRAWAL", @@ -254,19 +262,15 @@ class BookTransferTransaction(BaseModel): """Unique identifier for the transaction""" category: Literal[ - "ACH", + "ADJUSTMENT", "BALANCE_OR_FUNDING", - "CARD", - "EXTERNAL_ACH", - "EXTERNAL_CHECK", - "EXTERNAL_TRANSFER", - "EXTERNAL_WIRE", - "MANAGEMENT_ADJUSTMENT", - "MANAGEMENT_DISPUTE", - "MANAGEMENT_FEE", - "MANAGEMENT_REWARD", - "MANAGEMENT_DISBURSEMENT", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", "PROGRAM_FUNDING", + "TRANSFER", ] created: datetime @@ -458,6 +462,11 @@ class PaymentTransaction(BaseModel): category: Literal[ "ACH", "BALANCE_OR_FUNDING", + "FEE", + "REWARD", + "ADJUSTMENT", + "DERECOGNITION", + "DISPUTE", "CARD", "EXTERNAL_ACH", "EXTERNAL_CHECK", diff --git a/src/lithic/types/account_activity_retrieve_transaction_response.py b/src/lithic/types/account_activity_retrieve_transaction_response.py index 97063fbb..f25ab7df 100644 --- a/src/lithic/types/account_activity_retrieve_transaction_response.py +++ b/src/lithic/types/account_activity_retrieve_transaction_response.py @@ -53,12 +53,14 @@ class FinancialTransactionEvent(BaseModel): "ACH_ORIGINATION_INITIATED", "ACH_ORIGINATION_PROCESSED", "ACH_ORIGINATION_RELEASED", + "ACH_ORIGINATION_REJECTED", "ACH_ORIGINATION_REVIEWED", "ACH_ORIGINATION_SETTLED", "ACH_RECEIPT_PROCESSED", "ACH_RECEIPT_SETTLED", "ACH_RETURN_INITIATED", "ACH_RETURN_PROCESSED", + "ACH_RETURN_REJECTED", "ACH_RETURN_SETTLED", "AUTHORIZATION", "AUTHORIZATION_ADVICE", @@ -128,6 +130,11 @@ class FinancialTransaction(BaseModel): category: Literal[ "ACH", "BALANCE_OR_FUNDING", + "FEE", + "REWARD", + "ADJUSTMENT", + "DERECOGNITION", + "DISPUTE", "CARD", "EXTERNAL_ACH", "EXTERNAL_CHECK", @@ -203,6 +210,7 @@ class BookTransferTransactionEvent(BaseModel): """The program specific subtype code for the specified category/type.""" type: Literal[ + "ATM_BALANCE_INQUIRY", "ATM_WITHDRAWAL", "ATM_DECLINE", "INTERNATIONAL_ATM_WITHDRAWAL", @@ -254,19 +262,15 @@ class BookTransferTransaction(BaseModel): """Unique identifier for the transaction""" category: Literal[ - "ACH", + "ADJUSTMENT", "BALANCE_OR_FUNDING", - "CARD", - "EXTERNAL_ACH", - "EXTERNAL_CHECK", - "EXTERNAL_TRANSFER", - "EXTERNAL_WIRE", - "MANAGEMENT_ADJUSTMENT", - "MANAGEMENT_DISPUTE", - "MANAGEMENT_FEE", - "MANAGEMENT_REWARD", - "MANAGEMENT_DISBURSEMENT", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", "PROGRAM_FUNDING", + "TRANSFER", ] created: datetime @@ -458,6 +462,11 @@ class PaymentTransaction(BaseModel): category: Literal[ "ACH", "BALANCE_OR_FUNDING", + "FEE", + "REWARD", + "ADJUSTMENT", + "DERECOGNITION", + "DISPUTE", "CARD", "EXTERNAL_ACH", "EXTERNAL_CHECK", diff --git a/src/lithic/types/auth_rules/v2_update_params.py b/src/lithic/types/auth_rules/v2_update_params.py index 2e886523..6694505a 100644 --- a/src/lithic/types/auth_rules/v2_update_params.py +++ b/src/lithic/types/auth_rules/v2_update_params.py @@ -7,23 +7,16 @@ from ..._types import SequenceNotStr -__all__ = ["V2UpdateParams", "Variant0", "Variant1", "CardLevelRule", "ProgramLevelRule"] +__all__ = ["V2UpdateParams", "AccountLevelRule", "CardLevelRule", "ProgramLevelRule"] -class Variant0(TypedDict, total=False): - name: Optional[str] - """Auth Rule Name""" - - state: Literal["INACTIVE"] - """The desired state of the Auth Rule. - - Note that only deactivating an Auth Rule through this endpoint is supported at - this time. If you need to (re-)activate an Auth Rule the /promote endpoint - should be used to promote a draft to the currently active version. - """ +class AccountLevelRule(TypedDict, total=False): + account_tokens: SequenceNotStr[str] + """Account tokens to which the Auth Rule applies.""" + business_account_tokens: SequenceNotStr[str] + """Business Account tokens to which the Auth Rule applies.""" -class Variant1(TypedDict, total=False): name: Optional[str] """Auth Rule Name""" @@ -71,4 +64,4 @@ class ProgramLevelRule(TypedDict, total=False): """ -V2UpdateParams: TypeAlias = Union[Variant0, Variant1, CardLevelRule, ProgramLevelRule] +V2UpdateParams: TypeAlias = Union[AccountLevelRule, CardLevelRule, ProgramLevelRule] diff --git a/src/lithic/types/book_transfer_create_params.py b/src/lithic/types/book_transfer_create_params.py index 8346efc1..584734cf 100644 --- a/src/lithic/types/book_transfer_create_params.py +++ b/src/lithic/types/book_transfer_create_params.py @@ -15,9 +15,18 @@ class BookTransferCreateParams(TypedDict, total=False): """ category: Required[ - Literal["ADJUSTMENT", "BALANCE_OR_FUNDING", "DERECOGNITION", "DISPUTE", "FEE", "REWARD", "TRANSFER"] + Literal[ + "ADJUSTMENT", + "BALANCE_OR_FUNDING", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", + "PROGRAM_FUNDING", + "TRANSFER", + ] ] - """Category of the book transfer""" from_financial_account_token: Required[str] """ @@ -36,6 +45,7 @@ class BookTransferCreateParams(TypedDict, total=False): type: Required[ Literal[ + "ATM_BALANCE_INQUIRY", "ATM_WITHDRAWAL", "ATM_DECLINE", "INTERNATIONAL_ATM_WITHDRAWAL", diff --git a/src/lithic/types/book_transfer_list_params.py b/src/lithic/types/book_transfer_list_params.py index 36b406f7..1c773ca7 100644 --- a/src/lithic/types/book_transfer_list_params.py +++ b/src/lithic/types/book_transfer_list_params.py @@ -22,7 +22,17 @@ class BookTransferListParams(TypedDict, total=False): business_account_token: str - category: Literal["BALANCE_OR_FUNDING", "FEE", "REWARD", "ADJUSTMENT", "DERECOGNITION", "DISPUTE", "INTERNAL"] + category: Literal[ + "ADJUSTMENT", + "BALANCE_OR_FUNDING", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", + "PROGRAM_FUNDING", + "TRANSFER", + ] """Book Transfer category to be returned.""" end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/lithic/types/book_transfer_response.py b/src/lithic/types/book_transfer_response.py index de4fd9d2..1952b755 100644 --- a/src/lithic/types/book_transfer_response.py +++ b/src/lithic/types/book_transfer_response.py @@ -38,6 +38,7 @@ class Event(BaseModel): """The program specific subtype code for the specified category/type.""" type: Literal[ + "ATM_BALANCE_INQUIRY", "ATM_WITHDRAWAL", "ATM_DECLINE", "INTERNATIONAL_ATM_WITHDRAWAL", @@ -91,8 +92,17 @@ class BookTransferResponse(BaseModel): This token will become the transaction token. """ - category: Literal["ADJUSTMENT", "BALANCE_OR_FUNDING", "DERECOGNITION", "DISPUTE", "FEE", "REWARD", "TRANSFER"] - """Category of the book transfer""" + category: Literal[ + "ADJUSTMENT", + "BALANCE_OR_FUNDING", + "DERECOGNITION", + "DISPUTE", + "FEE", + "INTERNAL", + "REWARD", + "PROGRAM_FUNDING", + "TRANSFER", + ] created: datetime """Date and time when the transfer occurred. UTC time zone.""" diff --git a/src/lithic/types/financial_account.py b/src/lithic/types/financial_account.py index b3fa2bc8..0842fbf1 100644 --- a/src/lithic/types/financial_account.py +++ b/src/lithic/types/financial_account.py @@ -6,7 +6,12 @@ from .._models import BaseModel -__all__ = ["FinancialAccount", "CreditConfiguration"] +__all__ = ["FinancialAccount", "CreditConfiguration", "CreditConfigurationAutoCollectionConfiguration"] + + +class CreditConfigurationAutoCollectionConfiguration(BaseModel): + auto_collection_enabled: bool + """If auto collection is enabled for this account""" class CreditConfiguration(BaseModel): @@ -28,6 +33,8 @@ class CreditConfiguration(BaseModel): tier: Optional[str] = None """Tier assigned to the financial account""" + auto_collection_configuration: Optional[CreditConfigurationAutoCollectionConfiguration] = None + class FinancialAccount(BaseModel): token: str diff --git a/src/lithic/types/financial_accounts/credit_configuration_update_params.py b/src/lithic/types/financial_accounts/credit_configuration_update_params.py index c6a54d33..f63d4559 100644 --- a/src/lithic/types/financial_accounts/credit_configuration_update_params.py +++ b/src/lithic/types/financial_accounts/credit_configuration_update_params.py @@ -4,10 +4,12 @@ from typing_extensions import TypedDict -__all__ = ["CreditConfigurationUpdateParams"] +__all__ = ["CreditConfigurationUpdateParams", "AutoCollectionConfiguration"] class CreditConfigurationUpdateParams(TypedDict, total=False): + auto_collection_configuration: AutoCollectionConfiguration + credit_limit: int credit_product_token: str @@ -17,3 +19,8 @@ class CreditConfigurationUpdateParams(TypedDict, total=False): tier: str """Tier to assign to a financial account""" + + +class AutoCollectionConfiguration(TypedDict, total=False): + auto_collection_enabled: bool + """If auto collection is enabled for this account""" diff --git a/src/lithic/types/financial_accounts/financial_account_credit_config.py b/src/lithic/types/financial_accounts/financial_account_credit_config.py index 97a7d38b..63ecb98a 100644 --- a/src/lithic/types/financial_accounts/financial_account_credit_config.py +++ b/src/lithic/types/financial_accounts/financial_account_credit_config.py @@ -5,13 +5,20 @@ from ..._models import BaseModel -__all__ = ["FinancialAccountCreditConfig"] +__all__ = ["FinancialAccountCreditConfig", "AutoCollectionConfiguration"] + + +class AutoCollectionConfiguration(BaseModel): + auto_collection_enabled: bool + """If auto collection is enabled for this account""" class FinancialAccountCreditConfig(BaseModel): account_token: str """Globally unique identifier for the account""" + auto_collection_configuration: AutoCollectionConfiguration + charged_off_reason: Optional[Literal["DELINQUENT", "FRAUD"]] = None """Reason for the financial account being marked as Charged Off""" diff --git a/src/lithic/types/financial_accounts/statements/statement_line_items.py b/src/lithic/types/financial_accounts/statements/statement_line_items.py index 7e5e4c38..60b8122e 100644 --- a/src/lithic/types/financial_accounts/statements/statement_line_items.py +++ b/src/lithic/types/financial_accounts/statements/statement_line_items.py @@ -19,6 +19,11 @@ class Data(BaseModel): category: Literal[ "ACH", "BALANCE_OR_FUNDING", + "FEE", + "REWARD", + "ADJUSTMENT", + "DERECOGNITION", + "DISPUTE", "CARD", "EXTERNAL_ACH", "EXTERNAL_CHECK", @@ -49,12 +54,14 @@ class Data(BaseModel): "ACH_ORIGINATION_INITIATED", "ACH_ORIGINATION_PROCESSED", "ACH_ORIGINATION_RELEASED", + "ACH_ORIGINATION_REJECTED", "ACH_ORIGINATION_REVIEWED", "ACH_ORIGINATION_SETTLED", "ACH_RECEIPT_PROCESSED", "ACH_RECEIPT_SETTLED", "ACH_RETURN_INITIATED", "ACH_RETURN_PROCESSED", + "ACH_RETURN_REJECTED", "ACH_RETURN_SETTLED", "AUTHORIZATION", "AUTHORIZATION_ADVICE", diff --git a/src/lithic/types/financial_transaction.py b/src/lithic/types/financial_transaction.py index 07249cb9..2235c413 100644 --- a/src/lithic/types/financial_transaction.py +++ b/src/lithic/types/financial_transaction.py @@ -34,12 +34,14 @@ class Event(BaseModel): "ACH_ORIGINATION_INITIATED", "ACH_ORIGINATION_PROCESSED", "ACH_ORIGINATION_RELEASED", + "ACH_ORIGINATION_REJECTED", "ACH_ORIGINATION_REVIEWED", "ACH_ORIGINATION_SETTLED", "ACH_RECEIPT_PROCESSED", "ACH_RECEIPT_SETTLED", "ACH_RETURN_INITIATED", "ACH_RETURN_PROCESSED", + "ACH_RETURN_REJECTED", "ACH_RETURN_SETTLED", "AUTHORIZATION", "AUTHORIZATION_ADVICE", diff --git a/src/lithic/types/settlement_detail.py b/src/lithic/types/settlement_detail.py index dc32694d..91c8a07c 100644 --- a/src/lithic/types/settlement_detail.py +++ b/src/lithic/types/settlement_detail.py @@ -21,19 +21,19 @@ class SettlementDetail(BaseModel): account_token: str """ - The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE - for Visa). + Globally unique identifier denoting the account that the associated transaction + occurred on. """ card_program_token: str """ Globally unique identifier denoting the card program that the associated - Transaction occurred on. + transaction occurred on. """ card_token: str """ - Globally unique identifier denoting the card that the associated Transaction + Globally unique identifier denoting the card that the associated transaction occurred on. """ diff --git a/src/lithic/types/tokenization.py b/src/lithic/types/tokenization.py index e267cbef..c6f6d12b 100644 --- a/src/lithic/types/tokenization.py +++ b/src/lithic/types/tokenization.py @@ -58,6 +58,7 @@ class Tokenization(BaseModel): created_at: datetime """Date and time when the tokenization first occurred. UTC time zone.""" + status: Literal["ACTIVE", "DEACTIVATED", "INACTIVE", "PAUSED", "PENDING_2FA", "PENDING_ACTIVATION", "UNKNOWN"] """The status of the tokenization request""" diff --git a/src/lithic/types/transaction.py b/src/lithic/types/transaction.py index 0c24ad67..9f4d946d 100644 --- a/src/lithic/types/transaction.py +++ b/src/lithic/types/transaction.py @@ -522,6 +522,7 @@ class EventRuleResult(BaseModel): "REVERSAL_UNMATCHED", "SECURITY_VIOLATION", "SINGLE_USE_CARD_REATTEMPTED", + "SUSPECTED_FRAUD", "TRANSACTION_INVALID", "TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL", "TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER", @@ -633,6 +634,7 @@ class Event(BaseModel): "REVERSAL_UNMATCHED", "SECURITY_VIOLATION", "SINGLE_USE_CARD_REATTEMPTED", + "SUSPECTED_FRAUD", "TRANSACTION_INVALID", "TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL", "TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER", @@ -669,6 +671,7 @@ class Event(BaseModel): "DECLINED", "FRAUD_ADVICE", "IGNORED_TTL_EXPIRY", + "SUSPECTED_FRAUD", "INACTIVE_ACCOUNT", "INCORRECT_PIN", "INVALID_CARD_DETAILS", @@ -762,6 +765,8 @@ class Transaction(BaseModel): created: datetime """Date and time when the transaction first occurred. UTC time zone.""" + financial_account_token: Optional[str] = None + merchant: Merchant merchant_amount: Optional[int] = None @@ -802,6 +807,7 @@ class Transaction(BaseModel): "DECLINED", "FRAUD_ADVICE", "IGNORED_TTL_EXPIRY", + "SUSPECTED_FRAUD", "INACTIVE_ACCOUNT", "INCORRECT_PIN", "INVALID_CARD_DETAILS", diff --git a/tests/api_resources/auth_rules/test_v2.py b/tests/api_resources/auth_rules/test_v2.py index 4f1d02c5..92208e8d 100644 --- a/tests/api_resources/auth_rules/test_v2.py +++ b/tests/api_resources/auth_rules/test_v2.py @@ -227,6 +227,8 @@ def test_method_update_overload_1(self, client: Lithic) -> None: def test_method_update_with_all_params_overload_1(self, client: Lithic) -> None: v2 = client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + business_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], name="name", state="INACTIVE", ) @@ -274,6 +276,7 @@ def test_method_update_overload_2(self, client: Lithic) -> None: def test_method_update_with_all_params_overload_2(self, client: Lithic) -> None: v2 = client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], name="name", state="INACTIVE", ) @@ -321,8 +324,9 @@ def test_method_update_overload_3(self, client: Lithic) -> None: def test_method_update_with_all_params_overload_3(self, client: Lithic) -> None: v2 = client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], name="name", + program_level=True, state="INACTIVE", ) assert_matches_type(V2UpdateResponse, v2, path=["response"]) @@ -358,55 +362,6 @@ def test_path_params_update_overload_3(self, client: Lithic) -> None: auth_rule_token="", ) - @parametrize - def test_method_update_overload_4(self, client: Lithic) -> None: - v2 = client.auth_rules.v2.update( - auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(V2UpdateResponse, v2, path=["response"]) - - @parametrize - def test_method_update_with_all_params_overload_4(self, client: Lithic) -> None: - v2 = client.auth_rules.v2.update( - auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - name="name", - program_level=True, - state="INACTIVE", - ) - assert_matches_type(V2UpdateResponse, v2, path=["response"]) - - @parametrize - def test_raw_response_update_overload_4(self, client: Lithic) -> None: - response = client.auth_rules.v2.with_raw_response.update( - auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - v2 = response.parse() - assert_matches_type(V2UpdateResponse, v2, path=["response"]) - - @parametrize - def test_streaming_response_update_overload_4(self, client: Lithic) -> None: - with client.auth_rules.v2.with_streaming_response.update( - auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - v2 = response.parse() - assert_matches_type(V2UpdateResponse, v2, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update_overload_4(self, client: Lithic) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): - client.auth_rules.v2.with_raw_response.update( - auth_rule_token="", - ) - @parametrize def test_method_list(self, client: Lithic) -> None: v2 = client.auth_rules.v2.list() @@ -1072,6 +1027,8 @@ async def test_method_update_overload_1(self, async_client: AsyncLithic) -> None async def test_method_update_with_all_params_overload_1(self, async_client: AsyncLithic) -> None: v2 = await async_client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + business_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], name="name", state="INACTIVE", ) @@ -1119,6 +1076,7 @@ async def test_method_update_overload_2(self, async_client: AsyncLithic) -> None async def test_method_update_with_all_params_overload_2(self, async_client: AsyncLithic) -> None: v2 = await async_client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], name="name", state="INACTIVE", ) @@ -1166,8 +1124,9 @@ async def test_method_update_overload_3(self, async_client: AsyncLithic) -> None async def test_method_update_with_all_params_overload_3(self, async_client: AsyncLithic) -> None: v2 = await async_client.auth_rules.v2.update( auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], name="name", + program_level=True, state="INACTIVE", ) assert_matches_type(V2UpdateResponse, v2, path=["response"]) @@ -1203,55 +1162,6 @@ async def test_path_params_update_overload_3(self, async_client: AsyncLithic) -> auth_rule_token="", ) - @parametrize - async def test_method_update_overload_4(self, async_client: AsyncLithic) -> None: - v2 = await async_client.auth_rules.v2.update( - auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - assert_matches_type(V2UpdateResponse, v2, path=["response"]) - - @parametrize - async def test_method_update_with_all_params_overload_4(self, async_client: AsyncLithic) -> None: - v2 = await async_client.auth_rules.v2.update( - auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], - name="name", - program_level=True, - state="INACTIVE", - ) - assert_matches_type(V2UpdateResponse, v2, path=["response"]) - - @parametrize - async def test_raw_response_update_overload_4(self, async_client: AsyncLithic) -> None: - response = await async_client.auth_rules.v2.with_raw_response.update( - auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - v2 = response.parse() - assert_matches_type(V2UpdateResponse, v2, path=["response"]) - - @parametrize - async def test_streaming_response_update_overload_4(self, async_client: AsyncLithic) -> None: - async with async_client.auth_rules.v2.with_streaming_response.update( - auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - v2 = await response.parse() - assert_matches_type(V2UpdateResponse, v2, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update_overload_4(self, async_client: AsyncLithic) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): - await async_client.auth_rules.v2.with_raw_response.update( - auth_rule_token="", - ) - @parametrize async def test_method_list(self, async_client: AsyncLithic) -> None: v2 = await async_client.auth_rules.v2.list() diff --git a/tests/api_resources/financial_accounts/test_credit_configuration.py b/tests/api_resources/financial_accounts/test_credit_configuration.py index a88de2b8..9cd59b59 100644 --- a/tests/api_resources/financial_accounts/test_credit_configuration.py +++ b/tests/api_resources/financial_accounts/test_credit_configuration.py @@ -68,6 +68,7 @@ def test_method_update(self, client: Lithic) -> None: def test_method_update_with_all_params(self, client: Lithic) -> None: credit_configuration = client.financial_accounts.credit_configuration.update( financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + auto_collection_configuration={"auto_collection_enabled": True}, credit_limit=0, credit_product_token="credit_product_token", external_bank_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -165,6 +166,7 @@ async def test_method_update(self, async_client: AsyncLithic) -> None: async def test_method_update_with_all_params(self, async_client: AsyncLithic) -> None: credit_configuration = await async_client.financial_accounts.credit_configuration.update( financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + auto_collection_configuration={"auto_collection_enabled": True}, credit_limit=0, credit_product_token="credit_product_token", external_bank_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", diff --git a/tests/api_resources/test_book_transfers.py b/tests/api_resources/test_book_transfers.py index 704442c6..38aa6510 100644 --- a/tests/api_resources/test_book_transfers.py +++ b/tests/api_resources/test_book_transfers.py @@ -29,7 +29,7 @@ def test_method_create(self, client: Lithic) -> None: from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", subtype="subtype", to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - type="ATM_WITHDRAWAL", + type="ATM_BALANCE_INQUIRY", ) assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Lithic) -> None: from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", subtype="subtype", to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - type="ATM_WITHDRAWAL", + type="ATM_BALANCE_INQUIRY", token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", external_id="external_id", memo="memo", @@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Lithic) -> None: from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", subtype="subtype", to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - type="ATM_WITHDRAWAL", + type="ATM_BALANCE_INQUIRY", ) assert response.is_closed is True @@ -73,7 +73,7 @@ def test_streaming_response_create(self, client: Lithic) -> None: from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", subtype="subtype", to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - type="ATM_WITHDRAWAL", + type="ATM_BALANCE_INQUIRY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -132,7 +132,7 @@ def test_method_list_with_all_params(self, client: Lithic) -> None: account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", begin=parse_datetime("2019-12-27T18:11:19.117Z"), business_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - category="BALANCE_OR_FUNDING", + category="ADJUSTMENT", end=parse_datetime("2019-12-27T18:11:19.117Z"), ending_before="ending_before", financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -223,7 +223,7 @@ async def test_method_create(self, async_client: AsyncLithic) -> None: from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", subtype="subtype", to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - type="ATM_WITHDRAWAL", + type="ATM_BALANCE_INQUIRY", ) assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) @@ -235,7 +235,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) -> from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", subtype="subtype", to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - type="ATM_WITHDRAWAL", + type="ATM_BALANCE_INQUIRY", token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", external_id="external_id", memo="memo", @@ -251,7 +251,7 @@ async def test_raw_response_create(self, async_client: AsyncLithic) -> None: from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", subtype="subtype", to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - type="ATM_WITHDRAWAL", + type="ATM_BALANCE_INQUIRY", ) assert response.is_closed is True @@ -267,7 +267,7 @@ async def test_streaming_response_create(self, async_client: AsyncLithic) -> Non from_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", subtype="subtype", to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - type="ATM_WITHDRAWAL", + type="ATM_BALANCE_INQUIRY", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -326,7 +326,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> N account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", begin=parse_datetime("2019-12-27T18:11:19.117Z"), business_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - category="BALANCE_OR_FUNDING", + category="ADJUSTMENT", end=parse_datetime("2019-12-27T18:11:19.117Z"), ending_before="ending_before", financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",