From b3073149cd6e2e201b9913c2420e720254363296 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 21:08:00 +0000 Subject: [PATCH 1/2] feat(api): adds Event types for additional API resources --- .stats.yml | 6 +- src/lithic/resources/account_activity.py | 8 + src/lithic/resources/book_transfers.py | 24 +- .../types/account_activity_list_params.py | 3 + .../types/account_activity_list_response.py | 245 +++++++++++++++++- ..._activity_retrieve_transaction_response.py | 245 +++++++++++++++++- .../types/book_transfer_create_params.py | 10 +- src/lithic/types/book_transfer_response.py | 61 ++++- src/lithic/types/financial_account.py | 1 + src/lithic/types/payment.py | 16 ++ .../shared/instance_financial_account_type.py | 1 + tests/api_resources/test_account_activity.py | 2 + tests/api_resources/test_book_transfers.py | 4 + 13 files changed, 598 insertions(+), 28 deletions(-) diff --git a/.stats.yml b/.stats.yml index c41d7639..8791c52a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aca56b6e4da5b97e586e66392dd3cf433208cb964e25081a661dd41cf456a88a.yml -openapi_spec_hash: 297b9f330d31db8e5832463a0ce455ba -config_hash: 99dad20b4a7d4a1390670762b9da4231 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-e16df7d65a6ababc8e0ca1f2a65070893d82d3b2b046394ab708d56fe717b3ad.yml +openapi_spec_hash: ee82cf8fd5bb6b86abbae304f6c43934 +config_hash: c6d56596249e319c59d49d8e49a190b1 diff --git a/src/lithic/resources/account_activity.py b/src/lithic/resources/account_activity.py index 287924c1..64d0a6bc 100644 --- a/src/lithic/resources/account_activity.py +++ b/src/lithic/resources/account_activity.py @@ -46,6 +46,7 @@ def with_streaming_response(self) -> AccountActivityWithStreamingResponse: def list( self, *, + account_token: str | NotGiven = NOT_GIVEN, begin: Union[str, datetime] | NotGiven = NOT_GIVEN, business_account_token: str | NotGiven = NOT_GIVEN, category: Literal[ @@ -83,6 +84,8 @@ def list( Retrieve a list of transactions across all public accounts. Args: + account_token: Filter by account token + begin: Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone. @@ -125,6 +128,7 @@ def list( timeout=timeout, query=maybe_transform( { + "account_token": account_token, "begin": begin, "business_account_token": business_account_token, "category": category, @@ -206,6 +210,7 @@ def with_streaming_response(self) -> AsyncAccountActivityWithStreamingResponse: def list( self, *, + account_token: str | NotGiven = NOT_GIVEN, begin: Union[str, datetime] | NotGiven = NOT_GIVEN, business_account_token: str | NotGiven = NOT_GIVEN, category: Literal[ @@ -243,6 +248,8 @@ def list( Retrieve a list of transactions across all public accounts. Args: + account_token: Filter by account token + begin: Date string in RFC 3339 format. Only entries created after the specified time will be included. UTC time zone. @@ -285,6 +292,7 @@ def list( timeout=timeout, query=maybe_transform( { + "account_token": account_token, "begin": begin, "business_account_token": business_account_token, "category": category, diff --git a/src/lithic/resources/book_transfers.py b/src/lithic/resources/book_transfers.py index 38cad567..32e90b42 100644 --- a/src/lithic/resources/book_transfers.py +++ b/src/lithic/resources/book_transfers.py @@ -86,7 +86,9 @@ def create( "TRANSFER", ], token: str | NotGiven = NOT_GIVEN, + external_id: str | NotGiven = NOT_GIVEN, memo: str | NotGiven = NOT_GIVEN, + on_closed_account: Literal["FAIL", "USE_SUSPENSE"] | NotGiven = NOT_GIVEN, # 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, @@ -99,7 +101,7 @@ def create( account and card Args: - amount: Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + 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 @@ -112,13 +114,17 @@ def create( to_financial_account_token: Globally unique identifier for the financial account or card that will receive the funds. Accepted type dependent on the program's use case. - type: Type of book_transfer + type: Type of the book transfer token: Customer-provided token that will serve as an idempotency token. This token will become the transaction token. + external_id: External ID defined by the customer + memo: Optional descriptor for the transfer. + on_closed_account: What to do if the financial account is closed when posting an operation + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -138,7 +144,9 @@ def create( "to_financial_account_token": to_financial_account_token, "type": type, "token": token, + "external_id": external_id, "memo": memo, + "on_closed_account": on_closed_account, }, book_transfer_create_params.BookTransferCreateParams, ), @@ -373,7 +381,9 @@ async def create( "TRANSFER", ], token: str | NotGiven = NOT_GIVEN, + external_id: str | NotGiven = NOT_GIVEN, memo: str | NotGiven = NOT_GIVEN, + on_closed_account: Literal["FAIL", "USE_SUSPENSE"] | NotGiven = NOT_GIVEN, # 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, @@ -386,7 +396,7 @@ async def create( account and card Args: - amount: Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + 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 @@ -399,13 +409,17 @@ async def create( to_financial_account_token: Globally unique identifier for the financial account or card that will receive the funds. Accepted type dependent on the program's use case. - type: Type of book_transfer + type: Type of the book transfer token: Customer-provided token that will serve as an idempotency token. This token will become the transaction token. + external_id: External ID defined by the customer + memo: Optional descriptor for the transfer. + on_closed_account: What to do if the financial account is closed when posting an operation + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -425,7 +439,9 @@ async def create( "to_financial_account_token": to_financial_account_token, "type": type, "token": token, + "external_id": external_id, "memo": memo, + "on_closed_account": on_closed_account, }, book_transfer_create_params.BookTransferCreateParams, ), diff --git a/src/lithic/types/account_activity_list_params.py b/src/lithic/types/account_activity_list_params.py index 6de22fcb..888edb8b 100644 --- a/src/lithic/types/account_activity_list_params.py +++ b/src/lithic/types/account_activity_list_params.py @@ -12,6 +12,9 @@ class AccountActivityListParams(TypedDict, total=False): + account_token: str + """Filter by account token""" + begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """Date string in RFC 3339 format. diff --git a/src/lithic/types/account_activity_list_response.py b/src/lithic/types/account_activity_list_response.py index 7c083dc6..0abcca44 100644 --- a/src/lithic/types/account_activity_list_response.py +++ b/src/lithic/types/account_activity_list_response.py @@ -13,10 +13,13 @@ __all__ = [ "AccountActivityListResponse", "FinancialTransaction", + "FinancialTransactionEvent", "BookTransferTransaction", + "BookTransferTransactionEvent", "BookTransferTransactionTransactionSeries", "CardTransaction", "PaymentTransaction", + "PaymentTransactionEvent", "PaymentTransactionMethodAttributes", "PaymentTransactionMethodAttributesACHMethodAttributes", "PaymentTransactionMethodAttributesWireMethodAttributes", @@ -24,6 +27,99 @@ ] +class FinancialTransactionEvent(BaseModel): + token: Optional[str] = None + """Globally unique identifier.""" + + amount: Optional[int] = None + """ + Amount of the financial event that has been settled in the currency's smallest + unit (e.g., cents). + """ + + created: Optional[datetime] = None + """Date and time when the financial event occurred. UTC time zone.""" + + result: Optional[Literal["APPROVED", "DECLINED"]] = None + """ + APPROVED financial events were successful while DECLINED financial events were + declined by user, Lithic, or the network. + """ + + type: Optional[ + Literal[ + "ACH_ORIGINATION_CANCELLED", + "ACH_ORIGINATION_INITIATED", + "ACH_ORIGINATION_PROCESSED", + "ACH_ORIGINATION_RELEASED", + "ACH_ORIGINATION_REVIEWED", + "ACH_ORIGINATION_SETTLED", + "ACH_RECEIPT_PROCESSED", + "ACH_RECEIPT_SETTLED", + "ACH_RETURN_INITIATED", + "ACH_RETURN_PROCESSED", + "ACH_RETURN_SETTLED", + "AUTHORIZATION", + "AUTHORIZATION_ADVICE", + "AUTHORIZATION_EXPIRY", + "AUTHORIZATION_REVERSAL", + "BALANCE_INQUIRY", + "BILLING_ERROR", + "BILLING_ERROR_REVERSAL", + "CARD_TO_CARD", + "CASH_BACK", + "CASH_BACK_REVERSAL", + "CLEARING", + "COLLECTION", + "CORRECTION_CREDIT", + "CORRECTION_DEBIT", + "CREDIT_AUTHORIZATION", + "CREDIT_AUTHORIZATION_ADVICE", + "CURRENCY_CONVERSION", + "CURRENCY_CONVERSION_REVERSAL", + "DISPUTE_WON", + "EXTERNAL_ACH_CANCELED", + "EXTERNAL_ACH_INITIATED", + "EXTERNAL_ACH_RELEASED", + "EXTERNAL_ACH_REVERSED", + "EXTERNAL_ACH_SETTLED", + "EXTERNAL_CHECK_CANCELED", + "EXTERNAL_CHECK_INITIATED", + "EXTERNAL_CHECK_RELEASED", + "EXTERNAL_CHECK_REVERSED", + "EXTERNAL_CHECK_SETTLED", + "EXTERNAL_TRANSFER_CANCELED", + "EXTERNAL_TRANSFER_INITIATED", + "EXTERNAL_TRANSFER_RELEASED", + "EXTERNAL_TRANSFER_REVERSED", + "EXTERNAL_TRANSFER_SETTLED", + "EXTERNAL_WIRE_CANCELED", + "EXTERNAL_WIRE_INITIATED", + "EXTERNAL_WIRE_RELEASED", + "EXTERNAL_WIRE_REVERSED", + "EXTERNAL_WIRE_SETTLED", + "FINANCIAL_AUTHORIZATION", + "FINANCIAL_CREDIT_AUTHORIZATION", + "INTEREST", + "INTEREST_REVERSAL", + "INTERNAL_ADJUSTMENT", + "LATE_PAYMENT", + "LATE_PAYMENT_REVERSAL", + "LOSS_WRITE_OFF", + "PROVISIONAL_CREDIT", + "PROVISIONAL_CREDIT_REVERSAL", + "SERVICE", + "RETURN", + "RETURN_REVERSAL", + "TRANSFER", + "TRANSFER_INSUFFICIENT_FUNDS", + "RETURNED_PAYMENT", + "RETURNED_PAYMENT_REVERSAL", + "LITHIC_NETWORK_PAYMENT", + ] + ] = None + + class FinancialTransaction(BaseModel): token: str """Unique identifier for the transaction""" @@ -54,7 +150,7 @@ class FinancialTransaction(BaseModel): descriptor: str """Transaction descriptor""" - events: List[object] + events: List[FinancialTransactionEvent] """List of transaction events""" family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"] @@ -78,6 +174,71 @@ class FinancialTransaction(BaseModel): """ISO 8601 timestamp of when the transaction was last updated""" +class BookTransferTransactionEvent(BaseModel): + token: str + """Globally unique identifier.""" + + amount: int + """ + Amount of the financial event that has been settled in the currency's smallest + unit (e.g., cents). + """ + + created: datetime + """Date and time when the financial event occurred. UTC time zone.""" + + detailed_results: Literal["APPROVED", "FUNDS_INSUFFICIENT"] + + memo: str + """Memo for the transfer.""" + + result: Literal["APPROVED", "DECLINED"] + """ + APPROVED financial events were successful while DECLINED financial events were + declined by user, Lithic, or the network. + """ + + subtype: str + """The program specific subtype code for the specified category/type.""" + + type: Literal[ + "ATM_WITHDRAWAL", + "ATM_DECLINE", + "INTERNATIONAL_ATM_WITHDRAWAL", + "INACTIVITY", + "STATEMENT", + "MONTHLY", + "QUARTERLY", + "ANNUAL", + "CUSTOMER_SERVICE", + "ACCOUNT_MAINTENANCE", + "ACCOUNT_ACTIVATION", + "ACCOUNT_CLOSURE", + "CARD_REPLACEMENT", + "CARD_DELIVERY", + "CARD_CREATE", + "CURRENCY_CONVERSION", + "INTEREST", + "LATE_PAYMENT", + "BILL_PAYMENT", + "CASH_BACK", + "ACCOUNT_TO_ACCOUNT", + "CARD_TO_CARD", + "DISBURSE", + "BILLING_ERROR", + "LOSS_WRITE_OFF", + "EXPIRED_CARD", + "EARLY_DERECOGNITION", + "ESCHEATMENT", + "INACTIVITY_FEE_DOWN", + "PROVISIONAL_CREDIT", + "DISPUTE_WON", + "SERVICE", + "TRANSFER", + ] + """Type of the book transfer""" + + class BookTransferTransactionTransactionSeries(BaseModel): related_transaction_event_token: Optional[str] = None @@ -112,7 +273,7 @@ class BookTransferTransaction(BaseModel): currency: str """Currency of the transaction in ISO 4217 format""" - events: List[object] + events: List[BookTransferTransactionEvent] """List of events associated with this book transfer""" family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"] @@ -162,6 +323,75 @@ class CardTransaction(Transaction): """ISO 8601 timestamp of when the transaction was last updated""" +class PaymentTransactionEvent(BaseModel): + token: str + """Globally unique identifier.""" + + amount: int + """ + Amount of the financial event that has been settled in the currency's smallest + unit (e.g., cents). + """ + + created: datetime + """Date and time when the financial event occurred. UTC time zone.""" + + result: Literal["APPROVED", "DECLINED"] + """ + APPROVED financial events were successful while DECLINED financial events were + declined by user, Lithic, or the network. + """ + + type: Literal[ + "ACH_ORIGINATION_CANCELLED", + "ACH_ORIGINATION_INITIATED", + "ACH_ORIGINATION_PROCESSED", + "ACH_ORIGINATION_SETTLED", + "ACH_ORIGINATION_RELEASED", + "ACH_ORIGINATION_REVIEWED", + "ACH_RECEIPT_PROCESSED", + "ACH_RECEIPT_SETTLED", + "ACH_RETURN_INITIATED", + "ACH_RETURN_PROCESSED", + "ACH_RETURN_SETTLED", + ] + """Event types: + + - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + approval/release from an ACH hold. + - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + the Federal Reserve. + - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + available balance. + - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + Financial Institution. + - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + balance. + - `ACH_RETURN_SETTLED` - ACH receipt return settled by the Receiving Depository + Financial Institution. + """ + + detailed_results: Optional[ + List[ + Literal[ + "APPROVED", + "FUNDS_INSUFFICIENT", + "ACCOUNT_INVALID", + "PROGRAM_TRANSACTION_LIMIT_EXCEEDED", + "PROGRAM_DAILY_LIMIT_EXCEEDED", + "PROGRAM_MONTHLY_LIMIT_EXCEEDED", + ] + ] + ] = None + """More detailed reasons for the event""" + + class PaymentTransactionMethodAttributesACHMethodAttributes(BaseModel): sec_code: Literal["CCD", "PPD", "WEB", "TEL", "CIE", "CTX"] """SEC code for ACH transaction""" @@ -198,6 +428,9 @@ class PaymentTransactionMethodAttributesWireMethodAttributes(BaseModel): external_individual_name: Optional[str] = None """External individual name""" + imad: Optional[str] = None + """IMAD""" + lithic_bank_name: Optional[str] = None """Lithic bank name""" @@ -207,9 +440,15 @@ class PaymentTransactionMethodAttributesWireMethodAttributes(BaseModel): lithic_individual_name: Optional[str] = None """Lithic individual name""" + omad: Optional[str] = None + """OMAD""" + previous_transfer: Optional[str] = None """UUID of previous transfer if this is a retry""" + wire_token: Optional[str] = None + """Wire token""" + PaymentTransactionMethodAttributes: TypeAlias = Union[ PaymentTransactionMethodAttributesACHMethodAttributes, PaymentTransactionMethodAttributesWireMethodAttributes @@ -254,7 +493,7 @@ class PaymentTransaction(BaseModel): direction: Literal["CREDIT", "DEBIT"] """Transfer direction""" - events: List[object] + events: List[PaymentTransactionEvent] """List of transaction events""" family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"] diff --git a/src/lithic/types/account_activity_retrieve_transaction_response.py b/src/lithic/types/account_activity_retrieve_transaction_response.py index 6982fafa..e26f2443 100644 --- a/src/lithic/types/account_activity_retrieve_transaction_response.py +++ b/src/lithic/types/account_activity_retrieve_transaction_response.py @@ -13,10 +13,13 @@ __all__ = [ "AccountActivityRetrieveTransactionResponse", "FinancialTransaction", + "FinancialTransactionEvent", "BookTransferTransaction", + "BookTransferTransactionEvent", "BookTransferTransactionTransactionSeries", "CardTransaction", "PaymentTransaction", + "PaymentTransactionEvent", "PaymentTransactionMethodAttributes", "PaymentTransactionMethodAttributesACHMethodAttributes", "PaymentTransactionMethodAttributesWireMethodAttributes", @@ -24,6 +27,99 @@ ] +class FinancialTransactionEvent(BaseModel): + token: Optional[str] = None + """Globally unique identifier.""" + + amount: Optional[int] = None + """ + Amount of the financial event that has been settled in the currency's smallest + unit (e.g., cents). + """ + + created: Optional[datetime] = None + """Date and time when the financial event occurred. UTC time zone.""" + + result: Optional[Literal["APPROVED", "DECLINED"]] = None + """ + APPROVED financial events were successful while DECLINED financial events were + declined by user, Lithic, or the network. + """ + + type: Optional[ + Literal[ + "ACH_ORIGINATION_CANCELLED", + "ACH_ORIGINATION_INITIATED", + "ACH_ORIGINATION_PROCESSED", + "ACH_ORIGINATION_RELEASED", + "ACH_ORIGINATION_REVIEWED", + "ACH_ORIGINATION_SETTLED", + "ACH_RECEIPT_PROCESSED", + "ACH_RECEIPT_SETTLED", + "ACH_RETURN_INITIATED", + "ACH_RETURN_PROCESSED", + "ACH_RETURN_SETTLED", + "AUTHORIZATION", + "AUTHORIZATION_ADVICE", + "AUTHORIZATION_EXPIRY", + "AUTHORIZATION_REVERSAL", + "BALANCE_INQUIRY", + "BILLING_ERROR", + "BILLING_ERROR_REVERSAL", + "CARD_TO_CARD", + "CASH_BACK", + "CASH_BACK_REVERSAL", + "CLEARING", + "COLLECTION", + "CORRECTION_CREDIT", + "CORRECTION_DEBIT", + "CREDIT_AUTHORIZATION", + "CREDIT_AUTHORIZATION_ADVICE", + "CURRENCY_CONVERSION", + "CURRENCY_CONVERSION_REVERSAL", + "DISPUTE_WON", + "EXTERNAL_ACH_CANCELED", + "EXTERNAL_ACH_INITIATED", + "EXTERNAL_ACH_RELEASED", + "EXTERNAL_ACH_REVERSED", + "EXTERNAL_ACH_SETTLED", + "EXTERNAL_CHECK_CANCELED", + "EXTERNAL_CHECK_INITIATED", + "EXTERNAL_CHECK_RELEASED", + "EXTERNAL_CHECK_REVERSED", + "EXTERNAL_CHECK_SETTLED", + "EXTERNAL_TRANSFER_CANCELED", + "EXTERNAL_TRANSFER_INITIATED", + "EXTERNAL_TRANSFER_RELEASED", + "EXTERNAL_TRANSFER_REVERSED", + "EXTERNAL_TRANSFER_SETTLED", + "EXTERNAL_WIRE_CANCELED", + "EXTERNAL_WIRE_INITIATED", + "EXTERNAL_WIRE_RELEASED", + "EXTERNAL_WIRE_REVERSED", + "EXTERNAL_WIRE_SETTLED", + "FINANCIAL_AUTHORIZATION", + "FINANCIAL_CREDIT_AUTHORIZATION", + "INTEREST", + "INTEREST_REVERSAL", + "INTERNAL_ADJUSTMENT", + "LATE_PAYMENT", + "LATE_PAYMENT_REVERSAL", + "LOSS_WRITE_OFF", + "PROVISIONAL_CREDIT", + "PROVISIONAL_CREDIT_REVERSAL", + "SERVICE", + "RETURN", + "RETURN_REVERSAL", + "TRANSFER", + "TRANSFER_INSUFFICIENT_FUNDS", + "RETURNED_PAYMENT", + "RETURNED_PAYMENT_REVERSAL", + "LITHIC_NETWORK_PAYMENT", + ] + ] = None + + class FinancialTransaction(BaseModel): token: str """Unique identifier for the transaction""" @@ -54,7 +150,7 @@ class FinancialTransaction(BaseModel): descriptor: str """Transaction descriptor""" - events: List[object] + events: List[FinancialTransactionEvent] """List of transaction events""" family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"] @@ -78,6 +174,71 @@ class FinancialTransaction(BaseModel): """ISO 8601 timestamp of when the transaction was last updated""" +class BookTransferTransactionEvent(BaseModel): + token: str + """Globally unique identifier.""" + + amount: int + """ + Amount of the financial event that has been settled in the currency's smallest + unit (e.g., cents). + """ + + created: datetime + """Date and time when the financial event occurred. UTC time zone.""" + + detailed_results: Literal["APPROVED", "FUNDS_INSUFFICIENT"] + + memo: str + """Memo for the transfer.""" + + result: Literal["APPROVED", "DECLINED"] + """ + APPROVED financial events were successful while DECLINED financial events were + declined by user, Lithic, or the network. + """ + + subtype: str + """The program specific subtype code for the specified category/type.""" + + type: Literal[ + "ATM_WITHDRAWAL", + "ATM_DECLINE", + "INTERNATIONAL_ATM_WITHDRAWAL", + "INACTIVITY", + "STATEMENT", + "MONTHLY", + "QUARTERLY", + "ANNUAL", + "CUSTOMER_SERVICE", + "ACCOUNT_MAINTENANCE", + "ACCOUNT_ACTIVATION", + "ACCOUNT_CLOSURE", + "CARD_REPLACEMENT", + "CARD_DELIVERY", + "CARD_CREATE", + "CURRENCY_CONVERSION", + "INTEREST", + "LATE_PAYMENT", + "BILL_PAYMENT", + "CASH_BACK", + "ACCOUNT_TO_ACCOUNT", + "CARD_TO_CARD", + "DISBURSE", + "BILLING_ERROR", + "LOSS_WRITE_OFF", + "EXPIRED_CARD", + "EARLY_DERECOGNITION", + "ESCHEATMENT", + "INACTIVITY_FEE_DOWN", + "PROVISIONAL_CREDIT", + "DISPUTE_WON", + "SERVICE", + "TRANSFER", + ] + """Type of the book transfer""" + + class BookTransferTransactionTransactionSeries(BaseModel): related_transaction_event_token: Optional[str] = None @@ -112,7 +273,7 @@ class BookTransferTransaction(BaseModel): currency: str """Currency of the transaction in ISO 4217 format""" - events: List[object] + events: List[BookTransferTransactionEvent] """List of events associated with this book transfer""" family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"] @@ -162,6 +323,75 @@ class CardTransaction(Transaction): """ISO 8601 timestamp of when the transaction was last updated""" +class PaymentTransactionEvent(BaseModel): + token: str + """Globally unique identifier.""" + + amount: int + """ + Amount of the financial event that has been settled in the currency's smallest + unit (e.g., cents). + """ + + created: datetime + """Date and time when the financial event occurred. UTC time zone.""" + + result: Literal["APPROVED", "DECLINED"] + """ + APPROVED financial events were successful while DECLINED financial events were + declined by user, Lithic, or the network. + """ + + type: Literal[ + "ACH_ORIGINATION_CANCELLED", + "ACH_ORIGINATION_INITIATED", + "ACH_ORIGINATION_PROCESSED", + "ACH_ORIGINATION_SETTLED", + "ACH_ORIGINATION_RELEASED", + "ACH_ORIGINATION_REVIEWED", + "ACH_RECEIPT_PROCESSED", + "ACH_RECEIPT_SETTLED", + "ACH_RETURN_INITIATED", + "ACH_RETURN_PROCESSED", + "ACH_RETURN_SETTLED", + ] + """Event types: + + - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + approval/release from an ACH hold. + - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + the Federal Reserve. + - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + available balance. + - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + Financial Institution. + - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + balance. + - `ACH_RETURN_SETTLED` - ACH receipt return settled by the Receiving Depository + Financial Institution. + """ + + detailed_results: Optional[ + List[ + Literal[ + "APPROVED", + "FUNDS_INSUFFICIENT", + "ACCOUNT_INVALID", + "PROGRAM_TRANSACTION_LIMIT_EXCEEDED", + "PROGRAM_DAILY_LIMIT_EXCEEDED", + "PROGRAM_MONTHLY_LIMIT_EXCEEDED", + ] + ] + ] = None + """More detailed reasons for the event""" + + class PaymentTransactionMethodAttributesACHMethodAttributes(BaseModel): sec_code: Literal["CCD", "PPD", "WEB", "TEL", "CIE", "CTX"] """SEC code for ACH transaction""" @@ -198,6 +428,9 @@ class PaymentTransactionMethodAttributesWireMethodAttributes(BaseModel): external_individual_name: Optional[str] = None """External individual name""" + imad: Optional[str] = None + """IMAD""" + lithic_bank_name: Optional[str] = None """Lithic bank name""" @@ -207,9 +440,15 @@ class PaymentTransactionMethodAttributesWireMethodAttributes(BaseModel): lithic_individual_name: Optional[str] = None """Lithic individual name""" + omad: Optional[str] = None + """OMAD""" + previous_transfer: Optional[str] = None """UUID of previous transfer if this is a retry""" + wire_token: Optional[str] = None + """Wire token""" + PaymentTransactionMethodAttributes: TypeAlias = Union[ PaymentTransactionMethodAttributesACHMethodAttributes, PaymentTransactionMethodAttributesWireMethodAttributes @@ -254,7 +493,7 @@ class PaymentTransaction(BaseModel): direction: Literal["CREDIT", "DEBIT"] """Transfer direction""" - events: List[object] + events: List[PaymentTransactionEvent] """List of transaction events""" family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"] diff --git a/src/lithic/types/book_transfer_create_params.py b/src/lithic/types/book_transfer_create_params.py index 73cd8287..54b82744 100644 --- a/src/lithic/types/book_transfer_create_params.py +++ b/src/lithic/types/book_transfer_create_params.py @@ -9,7 +9,7 @@ class BookTransferCreateParams(TypedDict, total=False): amount: Required[int] - """Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + """Amount to be transferred in the currency's smallest unit (e.g., cents for USD). This should always be a positive value. """ @@ -71,7 +71,7 @@ class BookTransferCreateParams(TypedDict, total=False): "TRANSFER", ] ] - """Type of book_transfer""" + """Type of the book transfer""" token: str """Customer-provided token that will serve as an idempotency token. @@ -79,5 +79,11 @@ class BookTransferCreateParams(TypedDict, total=False): This token will become the transaction token. """ + external_id: str + """External ID defined by the customer""" + memo: str """Optional descriptor for the transfer.""" + + on_closed_account: Literal["FAIL", "USE_SUSPENSE"] + """What to do if the financial account is closed when posting an operation""" diff --git a/src/lithic/types/book_transfer_response.py b/src/lithic/types/book_transfer_response.py index 9c119275..b58bd978 100644 --- a/src/lithic/types/book_transfer_response.py +++ b/src/lithic/types/book_transfer_response.py @@ -23,8 +23,7 @@ class Event(BaseModel): created: datetime """Date and time when the financial event occurred. UTC time zone.""" - detailed_results: List[Literal["APPROVED", "FUNDS_INSUFFICIENT"]] - """Detailed Results""" + detailed_results: Literal["APPROVED", "FUNDS_INSUFFICIENT"] memo: str """Memo for the transfer.""" @@ -38,7 +37,41 @@ class Event(BaseModel): subtype: str """The program specific subtype code for the specified category/type.""" - type: str + type: Literal[ + "ATM_WITHDRAWAL", + "ATM_DECLINE", + "INTERNATIONAL_ATM_WITHDRAWAL", + "INACTIVITY", + "STATEMENT", + "MONTHLY", + "QUARTERLY", + "ANNUAL", + "CUSTOMER_SERVICE", + "ACCOUNT_MAINTENANCE", + "ACCOUNT_ACTIVATION", + "ACCOUNT_CLOSURE", + "CARD_REPLACEMENT", + "CARD_DELIVERY", + "CARD_CREATE", + "CURRENCY_CONVERSION", + "INTEREST", + "LATE_PAYMENT", + "BILL_PAYMENT", + "CASH_BACK", + "ACCOUNT_TO_ACCOUNT", + "CARD_TO_CARD", + "DISBURSE", + "BILLING_ERROR", + "LOSS_WRITE_OFF", + "EXPIRED_CARD", + "EARLY_DERECOGNITION", + "ESCHEATMENT", + "INACTIVITY_FEE_DOWN", + "PROVISIONAL_CREDIT", + "DISPUTE_WON", + "SERVICE", + "TRANSFER", + ] """Type of the book transfer""" @@ -72,6 +105,9 @@ class BookTransferResponse(BaseModel): events: List[Event] """A list of all financial events that have modified this transfer.""" + external_id: Optional[str] = None + """External ID defined by the customer""" + external_resource: Optional[ExternalResource] = None """External resource associated with the management operation""" @@ -84,15 +120,13 @@ class BookTransferResponse(BaseModel): pending_amount: int """ Pending amount of the transaction in the currency's smallest unit (e.g., cents), - including any acquirer fees. The value of this field will go to zero over time - once the financial transaction is settled. + including any acquirer fees. + + The value of this field will go to zero over time once the financial transaction + is settled. """ result: Literal["APPROVED", "DECLINED"] - """ - APPROVED transactions were successful while DECLINED transactions were declined - by user, Lithic, or the network. - """ settled_amount: int """ @@ -101,13 +135,14 @@ class BookTransferResponse(BaseModel): """ status: Literal["DECLINED", "REVERSED", "SETTLED"] - """Status types: \\** `DECLINED` - The transfer was declined. + """Status types: - - `REVERSED` - The transfer was reversed \\** `SETTLED` - The transfer is - completed. + - `DECLINED` - The transfer was declined. + - `REVERSED` - The transfer was reversed + - `SETTLED` - The transfer is completed. """ - to_financial_account_token: object + to_financial_account_token: str """ Globally unique identifier for the financial account or card that will receive the funds. Accepted type dependent on the program's use case. diff --git a/src/lithic/types/financial_account.py b/src/lithic/types/financial_account.py index db96c4dd..e554064b 100644 --- a/src/lithic/types/financial_account.py +++ b/src/lithic/types/financial_account.py @@ -57,6 +57,7 @@ class FinancialAccount(BaseModel): "SECURITY", "PROGRAM_RECEIVABLES", "COLLECTION", + "BANK_ACCOUNTS_PAYABLE", ] updated: datetime diff --git a/src/lithic/types/payment.py b/src/lithic/types/payment.py index e985d2cf..a529d742 100644 --- a/src/lithic/types/payment.py +++ b/src/lithic/types/payment.py @@ -174,3 +174,19 @@ class Payment(BaseModel): expected_release_date: Optional[date] = None """Date when the financial transaction expected to be released after settlement""" + + type: Optional[ + Literal[ + "ORIGINATION_CREDIT", + "ORIGINATION_DEBIT", + "RECEIPT_CREDIT", + "RECEIPT_DEBIT", + "CUSTOMER_TRANSFER", + "DRAWDOWN_PAYMENT", + "REVERSAL_PAYMENT", + "DRAWDOWN_REQUEST", + "REVERSAL_REQUEST", + "DRAWDOWN_REFUSAL", + ] + ] = None + """Payment type indicating the specific ACH message or Fedwire transfer type""" diff --git a/src/lithic/types/shared/instance_financial_account_type.py b/src/lithic/types/shared/instance_financial_account_type.py index 4e837f29..806369f8 100644 --- a/src/lithic/types/shared/instance_financial_account_type.py +++ b/src/lithic/types/shared/instance_financial_account_type.py @@ -14,4 +14,5 @@ "SECURITY", "PROGRAM_RECEIVABLES", "COLLECTION", + "BANK_ACCOUNTS_PAYABLE", ] diff --git a/tests/api_resources/test_account_activity.py b/tests/api_resources/test_account_activity.py index 3ab3d621..bc44c2c7 100644 --- a/tests/api_resources/test_account_activity.py +++ b/tests/api_resources/test_account_activity.py @@ -30,6 +30,7 @@ def test_method_list(self, client: Lithic) -> None: @parametrize def test_method_list_with_all_params(self, client: Lithic) -> None: account_activity = client.account_activity.list( + 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="ACH", @@ -115,6 +116,7 @@ async def test_method_list(self, async_client: AsyncLithic) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> None: account_activity = await async_client.account_activity.list( + 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="ACH", diff --git a/tests/api_resources/test_book_transfers.py b/tests/api_resources/test_book_transfers.py index 34879210..704442c6 100644 --- a/tests/api_resources/test_book_transfers.py +++ b/tests/api_resources/test_book_transfers.py @@ -43,7 +43,9 @@ def test_method_create_with_all_params(self, client: Lithic) -> None: to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", type="ATM_WITHDRAWAL", token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + external_id="external_id", memo="memo", + on_closed_account="FAIL", ) assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) @@ -235,7 +237,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) -> to_financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", type="ATM_WITHDRAWAL", token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + external_id="external_id", memo="memo", + on_closed_account="FAIL", ) assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) From d62338236eb3ff35362feafddb188cc221718841 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 21:08:26 +0000 Subject: [PATCH 2/2] release: 0.103.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/lithic/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f70d9978..508a7081 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.102.0" + ".": "0.103.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e0694b18..a788ece8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.103.0 (2025-08-18) + +Full Changelog: [v0.102.0...v0.103.0](https://github.com/lithic-com/lithic-python/compare/v0.102.0...v0.103.0) + +### Features + +* **api:** adds Event types for additional API resources ([41e5b11](https://github.com/lithic-com/lithic-python/commit/41e5b1123172252c4afccd3524dd4a6f129a17d6)) + ## 0.102.0 (2025-08-13) Full Changelog: [v0.101.0...v0.102.0](https://github.com/lithic-com/lithic-python/compare/v0.101.0...v0.102.0) diff --git a/pyproject.toml b/pyproject.toml index 646fa7ab..91304a3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.102.0" +version = "0.103.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 7b3ec7b5..e29234e5 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.102.0" # x-release-please-version +__version__ = "0.103.0" # x-release-please-version pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy