From a3461767eaf97aa5b10dd356513a401644599722 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 13 Nov 2025 10:06:08 +0000
Subject: [PATCH 1/3] feat(api): add disputes V2 endpoints feat(api): add
unpause external_bank_accounts API method feat(api): add return payment
method feat(api): extract some common schemas into models feat(api): add
Tokenization and ACH Rules fix(api): mark certain optional fields as nullable
fix(api): change allowed phone number length from 18 to 16
---
.stats.yml | 8 +-
api.md | 47 ++-
examples/upload_evidence.py | 4 +-
src/lithic/_client.py | 38 ++
src/lithic/resources/__init__.py | 14 +
src/lithic/resources/auth_rules/v2/v2.py | 68 +++-
src/lithic/resources/disputes.py | 50 ++-
src/lithic/resources/disputes_v2.py | 325 ++++++++++++++++++
.../external_bank_accounts.py | 83 +++++
src/lithic/resources/external_payments.py | 4 +-
src/lithic/resources/management_operations.py | 4 +-
src/lithic/resources/payments.py | 170 ++++++++-
src/lithic/types/__init__.py | 17 +-
.../types/account_activity_list_response.py | 120 +------
..._activity_retrieve_transaction_response.py | 125 +------
src/lithic/types/auth_rules/__init__.py | 13 +
.../types/auth_rules/auth_rule_condition.py | 24 +-
.../auth_rules/auth_rule_condition_param.py | 23 +-
.../conditional_3ds_action_parameters.py | 45 +--
...conditional_3ds_action_parameters_param.py | 42 +--
.../conditional_ach_action_parameters.py | 134 ++++++++
...conditional_ach_action_parameters_param.py | 137 ++++++++
...itional_authorization_action_parameters.py | 65 ++--
...l_authorization_action_parameters_param.py | 62 ++--
.../types/auth_rules/conditional_operation.py | 18 +
...ditional_tokenization_action_parameters.py | 121 +++++++
...al_tokenization_action_parameters_param.py | 120 +++++++
.../types/auth_rules/conditional_value.py | 8 +
.../auth_rules/conditional_value_param.py | 12 +
.../types/auth_rules/v2_create_params.py | 29 +-
.../types/auth_rules/v2_create_response.py | 13 +-
.../types/auth_rules/v2_draft_params.py | 4 +
.../types/auth_rules/v2_draft_response.py | 13 +-
src/lithic/types/auth_rules/v2_list_params.py | 4 +-
.../types/auth_rules/v2_list_response.py | 13 +-
.../types/auth_rules/v2_promote_response.py | 13 +-
.../types/auth_rules/v2_retrieve_response.py | 13 +-
.../types/auth_rules/v2_update_response.py | 13 +-
src/lithic/types/book_transfer_response.py | 2 +-
src/lithic/types/category_details.py | 13 +
.../{dispute_list_response.py => dispute.py} | 4 +-
src/lithic/types/dispute_create_response.py | 164 ---------
src/lithic/types/dispute_delete_response.py | 164 ---------
src/lithic/types/dispute_retrieve_response.py | 164 ---------
src/lithic/types/dispute_update_response.py | 164 ---------
src/lithic/types/dispute_v2.py | 172 +++++++++
src/lithic/types/disputes_v2_list_params.py | 47 +++
.../external_bank_account_address_param.py | 3 +-
.../external_bank_account_unpause_response.py | 105 ++++++
src/lithic/types/external_payment.py | 2 +-
.../types/external_payment_list_params.py | 2 +-
src/lithic/types/financial_account.py | 2 +-
.../types/financial_accounts/__init__.py | 1 +
.../financial_accounts/category_balances.py | 13 +
.../types/financial_accounts/loan_tape.py | 214 +-----------
.../types/financial_accounts/statement.py | 125 +------
src/lithic/types/financial_transaction.py | 103 +-----
.../types/management_operation_list_params.py | 2 +-
.../types/management_operation_transaction.py | 2 +-
src/lithic/types/payment.py | 7 +-
src/lithic/types/payment_return_params.py | 37 ++
src/lithic/types/payment_return_response.py | 18 +
src/lithic/types/shared/__init__.py | 2 +
src/lithic/types/shared/financial_event.py | 105 ++++++
src/lithic/types/shared/merchant.py | 40 +++
src/lithic/types/statement_totals.py | 45 +++
.../authentication_retrieve_response.py | 6 +-
src/lithic/types/transaction.py | 37 +-
tests/api_resources/auth_rules/test_v2.py | 180 +++++++++-
tests/api_resources/test_disputes.py | 78 ++---
tests/api_resources/test_disputes_v2.py | 180 ++++++++++
.../test_external_bank_accounts.py | 81 +++++
tests/api_resources/test_payments.py | 117 +++++++
73 files changed, 2770 insertions(+), 1647 deletions(-)
create mode 100644 src/lithic/resources/disputes_v2.py
create mode 100644 src/lithic/types/auth_rules/conditional_ach_action_parameters.py
create mode 100644 src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py
create mode 100644 src/lithic/types/auth_rules/conditional_operation.py
create mode 100644 src/lithic/types/auth_rules/conditional_tokenization_action_parameters.py
create mode 100644 src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py
create mode 100644 src/lithic/types/auth_rules/conditional_value.py
create mode 100644 src/lithic/types/auth_rules/conditional_value_param.py
create mode 100644 src/lithic/types/category_details.py
rename src/lithic/types/{dispute_list_response.py => dispute.py} (98%)
delete mode 100644 src/lithic/types/dispute_create_response.py
delete mode 100644 src/lithic/types/dispute_delete_response.py
delete mode 100644 src/lithic/types/dispute_retrieve_response.py
delete mode 100644 src/lithic/types/dispute_update_response.py
create mode 100644 src/lithic/types/dispute_v2.py
create mode 100644 src/lithic/types/disputes_v2_list_params.py
create mode 100644 src/lithic/types/external_bank_account_unpause_response.py
create mode 100644 src/lithic/types/financial_accounts/category_balances.py
create mode 100644 src/lithic/types/payment_return_params.py
create mode 100644 src/lithic/types/payment_return_response.py
create mode 100644 src/lithic/types/shared/financial_event.py
create mode 100644 src/lithic/types/shared/merchant.py
create mode 100644 src/lithic/types/statement_totals.py
create mode 100644 tests/api_resources/test_disputes_v2.py
diff --git a/.stats.yml b/.stats.yml
index a288cec4..f47fe045 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 167
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c3f6c23018d70fd1b259b21cfd377b5d905872f0d3c5ce2cdb8013f4b6daa338.yml
-openapi_spec_hash: b551344da9d29eb4c5374874ed84a9b0
-config_hash: 012f050e575d1bbfe8db56a9eeaa5fcd
+configured_endpoints: 171
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-e1901db484e520cc1f6aa88c8b00d0fcda30c8f9e5ea562a12b9edfc3fb3b6d6.yml
+openapi_spec_hash: 59c317749628f3ed4cc7911b68f6351f
+config_hash: aab05d0cf41f1f6b9f4d5677273c1600
diff --git a/api.md b/api.md
index 6b843a47..3916b5e8 100644
--- a/api.md
+++ b/api.md
@@ -7,7 +7,9 @@ from lithic.types import (
Carrier,
Currency,
Document,
+ FinancialEvent,
InstanceFinancialAccountType,
+ Merchant,
ShippingAddress,
)
```
@@ -82,9 +84,13 @@ from lithic.types.auth_rules import (
AuthRule,
AuthRuleCondition,
Conditional3DSActionParameters,
+ ConditionalACHActionParameters,
ConditionalAttribute,
ConditionalAuthorizationActionParameters,
ConditionalBlockParameters,
+ ConditionalOperation,
+ ConditionalTokenizationActionParameters,
+ ConditionalValue,
MerchantLockParameters,
RuleStats,
VelocityLimitParams,
@@ -269,30 +275,35 @@ Methods:
Types:
```python
-from lithic.types import (
- Dispute,
- DisputeEvidence,
- DisputeCreateResponse,
- DisputeRetrieveResponse,
- DisputeUpdateResponse,
- DisputeListResponse,
- DisputeDeleteResponse,
-)
+from lithic.types import Dispute, DisputeEvidence
```
Methods:
-- client.disputes.create(\*\*params) -> DisputeCreateResponse
-- client.disputes.retrieve(dispute_token) -> DisputeRetrieveResponse
-- client.disputes.update(dispute_token, \*\*params) -> DisputeUpdateResponse
-- client.disputes.list(\*\*params) -> SyncCursorPage[DisputeListResponse]
-- client.disputes.delete(dispute_token) -> DisputeDeleteResponse
+- client.disputes.create(\*\*params) -> Dispute
+- client.disputes.retrieve(dispute_token) -> Dispute
+- client.disputes.update(dispute_token, \*\*params) -> Dispute
+- client.disputes.list(\*\*params) -> SyncCursorPage[Dispute]
+- client.disputes.delete(dispute_token) -> Dispute
- client.disputes.delete_evidence(evidence_token, \*, dispute_token) -> DisputeEvidence
- client.disputes.initiate_evidence_upload(dispute_token, \*\*params) -> DisputeEvidence
- client.disputes.list_evidences(dispute_token, \*\*params) -> SyncCursorPage[DisputeEvidence]
- client.disputes.retrieve_evidence(evidence_token, \*, dispute_token) -> DisputeEvidence
- client.disputes.upload_evidence(\*args) -> None
+# DisputesV2
+
+Types:
+
+```python
+from lithic.types import DisputeV2
+```
+
+Methods:
+
+- client.disputes_v2.retrieve(dispute_token) -> DisputeV2
+- client.disputes_v2.list(\*\*params) -> SyncCursorPage[DisputeV2]
+
# Events
Types:
@@ -341,7 +352,7 @@ Methods:
Types:
```python
-from lithic.types import FinancialAccount, FinancialTransaction
+from lithic.types import CategoryDetails, FinancialAccount, FinancialTransaction, StatementTotals
```
Methods:
@@ -415,7 +426,7 @@ Methods:
Types:
```python
-from lithic.types.financial_accounts import LoanTape
+from lithic.types.financial_accounts import CategoryBalances, LoanTape
```
Methods:
@@ -517,6 +528,7 @@ from lithic.types import (
ExternalBankAccountListResponse,
ExternalBankAccountRetryMicroDepositsResponse,
ExternalBankAccountRetryPrenoteResponse,
+ ExternalBankAccountUnpauseResponse,
)
```
@@ -528,6 +540,7 @@ Methods:
- client.external_bank_accounts.list(\*\*params) -> SyncCursorPage[ExternalBankAccountListResponse]
- client.external_bank_accounts.retry_micro_deposits(external_bank_account_token, \*\*params) -> ExternalBankAccountRetryMicroDepositsResponse
- client.external_bank_accounts.retry_prenote(external_bank_account_token, \*\*params) -> ExternalBankAccountRetryPrenoteResponse
+- client.external_bank_accounts.unpause(external_bank_account_token) -> ExternalBankAccountUnpauseResponse
## MicroDeposits
@@ -550,6 +563,7 @@ from lithic.types import (
Payment,
PaymentCreateResponse,
PaymentRetryResponse,
+ PaymentReturnResponse,
PaymentSimulateActionResponse,
PaymentSimulateReceiptResponse,
PaymentSimulateReleaseResponse,
@@ -563,6 +577,7 @@ Methods:
- client.payments.retrieve(payment_token) -> Payment
- client.payments.list(\*\*params) -> SyncCursorPage[Payment]
- client.payments.retry(payment_token) -> PaymentRetryResponse
+- client.payments.return\_(payment_token, \*\*params) -> PaymentReturnResponse
- client.payments.simulate_action(payment_token, \*\*params) -> PaymentSimulateActionResponse
- client.payments.simulate_receipt(\*\*params) -> PaymentSimulateReceiptResponse
- client.payments.simulate_release(\*\*params) -> PaymentSimulateReleaseResponse
diff --git a/examples/upload_evidence.py b/examples/upload_evidence.py
index e6a23286..1268de2c 100755
--- a/examples/upload_evidence.py
+++ b/examples/upload_evidence.py
@@ -6,7 +6,7 @@
# 1. Install Rye and setup a Python virtual environment: ./scripts/bootstrap
# 2. Run the example: LITHIC_API_KEY= rye run python examples/upload_evidence.py
from lithic import Lithic, file_from_path
-from lithic.types import DisputeListResponse, DisputeCreateResponse
+from lithic.types import Dispute
client = Lithic(environment="sandbox")
@@ -17,7 +17,7 @@
assert transaction.token, "Transaction must have a token"
disputes_page = client.disputes.list()
-dispute: DisputeCreateResponse | DisputeListResponse | None = disputes_page.data[0] if disputes_page.data else None
+dispute: Dispute | None = disputes_page.data[0] if disputes_page.data else None
if not dispute:
dispute = client.disputes.create(
amount=42,
diff --git a/src/lithic/_client.py b/src/lithic/_client.py
index b93276e7..6582ea5c 100644
--- a/src/lithic/_client.py
+++ b/src/lithic/_client.py
@@ -49,6 +49,7 @@
three_ds,
webhooks,
auth_rules,
+ disputes_v2,
transactions,
card_programs,
tokenizations,
@@ -73,6 +74,7 @@
from .resources.disputes import Disputes, AsyncDisputes
from .resources.payments import Payments, AsyncPayments
from .resources.cards.cards import Cards, AsyncCards
+ from .resources.disputes_v2 import DisputesV2, AsyncDisputesV2
from .resources.fraud.fraud import Fraud, AsyncFraud
from .resources.card_programs import CardPrograms, AsyncCardPrograms
from .resources.events.events import Events, AsyncEvents
@@ -262,6 +264,12 @@ def disputes(self) -> Disputes:
return Disputes(self)
+ @cached_property
+ def disputes_v2(self) -> DisputesV2:
+ from .resources.disputes_v2 import DisputesV2
+
+ return DisputesV2(self)
+
@cached_property
def events(self) -> Events:
from .resources.events import Events
@@ -660,6 +668,12 @@ def disputes(self) -> AsyncDisputes:
return AsyncDisputes(self)
+ @cached_property
+ def disputes_v2(self) -> AsyncDisputesV2:
+ from .resources.disputes_v2 import AsyncDisputesV2
+
+ return AsyncDisputesV2(self)
+
@cached_property
def events(self) -> AsyncEvents:
from .resources.events import AsyncEvents
@@ -981,6 +995,12 @@ def disputes(self) -> disputes.DisputesWithRawResponse:
return DisputesWithRawResponse(self._client.disputes)
+ @cached_property
+ def disputes_v2(self) -> disputes_v2.DisputesV2WithRawResponse:
+ from .resources.disputes_v2 import DisputesV2WithRawResponse
+
+ return DisputesV2WithRawResponse(self._client.disputes_v2)
+
@cached_property
def events(self) -> events.EventsWithRawResponse:
from .resources.events import EventsWithRawResponse
@@ -1160,6 +1180,12 @@ def disputes(self) -> disputes.AsyncDisputesWithRawResponse:
return AsyncDisputesWithRawResponse(self._client.disputes)
+ @cached_property
+ def disputes_v2(self) -> disputes_v2.AsyncDisputesV2WithRawResponse:
+ from .resources.disputes_v2 import AsyncDisputesV2WithRawResponse
+
+ return AsyncDisputesV2WithRawResponse(self._client.disputes_v2)
+
@cached_property
def events(self) -> events.AsyncEventsWithRawResponse:
from .resources.events import AsyncEventsWithRawResponse
@@ -1339,6 +1365,12 @@ def disputes(self) -> disputes.DisputesWithStreamingResponse:
return DisputesWithStreamingResponse(self._client.disputes)
+ @cached_property
+ def disputes_v2(self) -> disputes_v2.DisputesV2WithStreamingResponse:
+ from .resources.disputes_v2 import DisputesV2WithStreamingResponse
+
+ return DisputesV2WithStreamingResponse(self._client.disputes_v2)
+
@cached_property
def events(self) -> events.EventsWithStreamingResponse:
from .resources.events import EventsWithStreamingResponse
@@ -1518,6 +1550,12 @@ def disputes(self) -> disputes.AsyncDisputesWithStreamingResponse:
return AsyncDisputesWithStreamingResponse(self._client.disputes)
+ @cached_property
+ def disputes_v2(self) -> disputes_v2.AsyncDisputesV2WithStreamingResponse:
+ from .resources.disputes_v2 import AsyncDisputesV2WithStreamingResponse
+
+ return AsyncDisputesV2WithStreamingResponse(self._client.disputes_v2)
+
@cached_property
def events(self) -> events.AsyncEventsWithStreamingResponse:
from .resources.events import AsyncEventsWithStreamingResponse
diff --git a/src/lithic/resources/__init__.py b/src/lithic/resources/__init__.py
index 1d7a2e76..9fdb3bac 100644
--- a/src/lithic/resources/__init__.py
+++ b/src/lithic/resources/__init__.py
@@ -81,6 +81,14 @@
AuthRulesWithStreamingResponse,
AsyncAuthRulesWithStreamingResponse,
)
+from .disputes_v2 import (
+ DisputesV2,
+ AsyncDisputesV2,
+ DisputesV2WithRawResponse,
+ AsyncDisputesV2WithRawResponse,
+ DisputesV2WithStreamingResponse,
+ AsyncDisputesV2WithStreamingResponse,
+)
from .transactions import (
Transactions,
AsyncTransactions,
@@ -287,6 +295,12 @@
"AsyncDisputesWithRawResponse",
"DisputesWithStreamingResponse",
"AsyncDisputesWithStreamingResponse",
+ "DisputesV2",
+ "AsyncDisputesV2",
+ "DisputesV2WithRawResponse",
+ "AsyncDisputesV2WithRawResponse",
+ "DisputesV2WithStreamingResponse",
+ "AsyncDisputesV2WithStreamingResponse",
"Events",
"AsyncEvents",
"EventsWithRawResponse",
diff --git a/src/lithic/resources/auth_rules/v2/v2.py b/src/lithic/resources/auth_rules/v2/v2.py
index 0b6f70ce..379d1f9f 100644
--- a/src/lithic/resources/auth_rules/v2/v2.py
+++ b/src/lithic/resources/auth_rules/v2/v2.py
@@ -76,7 +76,10 @@ def create(
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
account_tokens: SequenceNotStr[str] | Omit = omit,
business_account_tokens: SequenceNotStr[str] | Omit = omit,
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
name: Optional[str] | 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.
@@ -99,7 +102,8 @@ def create(
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
account_tokens: Account tokens to which the Auth Rule applies.
@@ -126,7 +130,10 @@ def create(
card_tokens: SequenceNotStr[str],
parameters: v2_create_params.CardLevelRuleParameters,
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
name: Optional[str] | 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.
@@ -151,7 +158,8 @@ def create(
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
event_stream: The event stream during which the rule will be evaluated.
@@ -174,7 +182,10 @@ def create(
parameters: v2_create_params.ProgramLevelRuleParameters,
program_level: bool,
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
name: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -200,7 +211,8 @@ def create(
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
event_stream: The event stream during which the rule will be evaluated.
@@ -230,7 +242,10 @@ def create(
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
account_tokens: SequenceNotStr[str] | Omit = omit,
business_account_tokens: SequenceNotStr[str] | Omit = omit,
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
name: Optional[str] | Omit = omit,
card_tokens: SequenceNotStr[str] | Omit = omit,
program_level: bool | Omit = omit,
@@ -479,7 +494,10 @@ def list(
business_account_token: str | Omit = omit,
card_token: str | Omit = omit,
ending_before: str | Omit = omit,
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
page_size: int | Omit = omit,
scope: Literal["PROGRAM", "ACCOUNT", "BUSINESS_ACCOUNT", "CARD", "ANY"] | Omit = omit,
starting_after: str | Omit = omit,
@@ -799,7 +817,10 @@ async def create(
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
account_tokens: SequenceNotStr[str] | Omit = omit,
business_account_tokens: SequenceNotStr[str] | Omit = omit,
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
name: Optional[str] | 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.
@@ -822,7 +843,8 @@ async def create(
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
account_tokens: Account tokens to which the Auth Rule applies.
@@ -849,7 +871,10 @@ async def create(
card_tokens: SequenceNotStr[str],
parameters: v2_create_params.CardLevelRuleParameters,
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
name: Optional[str] | 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.
@@ -874,7 +899,8 @@ async def create(
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
event_stream: The event stream during which the rule will be evaluated.
@@ -897,7 +923,10 @@ async def create(
parameters: v2_create_params.ProgramLevelRuleParameters,
program_level: bool,
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
name: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -923,7 +952,8 @@ async def create(
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
event_stream: The event stream during which the rule will be evaluated.
@@ -953,7 +983,10 @@ async def create(
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION"],
account_tokens: SequenceNotStr[str] | Omit = omit,
business_account_tokens: SequenceNotStr[str] | Omit = omit,
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
name: Optional[str] | Omit = omit,
card_tokens: SequenceNotStr[str] | Omit = omit,
program_level: bool | Omit = omit,
@@ -1202,7 +1235,10 @@ def list(
business_account_token: str | Omit = omit,
card_token: str | Omit = omit,
ending_before: str | Omit = omit,
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"] | Omit = omit,
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
+ | Omit = omit,
page_size: int | Omit = omit,
scope: Literal["PROGRAM", "ACCOUNT", "BUSINESS_ACCOUNT", "CARD", "ANY"] | Omit = omit,
starting_after: str | Omit = omit,
diff --git a/src/lithic/resources/disputes.py b/src/lithic/resources/disputes.py
index ec1daf82..a6a50705 100644
--- a/src/lithic/resources/disputes.py
+++ b/src/lithic/resources/disputes.py
@@ -23,12 +23,8 @@
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import AsyncPaginator, make_request_options
+from ..types.dispute import Dispute
from ..types.dispute_evidence import DisputeEvidence
-from ..types.dispute_list_response import DisputeListResponse
-from ..types.dispute_create_response import DisputeCreateResponse
-from ..types.dispute_delete_response import DisputeDeleteResponse
-from ..types.dispute_update_response import DisputeUpdateResponse
-from ..types.dispute_retrieve_response import DisputeRetrieveResponse
__all__ = ["Disputes", "AsyncDisputes"]
@@ -82,7 +78,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DisputeCreateResponse:
+ ) -> Dispute:
"""
Initiate a dispute.
@@ -120,7 +116,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DisputeCreateResponse,
+ cast_to=Dispute,
)
def retrieve(
@@ -133,7 +129,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DisputeRetrieveResponse:
+ ) -> Dispute:
"""
Get dispute.
@@ -153,7 +149,7 @@ def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DisputeRetrieveResponse,
+ cast_to=Dispute,
)
def update(
@@ -186,7 +182,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DisputeUpdateResponse:
+ ) -> Dispute:
"""Update dispute.
Can only be modified if status is `NEW`.
@@ -224,7 +220,7 @@ def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DisputeUpdateResponse,
+ cast_to=Dispute,
)
def list(
@@ -253,7 +249,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> SyncCursorPage[DisputeListResponse]:
+ ) -> SyncCursorPage[Dispute]:
"""List disputes.
Args:
@@ -287,7 +283,7 @@ def list(
"""
return self._get_api_list(
"/v1/disputes",
- page=SyncCursorPage[DisputeListResponse],
+ page=SyncCursorPage[Dispute],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -306,7 +302,7 @@ def list(
dispute_list_params.DisputeListParams,
),
),
- model=DisputeListResponse,
+ model=Dispute,
)
def delete(
@@ -319,7 +315,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DisputeDeleteResponse:
+ ) -> Dispute:
"""
Withdraw dispute.
@@ -339,7 +335,7 @@ def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DisputeDeleteResponse,
+ cast_to=Dispute,
)
def delete_evidence(
@@ -598,7 +594,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DisputeCreateResponse:
+ ) -> Dispute:
"""
Initiate a dispute.
@@ -636,7 +632,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DisputeCreateResponse,
+ cast_to=Dispute,
)
async def retrieve(
@@ -649,7 +645,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DisputeRetrieveResponse:
+ ) -> Dispute:
"""
Get dispute.
@@ -669,7 +665,7 @@ async def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DisputeRetrieveResponse,
+ cast_to=Dispute,
)
async def update(
@@ -702,7 +698,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DisputeUpdateResponse:
+ ) -> Dispute:
"""Update dispute.
Can only be modified if status is `NEW`.
@@ -740,7 +736,7 @@ async def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DisputeUpdateResponse,
+ cast_to=Dispute,
)
def list(
@@ -769,7 +765,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AsyncPaginator[DisputeListResponse, AsyncCursorPage[DisputeListResponse]]:
+ ) -> AsyncPaginator[Dispute, AsyncCursorPage[Dispute]]:
"""List disputes.
Args:
@@ -803,7 +799,7 @@ def list(
"""
return self._get_api_list(
"/v1/disputes",
- page=AsyncCursorPage[DisputeListResponse],
+ page=AsyncCursorPage[Dispute],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -822,7 +818,7 @@ def list(
dispute_list_params.DisputeListParams,
),
),
- model=DisputeListResponse,
+ model=Dispute,
)
async def delete(
@@ -835,7 +831,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DisputeDeleteResponse:
+ ) -> Dispute:
"""
Withdraw dispute.
@@ -855,7 +851,7 @@ async def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DisputeDeleteResponse,
+ cast_to=Dispute,
)
async def delete_evidence(
diff --git a/src/lithic/resources/disputes_v2.py b/src/lithic/resources/disputes_v2.py
new file mode 100644
index 00000000..f6433efa
--- /dev/null
+++ b/src/lithic/resources/disputes_v2.py
@@ -0,0 +1,325 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from datetime import datetime
+
+import httpx
+
+from .. import _legacy_response
+from ..types import disputes_v2_list_params
+from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from .._utils import maybe_transform
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
+from ..pagination import SyncCursorPage, AsyncCursorPage
+from .._base_client import AsyncPaginator, make_request_options
+from ..types.dispute_v2 import DisputeV2
+
+__all__ = ["DisputesV2", "AsyncDisputesV2"]
+
+
+class DisputesV2(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> DisputesV2WithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/lithic-com/lithic-python#accessing-raw-response-data-eg-headers
+ """
+ return DisputesV2WithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> DisputesV2WithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response
+ """
+ return DisputesV2WithStreamingResponse(self)
+
+ def retrieve(
+ self,
+ dispute_token: str,
+ *,
+ # 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,
+ ) -> DisputeV2:
+ """
+ Retrieves a specific dispute by its token.
+
+ Args:
+ 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
+ """
+ if not dispute_token:
+ raise ValueError(f"Expected a non-empty value for `dispute_token` but received {dispute_token!r}")
+ return self._get(
+ f"/v2/disputes/{dispute_token}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DisputeV2,
+ )
+
+ def list(
+ self,
+ *,
+ account_token: str | Omit = omit,
+ begin: Union[str, datetime] | Omit = omit,
+ card_token: str | Omit = omit,
+ disputed_transaction_token: str | Omit = omit,
+ end: Union[str, datetime] | Omit = omit,
+ ending_before: str | Omit = omit,
+ page_size: int | Omit = omit,
+ starting_after: str | 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,
+ ) -> SyncCursorPage[DisputeV2]:
+ """
+ Returns a paginated list of disputes.
+
+ Args:
+ account_token: Filter by account token.
+
+ begin: RFC 3339 timestamp for filtering by created date, inclusive.
+
+ card_token: Filter by card token.
+
+ disputed_transaction_token: Filter by the token of the transaction being disputed. Corresponds with
+ transaction_series.related_transaction_token in the Dispute.
+
+ end: RFC 3339 timestamp for filtering by created date, inclusive.
+
+ ending_before: A cursor representing an item's token before which a page of results should end.
+ Used to retrieve the previous page of results before this item.
+
+ page_size: Number of items to return.
+
+ starting_after: A cursor representing an item's token after which a page of results should
+ begin. Used to retrieve the next page of results after this item.
+
+ 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
+ """
+ return self._get_api_list(
+ "/v2/disputes",
+ page=SyncCursorPage[DisputeV2],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "account_token": account_token,
+ "begin": begin,
+ "card_token": card_token,
+ "disputed_transaction_token": disputed_transaction_token,
+ "end": end,
+ "ending_before": ending_before,
+ "page_size": page_size,
+ "starting_after": starting_after,
+ },
+ disputes_v2_list_params.DisputesV2ListParams,
+ ),
+ ),
+ model=DisputeV2,
+ )
+
+
+class AsyncDisputesV2(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncDisputesV2WithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/lithic-com/lithic-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncDisputesV2WithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncDisputesV2WithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response
+ """
+ return AsyncDisputesV2WithStreamingResponse(self)
+
+ async def retrieve(
+ self,
+ dispute_token: str,
+ *,
+ # 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,
+ ) -> DisputeV2:
+ """
+ Retrieves a specific dispute by its token.
+
+ Args:
+ 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
+ """
+ if not dispute_token:
+ raise ValueError(f"Expected a non-empty value for `dispute_token` but received {dispute_token!r}")
+ return await self._get(
+ f"/v2/disputes/{dispute_token}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DisputeV2,
+ )
+
+ def list(
+ self,
+ *,
+ account_token: str | Omit = omit,
+ begin: Union[str, datetime] | Omit = omit,
+ card_token: str | Omit = omit,
+ disputed_transaction_token: str | Omit = omit,
+ end: Union[str, datetime] | Omit = omit,
+ ending_before: str | Omit = omit,
+ page_size: int | Omit = omit,
+ starting_after: str | 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,
+ ) -> AsyncPaginator[DisputeV2, AsyncCursorPage[DisputeV2]]:
+ """
+ Returns a paginated list of disputes.
+
+ Args:
+ account_token: Filter by account token.
+
+ begin: RFC 3339 timestamp for filtering by created date, inclusive.
+
+ card_token: Filter by card token.
+
+ disputed_transaction_token: Filter by the token of the transaction being disputed. Corresponds with
+ transaction_series.related_transaction_token in the Dispute.
+
+ end: RFC 3339 timestamp for filtering by created date, inclusive.
+
+ ending_before: A cursor representing an item's token before which a page of results should end.
+ Used to retrieve the previous page of results before this item.
+
+ page_size: Number of items to return.
+
+ starting_after: A cursor representing an item's token after which a page of results should
+ begin. Used to retrieve the next page of results after this item.
+
+ 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
+ """
+ return self._get_api_list(
+ "/v2/disputes",
+ page=AsyncCursorPage[DisputeV2],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "account_token": account_token,
+ "begin": begin,
+ "card_token": card_token,
+ "disputed_transaction_token": disputed_transaction_token,
+ "end": end,
+ "ending_before": ending_before,
+ "page_size": page_size,
+ "starting_after": starting_after,
+ },
+ disputes_v2_list_params.DisputesV2ListParams,
+ ),
+ ),
+ model=DisputeV2,
+ )
+
+
+class DisputesV2WithRawResponse:
+ def __init__(self, disputes_v2: DisputesV2) -> None:
+ self._disputes_v2 = disputes_v2
+
+ self.retrieve = _legacy_response.to_raw_response_wrapper(
+ disputes_v2.retrieve,
+ )
+ self.list = _legacy_response.to_raw_response_wrapper(
+ disputes_v2.list,
+ )
+
+
+class AsyncDisputesV2WithRawResponse:
+ def __init__(self, disputes_v2: AsyncDisputesV2) -> None:
+ self._disputes_v2 = disputes_v2
+
+ self.retrieve = _legacy_response.async_to_raw_response_wrapper(
+ disputes_v2.retrieve,
+ )
+ self.list = _legacy_response.async_to_raw_response_wrapper(
+ disputes_v2.list,
+ )
+
+
+class DisputesV2WithStreamingResponse:
+ def __init__(self, disputes_v2: DisputesV2) -> None:
+ self._disputes_v2 = disputes_v2
+
+ self.retrieve = to_streamed_response_wrapper(
+ disputes_v2.retrieve,
+ )
+ self.list = to_streamed_response_wrapper(
+ disputes_v2.list,
+ )
+
+
+class AsyncDisputesV2WithStreamingResponse:
+ def __init__(self, disputes_v2: AsyncDisputesV2) -> None:
+ self._disputes_v2 = disputes_v2
+
+ self.retrieve = async_to_streamed_response_wrapper(
+ disputes_v2.retrieve,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ disputes_v2.list,
+ )
diff --git a/src/lithic/resources/external_bank_accounts/external_bank_accounts.py b/src/lithic/resources/external_bank_accounts/external_bank_accounts.py
index 904c4080..dbf5c333 100644
--- a/src/lithic/resources/external_bank_accounts/external_bank_accounts.py
+++ b/src/lithic/resources/external_bank_accounts/external_bank_accounts.py
@@ -39,6 +39,7 @@
from ...types.external_bank_account_list_response import ExternalBankAccountListResponse
from ...types.external_bank_account_create_response import ExternalBankAccountCreateResponse
from ...types.external_bank_account_update_response import ExternalBankAccountUpdateResponse
+from ...types.external_bank_account_unpause_response import ExternalBankAccountUnpauseResponse
from ...types.external_bank_account_retrieve_response import ExternalBankAccountRetrieveResponse
from ...types.external_bank_account_retry_prenote_response import ExternalBankAccountRetryPrenoteResponse
from ...types.external_bank_account_retry_micro_deposits_response import ExternalBankAccountRetryMicroDepositsResponse
@@ -632,6 +633,41 @@ def retry_prenote(
cast_to=ExternalBankAccountRetryPrenoteResponse,
)
+ def unpause(
+ self,
+ external_bank_account_token: str,
+ *,
+ # 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,
+ ) -> ExternalBankAccountUnpauseResponse:
+ """
+ Unpause an external bank account
+
+ Args:
+ 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
+ """
+ if not external_bank_account_token:
+ raise ValueError(
+ f"Expected a non-empty value for `external_bank_account_token` but received {external_bank_account_token!r}"
+ )
+ return self._post(
+ f"/v1/external_bank_accounts/{external_bank_account_token}/unpause",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExternalBankAccountUnpauseResponse,
+ )
+
class AsyncExternalBankAccounts(AsyncAPIResource):
@cached_property
@@ -1219,6 +1255,41 @@ async def retry_prenote(
cast_to=ExternalBankAccountRetryPrenoteResponse,
)
+ async def unpause(
+ self,
+ external_bank_account_token: str,
+ *,
+ # 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,
+ ) -> ExternalBankAccountUnpauseResponse:
+ """
+ Unpause an external bank account
+
+ Args:
+ 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
+ """
+ if not external_bank_account_token:
+ raise ValueError(
+ f"Expected a non-empty value for `external_bank_account_token` but received {external_bank_account_token!r}"
+ )
+ return await self._post(
+ f"/v1/external_bank_accounts/{external_bank_account_token}/unpause",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExternalBankAccountUnpauseResponse,
+ )
+
class ExternalBankAccountsWithRawResponse:
def __init__(self, external_bank_accounts: ExternalBankAccounts) -> None:
@@ -1242,6 +1313,9 @@ def __init__(self, external_bank_accounts: ExternalBankAccounts) -> None:
self.retry_prenote = _legacy_response.to_raw_response_wrapper(
external_bank_accounts.retry_prenote,
)
+ self.unpause = _legacy_response.to_raw_response_wrapper(
+ external_bank_accounts.unpause,
+ )
@cached_property
def micro_deposits(self) -> MicroDepositsWithRawResponse:
@@ -1270,6 +1344,9 @@ def __init__(self, external_bank_accounts: AsyncExternalBankAccounts) -> None:
self.retry_prenote = _legacy_response.async_to_raw_response_wrapper(
external_bank_accounts.retry_prenote,
)
+ self.unpause = _legacy_response.async_to_raw_response_wrapper(
+ external_bank_accounts.unpause,
+ )
@cached_property
def micro_deposits(self) -> AsyncMicroDepositsWithRawResponse:
@@ -1298,6 +1375,9 @@ def __init__(self, external_bank_accounts: ExternalBankAccounts) -> None:
self.retry_prenote = to_streamed_response_wrapper(
external_bank_accounts.retry_prenote,
)
+ self.unpause = to_streamed_response_wrapper(
+ external_bank_accounts.unpause,
+ )
@cached_property
def micro_deposits(self) -> MicroDepositsWithStreamingResponse:
@@ -1326,6 +1406,9 @@ def __init__(self, external_bank_accounts: AsyncExternalBankAccounts) -> None:
self.retry_prenote = async_to_streamed_response_wrapper(
external_bank_accounts.retry_prenote,
)
+ self.unpause = async_to_streamed_response_wrapper(
+ external_bank_accounts.unpause,
+ )
@cached_property
def micro_deposits(self) -> AsyncMicroDepositsWithStreamingResponse:
diff --git a/src/lithic/resources/external_payments.py b/src/lithic/resources/external_payments.py
index 8de28571..fee5b2c6 100644
--- a/src/lithic/resources/external_payments.py
+++ b/src/lithic/resources/external_payments.py
@@ -149,7 +149,7 @@ def list(
page_size: int | Omit = omit,
result: Literal["APPROVED", "DECLINED"] | Omit = omit,
starting_after: str | Omit = omit,
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"] | Omit = omit,
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"] | 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,
@@ -519,7 +519,7 @@ def list(
page_size: int | Omit = omit,
result: Literal["APPROVED", "DECLINED"] | Omit = omit,
starting_after: str | Omit = omit,
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"] | Omit = omit,
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"] | 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,
diff --git a/src/lithic/resources/management_operations.py b/src/lithic/resources/management_operations.py
index 3bb033e6..02989df6 100644
--- a/src/lithic/resources/management_operations.py
+++ b/src/lithic/resources/management_operations.py
@@ -184,7 +184,7 @@ def list(
financial_account_token: str | Omit = omit,
page_size: int | Omit = omit,
starting_after: str | Omit = omit,
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"] | Omit = omit,
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"] | 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,
@@ -455,7 +455,7 @@ def list(
financial_account_token: str | Omit = omit,
page_size: int | Omit = omit,
starting_after: str | Omit = omit,
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"] | Omit = omit,
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"] | 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,
diff --git a/src/lithic/resources/payments.py b/src/lithic/resources/payments.py
index 3bbc3ced..73e0fed0 100644
--- a/src/lithic/resources/payments.py
+++ b/src/lithic/resources/payments.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import Union
+from typing import Union, Optional
from datetime import date, datetime
from typing_extensions import Literal
@@ -12,6 +12,7 @@
from ..types import (
payment_list_params,
payment_create_params,
+ payment_return_params,
payment_simulate_action_params,
payment_simulate_return_params,
payment_simulate_receipt_params,
@@ -27,6 +28,7 @@
from ..types.payment import Payment
from ..types.payment_retry_response import PaymentRetryResponse
from ..types.payment_create_response import PaymentCreateResponse
+from ..types.payment_return_response import PaymentReturnResponse
from ..types.payment_simulate_action_response import PaymentSimulateActionResponse
from ..types.payment_simulate_return_response import PaymentSimulateReturnResponse
from ..types.payment_simulate_receipt_response import PaymentSimulateReceiptResponse
@@ -252,6 +254,83 @@ def retry(
cast_to=PaymentRetryResponse,
)
+ def return_(
+ self,
+ payment_token: str,
+ *,
+ financial_account_token: str,
+ return_reason_code: str,
+ addenda: Optional[str] | Omit = omit,
+ date_of_death: Union[str, date, None] | Omit = omit,
+ memo: Optional[str] | 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,
+ ) -> PaymentReturnResponse:
+ """Return an ACH payment with a specified return reason code.
+
+ Returns must be
+ initiated within the time window specified by NACHA rules for each return code
+ (typically 2 banking days for most codes, 60 calendar days for unauthorized
+ debits). For a complete list of return codes and their meanings, see the
+ [ACH Return Reasons documentation](https://docs.lithic.com/docs/ach-overview#ach-return-reasons).
+
+ Note:
+
+ - This endpoint does not modify the state of the financial account associated
+ with the payment. If you would like to change the account state, use the
+ [Update financial account status](https://docs.lithic.com/reference/updatefinancialaccountstatus)
+ endpoint.
+ - By default this endpoint is not enabled for your account. Please contact your
+ implementations manager to enable this feature.
+
+ Args:
+ financial_account_token: Globally unique identifier for the financial account
+
+ return_reason_code: ACH return reason code indicating the reason for returning the payment.
+ Supported codes include R01-R53 and R80-R85. For a complete list of return codes
+ and their meanings, see
+ [ACH Return Reasons](https://docs.lithic.com/docs/ach-overview#ach-return-reasons)
+
+ addenda: Optional additional information about the return. Limited to 44 characters
+
+ date_of_death: Date of death in YYYY-MM-DD format. Required when using return codes **R14**
+ (representative payee deceased) or **R15** (beneficiary or account holder
+ deceased)
+
+ memo: Optional memo for the return. Limited to 10 characters
+
+ 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
+ """
+ if not payment_token:
+ raise ValueError(f"Expected a non-empty value for `payment_token` but received {payment_token!r}")
+ return self._post(
+ f"/v1/payments/{payment_token}/return",
+ body=maybe_transform(
+ {
+ "financial_account_token": financial_account_token,
+ "return_reason_code": return_reason_code,
+ "addenda": addenda,
+ "date_of_death": date_of_death,
+ "memo": memo,
+ },
+ payment_return_params.PaymentReturnParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=PaymentReturnResponse,
+ )
+
def simulate_action(
self,
payment_token: str,
@@ -675,6 +754,83 @@ async def retry(
cast_to=PaymentRetryResponse,
)
+ async def return_(
+ self,
+ payment_token: str,
+ *,
+ financial_account_token: str,
+ return_reason_code: str,
+ addenda: Optional[str] | Omit = omit,
+ date_of_death: Union[str, date, None] | Omit = omit,
+ memo: Optional[str] | 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,
+ ) -> PaymentReturnResponse:
+ """Return an ACH payment with a specified return reason code.
+
+ Returns must be
+ initiated within the time window specified by NACHA rules for each return code
+ (typically 2 banking days for most codes, 60 calendar days for unauthorized
+ debits). For a complete list of return codes and their meanings, see the
+ [ACH Return Reasons documentation](https://docs.lithic.com/docs/ach-overview#ach-return-reasons).
+
+ Note:
+
+ - This endpoint does not modify the state of the financial account associated
+ with the payment. If you would like to change the account state, use the
+ [Update financial account status](https://docs.lithic.com/reference/updatefinancialaccountstatus)
+ endpoint.
+ - By default this endpoint is not enabled for your account. Please contact your
+ implementations manager to enable this feature.
+
+ Args:
+ financial_account_token: Globally unique identifier for the financial account
+
+ return_reason_code: ACH return reason code indicating the reason for returning the payment.
+ Supported codes include R01-R53 and R80-R85. For a complete list of return codes
+ and their meanings, see
+ [ACH Return Reasons](https://docs.lithic.com/docs/ach-overview#ach-return-reasons)
+
+ addenda: Optional additional information about the return. Limited to 44 characters
+
+ date_of_death: Date of death in YYYY-MM-DD format. Required when using return codes **R14**
+ (representative payee deceased) or **R15** (beneficiary or account holder
+ deceased)
+
+ memo: Optional memo for the return. Limited to 10 characters
+
+ 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
+ """
+ if not payment_token:
+ raise ValueError(f"Expected a non-empty value for `payment_token` but received {payment_token!r}")
+ return await self._post(
+ f"/v1/payments/{payment_token}/return",
+ body=await async_maybe_transform(
+ {
+ "financial_account_token": financial_account_token,
+ "return_reason_code": return_reason_code,
+ "addenda": addenda,
+ "date_of_death": date_of_death,
+ "memo": memo,
+ },
+ payment_return_params.PaymentReturnParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=PaymentReturnResponse,
+ )
+
async def simulate_action(
self,
payment_token: str,
@@ -897,6 +1053,9 @@ def __init__(self, payments: Payments) -> None:
self.retry = _legacy_response.to_raw_response_wrapper(
payments.retry,
)
+ self.return_ = _legacy_response.to_raw_response_wrapper(
+ payments.return_,
+ )
self.simulate_action = _legacy_response.to_raw_response_wrapper(
payments.simulate_action,
)
@@ -927,6 +1086,9 @@ def __init__(self, payments: AsyncPayments) -> None:
self.retry = _legacy_response.async_to_raw_response_wrapper(
payments.retry,
)
+ self.return_ = _legacy_response.async_to_raw_response_wrapper(
+ payments.return_,
+ )
self.simulate_action = _legacy_response.async_to_raw_response_wrapper(
payments.simulate_action,
)
@@ -957,6 +1119,9 @@ def __init__(self, payments: Payments) -> None:
self.retry = to_streamed_response_wrapper(
payments.retry,
)
+ self.return_ = to_streamed_response_wrapper(
+ payments.return_,
+ )
self.simulate_action = to_streamed_response_wrapper(
payments.simulate_action,
)
@@ -987,6 +1152,9 @@ def __init__(self, payments: AsyncPayments) -> None:
self.retry = async_to_streamed_response_wrapper(
payments.retry,
)
+ self.return_ = async_to_streamed_response_wrapper(
+ payments.return_,
+ )
self.simulate_action = async_to_streamed_response_wrapper(
payments.simulate_action,
)
diff --git a/src/lithic/types/__init__.py b/src/lithic/types/__init__.py
index 14d0cd07..3597c644 100644
--- a/src/lithic/types/__init__.py
+++ b/src/lithic/types/__init__.py
@@ -9,16 +9,20 @@
Carrier as Carrier,
Currency as Currency,
Document as Document,
+ Merchant as Merchant,
+ FinancialEvent as FinancialEvent,
ShippingAddress as ShippingAddress,
AccountFinancialAccountType as AccountFinancialAccountType,
InstanceFinancialAccountType as InstanceFinancialAccountType,
)
from .account import Account as Account
from .balance import Balance as Balance
+from .dispute import Dispute as Dispute
from .payment import Payment as Payment
from .kyb_param import KYBParam as KYBParam
from .kyc_param import KYCParam as KYCParam
from .api_status import APIStatus as APIStatus
+from .dispute_v2 import DisputeV2 as DisputeV2
from .owner_type import OwnerType as OwnerType
from .transaction import Transaction as Transaction
from .card_program import CardProgram as CardProgram
@@ -28,10 +32,12 @@
from .message_attempt import MessageAttempt as MessageAttempt
from .network_program import NetworkProgram as NetworkProgram
from .card_list_params import CardListParams as CardListParams
+from .category_details import CategoryDetails as CategoryDetails
from .digital_card_art import DigitalCardArt as DigitalCardArt
from .dispute_evidence import DisputeEvidence as DisputeEvidence
from .external_payment import ExternalPayment as ExternalPayment
from .kyc_exempt_param import KYCExemptParam as KYCExemptParam
+from .statement_totals import StatementTotals as StatementTotals
from .aggregate_balance import AggregateBalance as AggregateBalance
from .card_embed_params import CardEmbedParams as CardEmbedParams
from .card_renew_params import CardRenewParams as CardRenewParams
@@ -64,18 +70,17 @@
from .account_update_params import AccountUpdateParams as AccountUpdateParams
from .card_provision_params import CardProvisionParams as CardProvisionParams
from .dispute_create_params import DisputeCreateParams as DisputeCreateParams
-from .dispute_list_response import DisputeListResponse as DisputeListResponse
from .dispute_update_params import DisputeUpdateParams as DisputeUpdateParams
from .financial_transaction import FinancialTransaction as FinancialTransaction
from .payment_create_params import PaymentCreateParams as PaymentCreateParams
+from .payment_return_params import PaymentReturnParams as PaymentReturnParams
from .book_transfer_response import BookTransferResponse as BookTransferResponse
from .external_resource_type import ExternalResourceType as ExternalResourceType
from .payment_retry_response import PaymentRetryResponse as PaymentRetryResponse
from .card_provision_response import CardProvisionResponse as CardProvisionResponse
-from .dispute_create_response import DisputeCreateResponse as DisputeCreateResponse
-from .dispute_delete_response import DisputeDeleteResponse as DisputeDeleteResponse
-from .dispute_update_response import DisputeUpdateResponse as DisputeUpdateResponse
+from .disputes_v2_list_params import DisputesV2ListParams as DisputesV2ListParams
from .payment_create_response import PaymentCreateResponse as PaymentCreateResponse
+from .payment_return_response import PaymentReturnResponse as PaymentReturnResponse
from .transaction_list_params import TransactionListParams as TransactionListParams
from .card_program_list_params import CardProgramListParams as CardProgramListParams
from .tokenization_list_params import TokenizationListParams as TokenizationListParams
@@ -83,7 +88,6 @@
from .card_get_embed_url_params import CardGetEmbedURLParams as CardGetEmbedURLParams
from .card_search_by_pan_params import CardSearchByPanParams as CardSearchByPanParams
from .card_web_provision_params import CardWebProvisionParams as CardWebProvisionParams
-from .dispute_retrieve_response import DisputeRetrieveResponse as DisputeRetrieveResponse
from .funding_event_list_params import FundingEventListParams as FundingEventListParams
from .responder_endpoint_status import ResponderEndpointStatus as ResponderEndpointStatus
from .account_holder_list_params import AccountHolderListParams as AccountHolderListParams
@@ -155,6 +159,9 @@
from .account_holder_list_documents_response import (
AccountHolderListDocumentsResponse as AccountHolderListDocumentsResponse,
)
+from .external_bank_account_unpause_response import (
+ ExternalBankAccountUnpauseResponse as ExternalBankAccountUnpauseResponse,
+)
from .financial_account_update_status_params import (
FinancialAccountUpdateStatusParams as FinancialAccountUpdateStatusParams,
)
diff --git a/src/lithic/types/account_activity_list_response.py b/src/lithic/types/account_activity_list_response.py
index 2453fea7..3680ff4d 100644
--- a/src/lithic/types/account_activity_list_response.py
+++ b/src/lithic/types/account_activity_list_response.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import List, Union
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
@@ -10,105 +10,10 @@
from .transaction import Transaction
from .external_payment import ExternalPayment
from .book_transfer_response import BookTransferResponse
+from .shared.financial_event import FinancialEvent
from .management_operation_transaction import ManagementOperationTransaction
-__all__ = ["AccountActivityListResponse", "FinancialTransaction", "FinancialTransactionEvent", "CardTransaction"]
-
-
-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_REJECTED",
- "ACH_ORIGINATION_REVIEWED",
- "ACH_ORIGINATION_SETTLED",
- "ACH_RECEIPT_PROCESSED",
- "ACH_RECEIPT_RELEASED",
- "ACH_RECEIPT_SETTLED",
- "ACH_RETURN_INITIATED",
- "ACH_RETURN_PROCESSED",
- "ACH_RETURN_REJECTED",
- "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
+__all__ = ["AccountActivityListResponse", "FinancialTransaction", "CardTransaction"]
class FinancialTransaction(BaseModel):
@@ -146,7 +51,7 @@ class FinancialTransaction(BaseModel):
descriptor: str
"""Transaction descriptor"""
- events: List[FinancialTransactionEvent]
+ events: List[FinancialEvent]
"""List of transaction events"""
family: Literal["INTERNAL"]
@@ -164,7 +69,7 @@ class FinancialTransaction(BaseModel):
settled_amount: int
"""Settled amount in cents"""
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]
"""The status of the transaction"""
updated: datetime
@@ -172,7 +77,20 @@ class FinancialTransaction(BaseModel):
class CardTransaction(Transaction):
- pass
+ token: str # type: ignore
+ """Unique identifier for the transaction"""
+
+ created: datetime # type: ignore
+ """ISO 8601 timestamp of when the transaction was created"""
+
+ family: Literal["CARD"]
+ """CARD - Card Transaction"""
+
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"] # type: ignore
+ """The status of the transaction"""
+
+ updated: datetime # type: ignore
+ """ISO 8601 timestamp of when the transaction was last updated"""
AccountActivityListResponse: TypeAlias = Annotated[
diff --git a/src/lithic/types/account_activity_retrieve_transaction_response.py b/src/lithic/types/account_activity_retrieve_transaction_response.py
index cb516727..a6b4dd4e 100644
--- a/src/lithic/types/account_activity_retrieve_transaction_response.py
+++ b/src/lithic/types/account_activity_retrieve_transaction_response.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import List, Union
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
@@ -10,110 +10,10 @@
from .transaction import Transaction
from .external_payment import ExternalPayment
from .book_transfer_response import BookTransferResponse
+from .shared.financial_event import FinancialEvent
from .management_operation_transaction import ManagementOperationTransaction
-__all__ = [
- "AccountActivityRetrieveTransactionResponse",
- "FinancialTransaction",
- "FinancialTransactionEvent",
- "CardTransaction",
-]
-
-
-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_REJECTED",
- "ACH_ORIGINATION_REVIEWED",
- "ACH_ORIGINATION_SETTLED",
- "ACH_RECEIPT_PROCESSED",
- "ACH_RECEIPT_RELEASED",
- "ACH_RECEIPT_SETTLED",
- "ACH_RETURN_INITIATED",
- "ACH_RETURN_PROCESSED",
- "ACH_RETURN_REJECTED",
- "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
+__all__ = ["AccountActivityRetrieveTransactionResponse", "FinancialTransaction", "CardTransaction"]
class FinancialTransaction(BaseModel):
@@ -151,7 +51,7 @@ class FinancialTransaction(BaseModel):
descriptor: str
"""Transaction descriptor"""
- events: List[FinancialTransactionEvent]
+ events: List[FinancialEvent]
"""List of transaction events"""
family: Literal["INTERNAL"]
@@ -169,7 +69,7 @@ class FinancialTransaction(BaseModel):
settled_amount: int
"""Settled amount in cents"""
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]
"""The status of the transaction"""
updated: datetime
@@ -177,7 +77,20 @@ class FinancialTransaction(BaseModel):
class CardTransaction(Transaction):
- pass
+ token: str # type: ignore
+ """Unique identifier for the transaction"""
+
+ created: datetime # type: ignore
+ """ISO 8601 timestamp of when the transaction was created"""
+
+ family: Literal["CARD"]
+ """CARD - Card Transaction"""
+
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"] # type: ignore
+ """The status of the transaction"""
+
+ updated: datetime # type: ignore
+ """ISO 8601 timestamp of when the transaction was last updated"""
AccountActivityRetrieveTransactionResponse: TypeAlias = Annotated[
diff --git a/src/lithic/types/auth_rules/__init__.py b/src/lithic/types/auth_rules/__init__.py
index ad5a1d7e..b07e3377 100644
--- a/src/lithic/types/auth_rules/__init__.py
+++ b/src/lithic/types/auth_rules/__init__.py
@@ -8,6 +8,7 @@
from .v2_create_params import V2CreateParams as V2CreateParams
from .v2_list_response import V2ListResponse as V2ListResponse
from .v2_update_params import V2UpdateParams as V2UpdateParams
+from .conditional_value import ConditionalValue as ConditionalValue
from .v2_draft_response import V2DraftResponse as V2DraftResponse
from .v2_create_response import V2CreateResponse as V2CreateResponse
from .v2_update_response import V2UpdateResponse as V2UpdateResponse
@@ -15,8 +16,10 @@
from .v2_promote_response import V2PromoteResponse as V2PromoteResponse
from .v2_retrieve_response import V2RetrieveResponse as V2RetrieveResponse
from .conditional_attribute import ConditionalAttribute as ConditionalAttribute
+from .conditional_operation import ConditionalOperation as ConditionalOperation
from .velocity_limit_params import VelocityLimitParams as VelocityLimitParams
from .velocity_limit_period import VelocityLimitPeriod as VelocityLimitPeriod
+from .conditional_value_param import ConditionalValueParam as ConditionalValueParam
from .merchant_lock_parameters import MerchantLockParameters as MerchantLockParameters
from .auth_rule_condition_param import AuthRuleConditionParam as AuthRuleConditionParam
from .v2_retrieve_report_params import V2RetrieveReportParams as V2RetrieveReportParams
@@ -28,13 +31,23 @@
from .v2_retrieve_features_response import V2RetrieveFeaturesResponse as V2RetrieveFeaturesResponse
from .merchant_lock_parameters_param import MerchantLockParametersParam as MerchantLockParametersParam
from .conditional_3ds_action_parameters import Conditional3DSActionParameters as Conditional3DSActionParameters
+from .conditional_ach_action_parameters import ConditionalACHActionParameters as ConditionalACHActionParameters
from .conditional_block_parameters_param import ConditionalBlockParametersParam as ConditionalBlockParametersParam
from .conditional_3ds_action_parameters_param import (
Conditional3DSActionParametersParam as Conditional3DSActionParametersParam,
)
+from .conditional_ach_action_parameters_param import (
+ ConditionalACHActionParametersParam as ConditionalACHActionParametersParam,
+)
+from .conditional_tokenization_action_parameters import (
+ ConditionalTokenizationActionParameters as ConditionalTokenizationActionParameters,
+)
from .conditional_authorization_action_parameters import (
ConditionalAuthorizationActionParameters as ConditionalAuthorizationActionParameters,
)
+from .conditional_tokenization_action_parameters_param import (
+ ConditionalTokenizationActionParametersParam as ConditionalTokenizationActionParametersParam,
+)
from .conditional_authorization_action_parameters_param import (
ConditionalAuthorizationActionParametersParam as ConditionalAuthorizationActionParametersParam,
)
diff --git a/src/lithic/types/auth_rules/auth_rule_condition.py b/src/lithic/types/auth_rules/auth_rule_condition.py
index 70b47ce7..5755da4e 100644
--- a/src/lithic/types/auth_rules/auth_rule_condition.py
+++ b/src/lithic/types/auth_rules/auth_rule_condition.py
@@ -1,16 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
-from typing_extensions import Literal
-
from ..._models import BaseModel
+from .conditional_value import ConditionalValue
from .conditional_attribute import ConditionalAttribute
+from .conditional_operation import ConditionalOperation
__all__ = ["AuthRuleCondition"]
class AuthRuleCondition(BaseModel):
- attribute: Optional[ConditionalAttribute] = None
+ attribute: ConditionalAttribute
"""The attribute to target.
The following attributes may be targeted:
@@ -63,21 +62,8 @@ class AuthRuleCondition(BaseModel):
`MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
"""
- operation: Optional[
- Literal[
- "IS_ONE_OF",
- "IS_NOT_ONE_OF",
- "MATCHES",
- "DOES_NOT_MATCH",
- "IS_EQUAL_TO",
- "IS_NOT_EQUAL_TO",
- "IS_GREATER_THAN",
- "IS_GREATER_THAN_OR_EQUAL_TO",
- "IS_LESS_THAN",
- "IS_LESS_THAN_OR_EQUAL_TO",
- ]
- ] = None
+ operation: ConditionalOperation
"""The operation to apply to the attribute"""
- value: Union[str, int, List[str], None] = None
+ value: ConditionalValue
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
diff --git a/src/lithic/types/auth_rules/auth_rule_condition_param.py b/src/lithic/types/auth_rules/auth_rule_condition_param.py
index 448d4436..686fb311 100644
--- a/src/lithic/types/auth_rules/auth_rule_condition_param.py
+++ b/src/lithic/types/auth_rules/auth_rule_condition_param.py
@@ -2,17 +2,17 @@
from __future__ import annotations
-from typing import Union
-from typing_extensions import Literal, TypedDict
+from typing_extensions import Required, TypedDict
-from ..._types import SequenceNotStr
from .conditional_attribute import ConditionalAttribute
+from .conditional_operation import ConditionalOperation
+from .conditional_value_param import ConditionalValueParam
__all__ = ["AuthRuleConditionParam"]
class AuthRuleConditionParam(TypedDict, total=False):
- attribute: ConditionalAttribute
+ attribute: Required[ConditionalAttribute]
"""The attribute to target.
The following attributes may be targeted:
@@ -65,19 +65,8 @@ class AuthRuleConditionParam(TypedDict, total=False):
`MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
"""
- operation: Literal[
- "IS_ONE_OF",
- "IS_NOT_ONE_OF",
- "MATCHES",
- "DOES_NOT_MATCH",
- "IS_EQUAL_TO",
- "IS_NOT_EQUAL_TO",
- "IS_GREATER_THAN",
- "IS_GREATER_THAN_OR_EQUAL_TO",
- "IS_LESS_THAN",
- "IS_LESS_THAN_OR_EQUAL_TO",
- ]
+ operation: Required[ConditionalOperation]
"""The operation to apply to the attribute"""
- value: Union[str, int, SequenceNotStr[str]]
+ value: Required[ConditionalValueParam]
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
diff --git a/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py b/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py
index 7c434a8a..f152eb52 100644
--- a/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py
+++ b/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py
@@ -1,27 +1,27 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import List
from typing_extensions import Literal
from ..._models import BaseModel
+from .conditional_value import ConditionalValue
+from .conditional_operation import ConditionalOperation
__all__ = ["Conditional3DSActionParameters", "Condition"]
class Condition(BaseModel):
- attribute: Optional[
- Literal[
- "MCC",
- "COUNTRY",
- "CURRENCY",
- "MERCHANT_ID",
- "DESCRIPTOR",
- "TRANSACTION_AMOUNT",
- "RISK_SCORE",
- "MESSAGE_CATEGORY",
- "ADDRESS_MATCH",
- ]
- ] = None
+ attribute: Literal[
+ "MCC",
+ "COUNTRY",
+ "CURRENCY",
+ "MERCHANT_ID",
+ "DESCRIPTOR",
+ "TRANSACTION_AMOUNT",
+ "RISK_SCORE",
+ "MESSAGE_CATEGORY",
+ "ADDRESS_MATCH",
+ ]
"""The attribute to target.
The following attributes may be targeted:
@@ -48,23 +48,10 @@ class Condition(BaseModel):
`MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
"""
- operation: Optional[
- Literal[
- "IS_ONE_OF",
- "IS_NOT_ONE_OF",
- "MATCHES",
- "DOES_NOT_MATCH",
- "IS_EQUAL_TO",
- "IS_NOT_EQUAL_TO",
- "IS_GREATER_THAN",
- "IS_GREATER_THAN_OR_EQUAL_TO",
- "IS_LESS_THAN",
- "IS_LESS_THAN_OR_EQUAL_TO",
- ]
- ] = None
+ operation: ConditionalOperation
"""The operation to apply to the attribute"""
- value: Union[str, int, List[str], None] = None
+ value: ConditionalValue
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
diff --git a/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py
index 7f04dded..88a81e1b 100644
--- a/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py
+++ b/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py
@@ -2,25 +2,28 @@
from __future__ import annotations
-from typing import Union, Iterable
+from typing import Iterable
from typing_extensions import Literal, Required, TypedDict
-from ..._types import SequenceNotStr
+from .conditional_operation import ConditionalOperation
+from .conditional_value_param import ConditionalValueParam
__all__ = ["Conditional3DSActionParametersParam", "Condition"]
class Condition(TypedDict, total=False):
- attribute: Literal[
- "MCC",
- "COUNTRY",
- "CURRENCY",
- "MERCHANT_ID",
- "DESCRIPTOR",
- "TRANSACTION_AMOUNT",
- "RISK_SCORE",
- "MESSAGE_CATEGORY",
- "ADDRESS_MATCH",
+ attribute: Required[
+ Literal[
+ "MCC",
+ "COUNTRY",
+ "CURRENCY",
+ "MERCHANT_ID",
+ "DESCRIPTOR",
+ "TRANSACTION_AMOUNT",
+ "RISK_SCORE",
+ "MESSAGE_CATEGORY",
+ "ADDRESS_MATCH",
+ ]
]
"""The attribute to target.
@@ -48,21 +51,10 @@ class Condition(TypedDict, total=False):
`MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
"""
- operation: Literal[
- "IS_ONE_OF",
- "IS_NOT_ONE_OF",
- "MATCHES",
- "DOES_NOT_MATCH",
- "IS_EQUAL_TO",
- "IS_NOT_EQUAL_TO",
- "IS_GREATER_THAN",
- "IS_GREATER_THAN_OR_EQUAL_TO",
- "IS_LESS_THAN",
- "IS_LESS_THAN_OR_EQUAL_TO",
- ]
+ operation: Required[ConditionalOperation]
"""The operation to apply to the attribute"""
- value: Union[str, int, SequenceNotStr[str]]
+ value: Required[ConditionalValueParam]
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
diff --git a/src/lithic/types/auth_rules/conditional_ach_action_parameters.py b/src/lithic/types/auth_rules/conditional_ach_action_parameters.py
new file mode 100644
index 00000000..076a4dfc
--- /dev/null
+++ b/src/lithic/types/auth_rules/conditional_ach_action_parameters.py
@@ -0,0 +1,134 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union
+from typing_extensions import Literal, TypeAlias
+
+from ..._models import BaseModel
+from .conditional_value import ConditionalValue
+from .conditional_operation import ConditionalOperation
+
+__all__ = ["ConditionalACHActionParameters", "Action", "ActionApproveAction", "ActionReturnAction", "Condition"]
+
+
+class ActionApproveAction(BaseModel):
+ type: Literal["APPROVE"]
+ """Approve the ACH transaction"""
+
+
+class ActionReturnAction(BaseModel):
+ code: Literal[
+ "R01",
+ "R02",
+ "R03",
+ "R04",
+ "R05",
+ "R06",
+ "R07",
+ "R08",
+ "R09",
+ "R10",
+ "R11",
+ "R12",
+ "R13",
+ "R14",
+ "R15",
+ "R16",
+ "R17",
+ "R18",
+ "R19",
+ "R20",
+ "R21",
+ "R22",
+ "R23",
+ "R24",
+ "R25",
+ "R26",
+ "R27",
+ "R28",
+ "R29",
+ "R30",
+ "R31",
+ "R32",
+ "R33",
+ "R34",
+ "R35",
+ "R36",
+ "R37",
+ "R38",
+ "R39",
+ "R40",
+ "R41",
+ "R42",
+ "R43",
+ "R44",
+ "R45",
+ "R46",
+ "R47",
+ "R50",
+ "R51",
+ "R52",
+ "R53",
+ "R61",
+ "R62",
+ "R67",
+ "R68",
+ "R69",
+ "R70",
+ "R71",
+ "R72",
+ "R73",
+ "R74",
+ "R75",
+ "R76",
+ "R77",
+ "R80",
+ "R81",
+ "R82",
+ "R83",
+ "R84",
+ "R85",
+ ]
+ """NACHA return code to use when returning the transaction.
+
+ Note that the list of available return codes is subject to an allowlist
+ configured at the program level
+ """
+
+ type: Literal["RETURN"]
+ """Return the ACH transaction"""
+
+
+Action: TypeAlias = Union[ActionApproveAction, ActionReturnAction]
+
+
+class Condition(BaseModel):
+ attribute: Literal["COMPANY_NAME", "COMPANY_ID", "TIMESTAMP", "TRANSACTION_AMOUNT", "SEC_CODE", "MEMO"]
+ """The attribute to target.
+
+ The following attributes may be targeted:
+
+ - `COMPANY_NAME`: The name of the company initiating the ACH transaction.
+ - `COMPANY_ID`: The company ID (also known as Standard Entry Class (SEC) Company
+ ID) of the entity initiating the ACH transaction.
+ - `TIMESTAMP`: The timestamp of the ACH transaction in ISO 8601 format.
+ - `TRANSACTION_AMOUNT`: The amount of the ACH transaction in minor units
+ (cents).
+ - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction.
+ Valid values include PPD (Prearranged Payment and Deposit Entry), CCD
+ (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL
+ (Telephone-Initiated Entry), and others.
+ - `MEMO`: Optional memo or description field included with the ACH transaction.
+ """
+
+ operation: ConditionalOperation
+ """The operation to apply to the attribute"""
+
+ value: ConditionalValue
+ """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
+
+
+class ConditionalACHActionParameters(BaseModel):
+ action: Action
+ """The action to take if the conditions are met"""
+
+ conditions: List[Condition]
diff --git a/src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py
new file mode 100644
index 00000000..4e37d8b6
--- /dev/null
+++ b/src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py
@@ -0,0 +1,137 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
+
+from .conditional_operation import ConditionalOperation
+from .conditional_value_param import ConditionalValueParam
+
+__all__ = ["ConditionalACHActionParametersParam", "Action", "ActionApproveAction", "ActionReturnAction", "Condition"]
+
+
+class ActionApproveAction(TypedDict, total=False):
+ type: Required[Literal["APPROVE"]]
+ """Approve the ACH transaction"""
+
+
+class ActionReturnAction(TypedDict, total=False):
+ code: Required[
+ Literal[
+ "R01",
+ "R02",
+ "R03",
+ "R04",
+ "R05",
+ "R06",
+ "R07",
+ "R08",
+ "R09",
+ "R10",
+ "R11",
+ "R12",
+ "R13",
+ "R14",
+ "R15",
+ "R16",
+ "R17",
+ "R18",
+ "R19",
+ "R20",
+ "R21",
+ "R22",
+ "R23",
+ "R24",
+ "R25",
+ "R26",
+ "R27",
+ "R28",
+ "R29",
+ "R30",
+ "R31",
+ "R32",
+ "R33",
+ "R34",
+ "R35",
+ "R36",
+ "R37",
+ "R38",
+ "R39",
+ "R40",
+ "R41",
+ "R42",
+ "R43",
+ "R44",
+ "R45",
+ "R46",
+ "R47",
+ "R50",
+ "R51",
+ "R52",
+ "R53",
+ "R61",
+ "R62",
+ "R67",
+ "R68",
+ "R69",
+ "R70",
+ "R71",
+ "R72",
+ "R73",
+ "R74",
+ "R75",
+ "R76",
+ "R77",
+ "R80",
+ "R81",
+ "R82",
+ "R83",
+ "R84",
+ "R85",
+ ]
+ ]
+ """NACHA return code to use when returning the transaction.
+
+ Note that the list of available return codes is subject to an allowlist
+ configured at the program level
+ """
+
+ type: Required[Literal["RETURN"]]
+ """Return the ACH transaction"""
+
+
+Action: TypeAlias = Union[ActionApproveAction, ActionReturnAction]
+
+
+class Condition(TypedDict, total=False):
+ attribute: Required[Literal["COMPANY_NAME", "COMPANY_ID", "TIMESTAMP", "TRANSACTION_AMOUNT", "SEC_CODE", "MEMO"]]
+ """The attribute to target.
+
+ The following attributes may be targeted:
+
+ - `COMPANY_NAME`: The name of the company initiating the ACH transaction.
+ - `COMPANY_ID`: The company ID (also known as Standard Entry Class (SEC) Company
+ ID) of the entity initiating the ACH transaction.
+ - `TIMESTAMP`: The timestamp of the ACH transaction in ISO 8601 format.
+ - `TRANSACTION_AMOUNT`: The amount of the ACH transaction in minor units
+ (cents).
+ - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction.
+ Valid values include PPD (Prearranged Payment and Deposit Entry), CCD
+ (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL
+ (Telephone-Initiated Entry), and others.
+ - `MEMO`: Optional memo or description field included with the ACH transaction.
+ """
+
+ operation: Required[ConditionalOperation]
+ """The operation to apply to the attribute"""
+
+ value: Required[ConditionalValueParam]
+ """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
+
+
+class ConditionalACHActionParametersParam(TypedDict, total=False):
+ action: Required[Action]
+ """The action to take if the conditions are met"""
+
+ conditions: Required[Iterable[Condition]]
diff --git a/src/lithic/types/auth_rules/conditional_authorization_action_parameters.py b/src/lithic/types/auth_rules/conditional_authorization_action_parameters.py
index d999d578..a322a14a 100644
--- a/src/lithic/types/auth_rules/conditional_authorization_action_parameters.py
+++ b/src/lithic/types/auth_rules/conditional_authorization_action_parameters.py
@@ -1,37 +1,37 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import List
from typing_extensions import Literal
from ..._models import BaseModel
+from .conditional_value import ConditionalValue
+from .conditional_operation import ConditionalOperation
__all__ = ["ConditionalAuthorizationActionParameters", "Condition"]
class Condition(BaseModel):
- attribute: Optional[
- Literal[
- "MCC",
- "COUNTRY",
- "CURRENCY",
- "MERCHANT_ID",
- "DESCRIPTOR",
- "LIABILITY_SHIFT",
- "PAN_ENTRY_MODE",
- "TRANSACTION_AMOUNT",
- "CASH_AMOUNT",
- "RISK_SCORE",
- "CARD_TRANSACTION_COUNT_15M",
- "CARD_TRANSACTION_COUNT_1H",
- "CARD_TRANSACTION_COUNT_24H",
- "CARD_STATE",
- "PIN_ENTERED",
- "PIN_STATUS",
- "WALLET_TYPE",
- "TRANSACTION_INITIATOR",
- "ADDRESS_MATCH",
- ]
- ] = None
+ attribute: Literal[
+ "MCC",
+ "COUNTRY",
+ "CURRENCY",
+ "MERCHANT_ID",
+ "DESCRIPTOR",
+ "LIABILITY_SHIFT",
+ "PAN_ENTRY_MODE",
+ "TRANSACTION_AMOUNT",
+ "CASH_AMOUNT",
+ "RISK_SCORE",
+ "CARD_TRANSACTION_COUNT_15M",
+ "CARD_TRANSACTION_COUNT_1H",
+ "CARD_TRANSACTION_COUNT_24H",
+ "CARD_STATE",
+ "PIN_ENTERED",
+ "PIN_STATUS",
+ "WALLET_TYPE",
+ "TRANSACTION_INITIATOR",
+ "ADDRESS_MATCH",
+ ]
"""The attribute to target.
The following attributes may be targeted:
@@ -88,23 +88,10 @@ class Condition(BaseModel):
`MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
"""
- operation: Optional[
- Literal[
- "IS_ONE_OF",
- "IS_NOT_ONE_OF",
- "MATCHES",
- "DOES_NOT_MATCH",
- "IS_EQUAL_TO",
- "IS_NOT_EQUAL_TO",
- "IS_GREATER_THAN",
- "IS_GREATER_THAN_OR_EQUAL_TO",
- "IS_LESS_THAN",
- "IS_LESS_THAN_OR_EQUAL_TO",
- ]
- ] = None
+ operation: ConditionalOperation
"""The operation to apply to the attribute"""
- value: Union[str, int, List[str], None] = None
+ value: ConditionalValue
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
diff --git a/src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py
index 84e2ad30..fd922029 100644
--- a/src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py
+++ b/src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py
@@ -2,35 +2,38 @@
from __future__ import annotations
-from typing import Union, Iterable
+from typing import Iterable
from typing_extensions import Literal, Required, TypedDict
-from ..._types import SequenceNotStr
+from .conditional_operation import ConditionalOperation
+from .conditional_value_param import ConditionalValueParam
__all__ = ["ConditionalAuthorizationActionParametersParam", "Condition"]
class Condition(TypedDict, total=False):
- attribute: Literal[
- "MCC",
- "COUNTRY",
- "CURRENCY",
- "MERCHANT_ID",
- "DESCRIPTOR",
- "LIABILITY_SHIFT",
- "PAN_ENTRY_MODE",
- "TRANSACTION_AMOUNT",
- "CASH_AMOUNT",
- "RISK_SCORE",
- "CARD_TRANSACTION_COUNT_15M",
- "CARD_TRANSACTION_COUNT_1H",
- "CARD_TRANSACTION_COUNT_24H",
- "CARD_STATE",
- "PIN_ENTERED",
- "PIN_STATUS",
- "WALLET_TYPE",
- "TRANSACTION_INITIATOR",
- "ADDRESS_MATCH",
+ attribute: Required[
+ Literal[
+ "MCC",
+ "COUNTRY",
+ "CURRENCY",
+ "MERCHANT_ID",
+ "DESCRIPTOR",
+ "LIABILITY_SHIFT",
+ "PAN_ENTRY_MODE",
+ "TRANSACTION_AMOUNT",
+ "CASH_AMOUNT",
+ "RISK_SCORE",
+ "CARD_TRANSACTION_COUNT_15M",
+ "CARD_TRANSACTION_COUNT_1H",
+ "CARD_TRANSACTION_COUNT_24H",
+ "CARD_STATE",
+ "PIN_ENTERED",
+ "PIN_STATUS",
+ "WALLET_TYPE",
+ "TRANSACTION_INITIATOR",
+ "ADDRESS_MATCH",
+ ]
]
"""The attribute to target.
@@ -88,21 +91,10 @@ class Condition(TypedDict, total=False):
`MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
"""
- operation: Literal[
- "IS_ONE_OF",
- "IS_NOT_ONE_OF",
- "MATCHES",
- "DOES_NOT_MATCH",
- "IS_EQUAL_TO",
- "IS_NOT_EQUAL_TO",
- "IS_GREATER_THAN",
- "IS_GREATER_THAN_OR_EQUAL_TO",
- "IS_LESS_THAN",
- "IS_LESS_THAN_OR_EQUAL_TO",
- ]
+ operation: Required[ConditionalOperation]
"""The operation to apply to the attribute"""
- value: Union[str, int, SequenceNotStr[str]]
+ value: Required[ConditionalValueParam]
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
diff --git a/src/lithic/types/auth_rules/conditional_operation.py b/src/lithic/types/auth_rules/conditional_operation.py
new file mode 100644
index 00000000..e243ae14
--- /dev/null
+++ b/src/lithic/types/auth_rules/conditional_operation.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["ConditionalOperation"]
+
+ConditionalOperation: TypeAlias = Literal[
+ "IS_ONE_OF",
+ "IS_NOT_ONE_OF",
+ "MATCHES",
+ "DOES_NOT_MATCH",
+ "IS_EQUAL_TO",
+ "IS_NOT_EQUAL_TO",
+ "IS_GREATER_THAN",
+ "IS_GREATER_THAN_OR_EQUAL_TO",
+ "IS_LESS_THAN",
+ "IS_LESS_THAN_OR_EQUAL_TO",
+]
diff --git a/src/lithic/types/auth_rules/conditional_tokenization_action_parameters.py b/src/lithic/types/auth_rules/conditional_tokenization_action_parameters.py
new file mode 100644
index 00000000..479e382b
--- /dev/null
+++ b/src/lithic/types/auth_rules/conditional_tokenization_action_parameters.py
@@ -0,0 +1,121 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union, Optional
+from typing_extensions import Literal, TypeAlias
+
+from ..._models import BaseModel
+from .conditional_value import ConditionalValue
+from .conditional_operation import ConditionalOperation
+
+__all__ = [
+ "ConditionalTokenizationActionParameters",
+ "Action",
+ "ActionDeclineAction",
+ "ActionRequireTfaAction",
+ "Condition",
+]
+
+
+class ActionDeclineAction(BaseModel):
+ type: Literal["DECLINE"]
+ """Decline the tokenization request"""
+
+ reason: Optional[
+ Literal[
+ "ACCOUNT_SCORE_1",
+ "DEVICE_SCORE_1",
+ "ALL_WALLET_DECLINE_REASONS_PRESENT",
+ "WALLET_RECOMMENDED_DECISION_RED",
+ "CVC_MISMATCH",
+ "CARD_EXPIRY_MONTH_MISMATCH",
+ "CARD_EXPIRY_YEAR_MISMATCH",
+ "CARD_INVALID_STATE",
+ "CUSTOMER_RED_PATH",
+ "INVALID_CUSTOMER_RESPONSE",
+ "NETWORK_FAILURE",
+ "GENERIC_DECLINE",
+ "DIGITAL_CARD_ART_REQUIRED",
+ ]
+ ] = None
+ """Reason code for declining the tokenization request"""
+
+
+class ActionRequireTfaAction(BaseModel):
+ type: Literal["REQUIRE_TFA"]
+ """Require two-factor authentication for the tokenization request"""
+
+ reason: Optional[
+ Literal[
+ "WALLET_RECOMMENDED_TFA",
+ "SUSPICIOUS_ACTIVITY",
+ "DEVICE_RECENTLY_LOST",
+ "TOO_MANY_RECENT_ATTEMPTS",
+ "TOO_MANY_RECENT_TOKENS",
+ "TOO_MANY_DIFFERENT_CARDHOLDERS",
+ "OUTSIDE_HOME_TERRITORY",
+ "HAS_SUSPENDED_TOKENS",
+ "HIGH_RISK",
+ "ACCOUNT_SCORE_LOW",
+ "DEVICE_SCORE_LOW",
+ "CARD_STATE_TFA",
+ "HARDCODED_TFA",
+ "CUSTOMER_RULE_TFA",
+ "DEVICE_HOST_CARD_EMULATION",
+ ]
+ ] = None
+ """Reason code for requiring two-factor authentication"""
+
+
+Action: TypeAlias = Union[ActionDeclineAction, ActionRequireTfaAction]
+
+
+class Condition(BaseModel):
+ attribute: Literal[
+ "TIMESTAMP",
+ "TOKENIZATION_CHANNEL",
+ "TOKENIZATION_SOURCE",
+ "TOKEN_REQUESTOR_NAME",
+ "WALLET_ACCOUNT_SCORE",
+ "WALLET_DEVICE_SCORE",
+ "WALLET_RECOMMENDED_DECISION",
+ "TOKEN_REQUESTOR_ID",
+ "WALLET_TOKEN_STATUS",
+ ]
+ """The attribute to target.
+
+ The following attributes may be targeted:
+
+ - `TIMESTAMP`: The timestamp of the tokenization request in ISO 8601 format.
+ - `TOKENIZATION_CHANNEL`: The channel through which the tokenization request was
+ initiated (e.g., DIGITAL_WALLET, ECOMMERCE).
+ - `TOKENIZATION_SOURCE`: The source of the tokenization request.
+ - `TOKEN_REQUESTOR_NAME`: The name of the entity requesting the token. Valid
+ values are `ALT_ID`, `AMAZON_ONE`, `AMERICAN_EXPRESS_TOKEN_SERVICE`,
+ `ANDROID_PAY`, `APPLE_PAY`, `FACEBOOK`, `FITBIT_PAY`, `GARMIN_PAY`,
+ `GOOGLE_PAY`, `GOOGLE_VCN`, `ISSUER_HCE`, `MICROSOFT_PAY`, `NETFLIX`,
+ `SAMSUNG_PAY`, `UNKNOWN`, `VISA_CHECKOUT`.
+ - `WALLET_ACCOUNT_SCORE`: Risk score for the account in the digital wallet.
+ Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2
+ = medium risk).
+ - `WALLET_DEVICE_SCORE`: Risk score for the device in the digital wallet.
+ Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2
+ = medium risk).
+ - `WALLET_RECOMMENDED_DECISION`: The decision recommended by the digital wallet
+ provider. Valid values include APPROVE, DECLINE,
+ REQUIRE_ADDITIONAL_AUTHENTICATION.
+ - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token.
+ - `WALLET_TOKEN_STATUS`: The current status of the wallet token.
+ """
+
+ operation: ConditionalOperation
+ """The operation to apply to the attribute"""
+
+ value: ConditionalValue
+ """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
+
+
+class ConditionalTokenizationActionParameters(BaseModel):
+ action: Action
+ """The action to take if the conditions are met"""
+
+ conditions: List[Condition]
diff --git a/src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py
new file mode 100644
index 00000000..d0112164
--- /dev/null
+++ b/src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py
@@ -0,0 +1,120 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
+
+from .conditional_operation import ConditionalOperation
+from .conditional_value_param import ConditionalValueParam
+
+__all__ = [
+ "ConditionalTokenizationActionParametersParam",
+ "Action",
+ "ActionDeclineAction",
+ "ActionRequireTfaAction",
+ "Condition",
+]
+
+
+class ActionDeclineAction(TypedDict, total=False):
+ type: Required[Literal["DECLINE"]]
+ """Decline the tokenization request"""
+
+ reason: Literal[
+ "ACCOUNT_SCORE_1",
+ "DEVICE_SCORE_1",
+ "ALL_WALLET_DECLINE_REASONS_PRESENT",
+ "WALLET_RECOMMENDED_DECISION_RED",
+ "CVC_MISMATCH",
+ "CARD_EXPIRY_MONTH_MISMATCH",
+ "CARD_EXPIRY_YEAR_MISMATCH",
+ "CARD_INVALID_STATE",
+ "CUSTOMER_RED_PATH",
+ "INVALID_CUSTOMER_RESPONSE",
+ "NETWORK_FAILURE",
+ "GENERIC_DECLINE",
+ "DIGITAL_CARD_ART_REQUIRED",
+ ]
+ """Reason code for declining the tokenization request"""
+
+
+class ActionRequireTfaAction(TypedDict, total=False):
+ type: Required[Literal["REQUIRE_TFA"]]
+ """Require two-factor authentication for the tokenization request"""
+
+ reason: Literal[
+ "WALLET_RECOMMENDED_TFA",
+ "SUSPICIOUS_ACTIVITY",
+ "DEVICE_RECENTLY_LOST",
+ "TOO_MANY_RECENT_ATTEMPTS",
+ "TOO_MANY_RECENT_TOKENS",
+ "TOO_MANY_DIFFERENT_CARDHOLDERS",
+ "OUTSIDE_HOME_TERRITORY",
+ "HAS_SUSPENDED_TOKENS",
+ "HIGH_RISK",
+ "ACCOUNT_SCORE_LOW",
+ "DEVICE_SCORE_LOW",
+ "CARD_STATE_TFA",
+ "HARDCODED_TFA",
+ "CUSTOMER_RULE_TFA",
+ "DEVICE_HOST_CARD_EMULATION",
+ ]
+ """Reason code for requiring two-factor authentication"""
+
+
+Action: TypeAlias = Union[ActionDeclineAction, ActionRequireTfaAction]
+
+
+class Condition(TypedDict, total=False):
+ attribute: Required[
+ Literal[
+ "TIMESTAMP",
+ "TOKENIZATION_CHANNEL",
+ "TOKENIZATION_SOURCE",
+ "TOKEN_REQUESTOR_NAME",
+ "WALLET_ACCOUNT_SCORE",
+ "WALLET_DEVICE_SCORE",
+ "WALLET_RECOMMENDED_DECISION",
+ "TOKEN_REQUESTOR_ID",
+ "WALLET_TOKEN_STATUS",
+ ]
+ ]
+ """The attribute to target.
+
+ The following attributes may be targeted:
+
+ - `TIMESTAMP`: The timestamp of the tokenization request in ISO 8601 format.
+ - `TOKENIZATION_CHANNEL`: The channel through which the tokenization request was
+ initiated (e.g., DIGITAL_WALLET, ECOMMERCE).
+ - `TOKENIZATION_SOURCE`: The source of the tokenization request.
+ - `TOKEN_REQUESTOR_NAME`: The name of the entity requesting the token. Valid
+ values are `ALT_ID`, `AMAZON_ONE`, `AMERICAN_EXPRESS_TOKEN_SERVICE`,
+ `ANDROID_PAY`, `APPLE_PAY`, `FACEBOOK`, `FITBIT_PAY`, `GARMIN_PAY`,
+ `GOOGLE_PAY`, `GOOGLE_VCN`, `ISSUER_HCE`, `MICROSOFT_PAY`, `NETFLIX`,
+ `SAMSUNG_PAY`, `UNKNOWN`, `VISA_CHECKOUT`.
+ - `WALLET_ACCOUNT_SCORE`: Risk score for the account in the digital wallet.
+ Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2
+ = medium risk).
+ - `WALLET_DEVICE_SCORE`: Risk score for the device in the digital wallet.
+ Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2
+ = medium risk).
+ - `WALLET_RECOMMENDED_DECISION`: The decision recommended by the digital wallet
+ provider. Valid values include APPROVE, DECLINE,
+ REQUIRE_ADDITIONAL_AUTHENTICATION.
+ - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token.
+ - `WALLET_TOKEN_STATUS`: The current status of the wallet token.
+ """
+
+ operation: Required[ConditionalOperation]
+ """The operation to apply to the attribute"""
+
+ value: Required[ConditionalValueParam]
+ """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
+
+
+class ConditionalTokenizationActionParametersParam(TypedDict, total=False):
+ action: Required[Action]
+ """The action to take if the conditions are met"""
+
+ conditions: Required[Iterable[Condition]]
diff --git a/src/lithic/types/auth_rules/conditional_value.py b/src/lithic/types/auth_rules/conditional_value.py
new file mode 100644
index 00000000..34e53bac
--- /dev/null
+++ b/src/lithic/types/auth_rules/conditional_value.py
@@ -0,0 +1,8 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union
+from typing_extensions import TypeAlias
+
+__all__ = ["ConditionalValue"]
+
+ConditionalValue: TypeAlias = Union[str, int, List[str]]
diff --git a/src/lithic/types/auth_rules/conditional_value_param.py b/src/lithic/types/auth_rules/conditional_value_param.py
new file mode 100644
index 00000000..db8f3d79
--- /dev/null
+++ b/src/lithic/types/auth_rules/conditional_value_param.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from typing_extensions import TypeAlias
+
+from ..._types import SequenceNotStr
+
+__all__ = ["ConditionalValueParam"]
+
+ConditionalValueParam: TypeAlias = Union[str, int, SequenceNotStr[str]]
diff --git a/src/lithic/types/auth_rules/v2_create_params.py b/src/lithic/types/auth_rules/v2_create_params.py
index 954acfdc..d40a120b 100644
--- a/src/lithic/types/auth_rules/v2_create_params.py
+++ b/src/lithic/types/auth_rules/v2_create_params.py
@@ -10,6 +10,8 @@
from .merchant_lock_parameters_param import MerchantLockParametersParam
from .conditional_block_parameters_param import ConditionalBlockParametersParam
from .conditional_3ds_action_parameters_param import Conditional3DSActionParametersParam
+from .conditional_ach_action_parameters_param import ConditionalACHActionParametersParam
+from .conditional_tokenization_action_parameters_param import ConditionalTokenizationActionParametersParam
from .conditional_authorization_action_parameters_param import ConditionalAuthorizationActionParametersParam
__all__ = [
@@ -37,7 +39,8 @@ class AccountLevelRule(TypedDict, total=False):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
account_tokens: SequenceNotStr[str]
@@ -46,7 +49,9 @@ class AccountLevelRule(TypedDict, total=False):
business_account_tokens: SequenceNotStr[str]
"""Business Account tokens to which the Auth Rule applies."""
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
name: Optional[str]
@@ -59,6 +64,8 @@ class AccountLevelRule(TypedDict, total=False):
MerchantLockParametersParam,
Conditional3DSActionParametersParam,
ConditionalAuthorizationActionParametersParam,
+ ConditionalACHActionParametersParam,
+ ConditionalTokenizationActionParametersParam,
]
@@ -79,10 +86,13 @@ class CardLevelRule(TypedDict, total=False):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
name: Optional[str]
@@ -95,6 +105,8 @@ class CardLevelRule(TypedDict, total=False):
MerchantLockParametersParam,
Conditional3DSActionParametersParam,
ConditionalAuthorizationActionParametersParam,
+ ConditionalACHActionParametersParam,
+ ConditionalTokenizationActionParametersParam,
]
@@ -115,10 +127,13 @@ class ProgramLevelRule(TypedDict, total=False):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
excluded_card_tokens: SequenceNotStr[str]
@@ -134,6 +149,8 @@ class ProgramLevelRule(TypedDict, total=False):
MerchantLockParametersParam,
Conditional3DSActionParametersParam,
ConditionalAuthorizationActionParametersParam,
+ ConditionalACHActionParametersParam,
+ ConditionalTokenizationActionParametersParam,
]
V2CreateParams: TypeAlias = Union[AccountLevelRule, CardLevelRule, ProgramLevelRule]
diff --git a/src/lithic/types/auth_rules/v2_create_response.py b/src/lithic/types/auth_rules/v2_create_response.py
index 0cff3a75..1dc0c3c6 100644
--- a/src/lithic/types/auth_rules/v2_create_response.py
+++ b/src/lithic/types/auth_rules/v2_create_response.py
@@ -8,6 +8,8 @@
from .merchant_lock_parameters import MerchantLockParameters
from .conditional_block_parameters import ConditionalBlockParameters
from .conditional_3ds_action_parameters import Conditional3DSActionParameters
+from .conditional_ach_action_parameters import ConditionalACHActionParameters
+from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters
from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters
__all__ = ["V2CreateResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"]
@@ -18,6 +20,8 @@
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -38,6 +42,8 @@ class CurrentVersion(BaseModel):
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -69,7 +75,9 @@ class V2CreateResponse(BaseModel):
draft_version: Optional[DraftVersion] = None
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
lithic_managed: bool
@@ -97,7 +105,8 @@ class V2CreateResponse(BaseModel):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
excluded_card_tokens: Optional[List[str]] = None
diff --git a/src/lithic/types/auth_rules/v2_draft_params.py b/src/lithic/types/auth_rules/v2_draft_params.py
index aa38ff44..2352a6b7 100644
--- a/src/lithic/types/auth_rules/v2_draft_params.py
+++ b/src/lithic/types/auth_rules/v2_draft_params.py
@@ -9,6 +9,8 @@
from .merchant_lock_parameters_param import MerchantLockParametersParam
from .conditional_block_parameters_param import ConditionalBlockParametersParam
from .conditional_3ds_action_parameters_param import Conditional3DSActionParametersParam
+from .conditional_ach_action_parameters_param import ConditionalACHActionParametersParam
+from .conditional_tokenization_action_parameters_param import ConditionalTokenizationActionParametersParam
from .conditional_authorization_action_parameters_param import ConditionalAuthorizationActionParametersParam
__all__ = ["V2DraftParams", "Parameters"]
@@ -25,4 +27,6 @@ class V2DraftParams(TypedDict, total=False):
MerchantLockParametersParam,
Conditional3DSActionParametersParam,
ConditionalAuthorizationActionParametersParam,
+ ConditionalACHActionParametersParam,
+ ConditionalTokenizationActionParametersParam,
]
diff --git a/src/lithic/types/auth_rules/v2_draft_response.py b/src/lithic/types/auth_rules/v2_draft_response.py
index c55b53ec..f69603f2 100644
--- a/src/lithic/types/auth_rules/v2_draft_response.py
+++ b/src/lithic/types/auth_rules/v2_draft_response.py
@@ -8,6 +8,8 @@
from .merchant_lock_parameters import MerchantLockParameters
from .conditional_block_parameters import ConditionalBlockParameters
from .conditional_3ds_action_parameters import Conditional3DSActionParameters
+from .conditional_ach_action_parameters import ConditionalACHActionParameters
+from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters
from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters
__all__ = ["V2DraftResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"]
@@ -18,6 +20,8 @@
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -38,6 +42,8 @@ class CurrentVersion(BaseModel):
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -69,7 +75,9 @@ class V2DraftResponse(BaseModel):
draft_version: Optional[DraftVersion] = None
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
lithic_managed: bool
@@ -97,7 +105,8 @@ class V2DraftResponse(BaseModel):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
excluded_card_tokens: Optional[List[str]] = None
diff --git a/src/lithic/types/auth_rules/v2_list_params.py b/src/lithic/types/auth_rules/v2_list_params.py
index 93c52b10..600502af 100644
--- a/src/lithic/types/auth_rules/v2_list_params.py
+++ b/src/lithic/types/auth_rules/v2_list_params.py
@@ -23,7 +23,9 @@ class V2ListParams(TypedDict, total=False):
Used to retrieve the previous page of results before this item.
"""
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""Only return Auth rules that are executed during the provided event stream."""
page_size: int
diff --git a/src/lithic/types/auth_rules/v2_list_response.py b/src/lithic/types/auth_rules/v2_list_response.py
index 0363a3de..89f52e9b 100644
--- a/src/lithic/types/auth_rules/v2_list_response.py
+++ b/src/lithic/types/auth_rules/v2_list_response.py
@@ -8,6 +8,8 @@
from .merchant_lock_parameters import MerchantLockParameters
from .conditional_block_parameters import ConditionalBlockParameters
from .conditional_3ds_action_parameters import Conditional3DSActionParameters
+from .conditional_ach_action_parameters import ConditionalACHActionParameters
+from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters
from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters
__all__ = ["V2ListResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"]
@@ -18,6 +20,8 @@
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -38,6 +42,8 @@ class CurrentVersion(BaseModel):
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -69,7 +75,9 @@ class V2ListResponse(BaseModel):
draft_version: Optional[DraftVersion] = None
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
lithic_managed: bool
@@ -97,7 +105,8 @@ class V2ListResponse(BaseModel):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
excluded_card_tokens: Optional[List[str]] = None
diff --git a/src/lithic/types/auth_rules/v2_promote_response.py b/src/lithic/types/auth_rules/v2_promote_response.py
index 5a15b838..e5b64fdd 100644
--- a/src/lithic/types/auth_rules/v2_promote_response.py
+++ b/src/lithic/types/auth_rules/v2_promote_response.py
@@ -8,6 +8,8 @@
from .merchant_lock_parameters import MerchantLockParameters
from .conditional_block_parameters import ConditionalBlockParameters
from .conditional_3ds_action_parameters import Conditional3DSActionParameters
+from .conditional_ach_action_parameters import ConditionalACHActionParameters
+from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters
from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters
__all__ = ["V2PromoteResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"]
@@ -18,6 +20,8 @@
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -38,6 +42,8 @@ class CurrentVersion(BaseModel):
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -69,7 +75,9 @@ class V2PromoteResponse(BaseModel):
draft_version: Optional[DraftVersion] = None
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
lithic_managed: bool
@@ -97,7 +105,8 @@ class V2PromoteResponse(BaseModel):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
excluded_card_tokens: Optional[List[str]] = None
diff --git a/src/lithic/types/auth_rules/v2_retrieve_response.py b/src/lithic/types/auth_rules/v2_retrieve_response.py
index 5cdc6f64..918c013f 100644
--- a/src/lithic/types/auth_rules/v2_retrieve_response.py
+++ b/src/lithic/types/auth_rules/v2_retrieve_response.py
@@ -8,6 +8,8 @@
from .merchant_lock_parameters import MerchantLockParameters
from .conditional_block_parameters import ConditionalBlockParameters
from .conditional_3ds_action_parameters import Conditional3DSActionParameters
+from .conditional_ach_action_parameters import ConditionalACHActionParameters
+from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters
from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters
__all__ = ["V2RetrieveResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"]
@@ -18,6 +20,8 @@
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -38,6 +42,8 @@ class CurrentVersion(BaseModel):
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -69,7 +75,9 @@ class V2RetrieveResponse(BaseModel):
draft_version: Optional[DraftVersion] = None
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
lithic_managed: bool
@@ -97,7 +105,8 @@ class V2RetrieveResponse(BaseModel):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
excluded_card_tokens: Optional[List[str]] = None
diff --git a/src/lithic/types/auth_rules/v2_update_response.py b/src/lithic/types/auth_rules/v2_update_response.py
index afbb10ec..550597f1 100644
--- a/src/lithic/types/auth_rules/v2_update_response.py
+++ b/src/lithic/types/auth_rules/v2_update_response.py
@@ -8,6 +8,8 @@
from .merchant_lock_parameters import MerchantLockParameters
from .conditional_block_parameters import ConditionalBlockParameters
from .conditional_3ds_action_parameters import Conditional3DSActionParameters
+from .conditional_ach_action_parameters import ConditionalACHActionParameters
+from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters
from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters
__all__ = ["V2UpdateResponse", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"]
@@ -18,6 +20,8 @@
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -38,6 +42,8 @@ class CurrentVersion(BaseModel):
MerchantLockParameters,
Conditional3DSActionParameters,
ConditionalAuthorizationActionParameters,
+ ConditionalACHActionParameters,
+ ConditionalTokenizationActionParameters,
]
@@ -69,7 +75,9 @@ class V2UpdateResponse(BaseModel):
draft_version: Optional[DraftVersion] = None
- event_stream: Literal["AUTHORIZATION", "THREE_DS_AUTHENTICATION"]
+ event_stream: Literal[
+ "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT"
+ ]
"""The event stream during which the rule will be evaluated."""
lithic_managed: bool
@@ -97,7 +105,8 @@ class V2UpdateResponse(BaseModel):
- `CONDITIONAL_BLOCK`: AUTHORIZATION event stream.
- `VELOCITY_LIMIT`: AUTHORIZATION event stream.
- `MERCHANT_LOCK`: AUTHORIZATION event stream.
- - `CONDITIONAL_ACTION`: AUTHORIZATION or THREE_DS_AUTHENTICATION event stream.
+ - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
+ ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
"""
excluded_card_tokens: Optional[List[str]] = None
diff --git a/src/lithic/types/book_transfer_response.py b/src/lithic/types/book_transfer_response.py
index 266ffc61..17f29897 100644
--- a/src/lithic/types/book_transfer_response.py
+++ b/src/lithic/types/book_transfer_response.py
@@ -139,7 +139,7 @@ class BookTransferResponse(BaseModel):
(e.g., cents)
"""
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]
"""The status of the transaction"""
to_financial_account_token: str
diff --git a/src/lithic/types/category_details.py b/src/lithic/types/category_details.py
new file mode 100644
index 00000000..81d56c66
--- /dev/null
+++ b/src/lithic/types/category_details.py
@@ -0,0 +1,13 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .._models import BaseModel
+
+__all__ = ["CategoryDetails"]
+
+
+class CategoryDetails(BaseModel):
+ balance_transfers: str
+
+ cash_advances: str
+
+ purchases: str
diff --git a/src/lithic/types/dispute_list_response.py b/src/lithic/types/dispute.py
similarity index 98%
rename from src/lithic/types/dispute_list_response.py
rename to src/lithic/types/dispute.py
index 06f8ffc4..38a26a97 100644
--- a/src/lithic/types/dispute_list_response.py
+++ b/src/lithic/types/dispute.py
@@ -6,10 +6,10 @@
from .._models import BaseModel
-__all__ = ["DisputeListResponse"]
+__all__ = ["Dispute"]
-class DisputeListResponse(BaseModel):
+class Dispute(BaseModel):
token: str
"""Globally unique identifier."""
diff --git a/src/lithic/types/dispute_create_response.py b/src/lithic/types/dispute_create_response.py
deleted file mode 100644
index 0d1058cd..00000000
--- a/src/lithic/types/dispute_create_response.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["DisputeCreateResponse"]
-
-
-class DisputeCreateResponse(BaseModel):
- token: str
- """Globally unique identifier."""
-
- amount: int
- """Amount under dispute. May be different from the original transaction amount."""
-
- arbitration_date: Optional[datetime] = None
- """Date dispute entered arbitration."""
-
- created: datetime
- """Timestamp of when first Dispute was reported."""
-
- customer_filed_date: Optional[datetime] = None
- """Date that the dispute was filed by the customer making the dispute."""
-
- customer_note: Optional[str] = None
- """End customer description of the reason for the dispute."""
-
- network_claim_ids: Optional[List[str]] = None
- """Unique identifiers for the dispute from the network."""
-
- network_filed_date: Optional[datetime] = None
- """Date that the dispute was submitted to the network."""
-
- network_reason_code: Optional[str] = None
- """Network reason code used to file the dispute."""
-
- prearbitration_date: Optional[datetime] = None
- """Date dispute entered pre-arbitration."""
-
- primary_claim_id: Optional[str] = None
- """Unique identifier for the dispute from the network.
-
- If there are multiple, this will be the first claim id set by the network
- """
-
- reason: Literal[
- "ATM_CASH_MISDISPENSE",
- "CANCELLED",
- "DUPLICATED",
- "FRAUD_CARD_NOT_PRESENT",
- "FRAUD_CARD_PRESENT",
- "FRAUD_OTHER",
- "GOODS_SERVICES_NOT_AS_DESCRIBED",
- "GOODS_SERVICES_NOT_RECEIVED",
- "INCORRECT_AMOUNT",
- "MISSING_AUTH",
- "OTHER",
- "PROCESSING_ERROR",
- "RECURRING_TRANSACTION_NOT_CANCELLED",
- "REFUND_NOT_PROCESSED",
- ]
- """Dispute reason:
-
- - `ATM_CASH_MISDISPENSE`: ATM cash misdispense.
- - `CANCELLED`: Transaction was cancelled by the customer.
- - `DUPLICATED`: The transaction was a duplicate.
- - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present.
- - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present.
- - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable
- merchant activity.
- - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as
- described.
- - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received.
- - `INCORRECT_AMOUNT`: The transaction amount was incorrect.
- - `MISSING_AUTH`: The transaction was missing authorization.
- - `OTHER`: Other reason.
- - `PROCESSING_ERROR`: Processing error.
- - `REFUND_NOT_PROCESSED`: The refund was not processed.
- - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not
- cancelled.
- """
-
- representment_date: Optional[datetime] = None
- """Date the representment was received."""
-
- resolution_date: Optional[datetime] = None
- """Date that the dispute was resolved."""
-
- resolution_note: Optional[str] = None
- """Note by Dispute team on the case resolution."""
-
- resolution_reason: Optional[
- Literal[
- "CASE_LOST",
- "NETWORK_REJECTED",
- "NO_DISPUTE_RIGHTS_3DS",
- "NO_DISPUTE_RIGHTS_BELOW_THRESHOLD",
- "NO_DISPUTE_RIGHTS_CONTACTLESS",
- "NO_DISPUTE_RIGHTS_HYBRID",
- "NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS",
- "NO_DISPUTE_RIGHTS_OTHER",
- "PAST_FILING_DATE",
- "PREARBITRATION_REJECTED",
- "PROCESSOR_REJECTED_OTHER",
- "REFUNDED",
- "REFUNDED_AFTER_CHARGEBACK",
- "WITHDRAWN",
- "WON_ARBITRATION",
- "WON_FIRST_CHARGEBACK",
- "WON_PREARBITRATION",
- ]
- ] = None
- """Reason for the dispute resolution:
-
- - `CASE_LOST`: This case was lost at final arbitration.
- - `NETWORK_REJECTED`: Network rejected.
- - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS.
- - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold.
- - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless.
- - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid.
- - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks.
- - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other.
- - `PAST_FILING_DATE`: Past filing date.
- - `PREARBITRATION_REJECTED`: Prearbitration rejected.
- - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other.
- - `REFUNDED`: Refunded.
- - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback.
- - `WITHDRAWN`: Withdrawn.
- - `WON_ARBITRATION`: Won arbitration.
- - `WON_FIRST_CHARGEBACK`: Won first chargeback.
- - `WON_PREARBITRATION`: Won prearbitration.
- """
-
- status: Literal[
- "ARBITRATION",
- "CASE_CLOSED",
- "CASE_WON",
- "NEW",
- "PENDING_CUSTOMER",
- "PREARBITRATION",
- "REPRESENTMENT",
- "SUBMITTED",
- ]
- """Status types:
-
- - `NEW` - New dispute case is opened.
- - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more
- information.
- - `SUBMITTED` - Dispute is submitted to the card network.
- - `REPRESENTMENT` - Case has entered second presentment.
- - `PREARBITRATION` - Case has entered prearbitration.
- - `ARBITRATION` - Case has entered arbitration.
- - `CASE_WON` - Case was won and credit will be issued.
- - `CASE_CLOSED` - Case was lost or withdrawn.
- """
-
- transaction_token: str
- """The transaction that is being disputed.
-
- A transaction can only be disputed once but may have multiple dispute cases.
- """
diff --git a/src/lithic/types/dispute_delete_response.py b/src/lithic/types/dispute_delete_response.py
deleted file mode 100644
index c82f9664..00000000
--- a/src/lithic/types/dispute_delete_response.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["DisputeDeleteResponse"]
-
-
-class DisputeDeleteResponse(BaseModel):
- token: str
- """Globally unique identifier."""
-
- amount: int
- """Amount under dispute. May be different from the original transaction amount."""
-
- arbitration_date: Optional[datetime] = None
- """Date dispute entered arbitration."""
-
- created: datetime
- """Timestamp of when first Dispute was reported."""
-
- customer_filed_date: Optional[datetime] = None
- """Date that the dispute was filed by the customer making the dispute."""
-
- customer_note: Optional[str] = None
- """End customer description of the reason for the dispute."""
-
- network_claim_ids: Optional[List[str]] = None
- """Unique identifiers for the dispute from the network."""
-
- network_filed_date: Optional[datetime] = None
- """Date that the dispute was submitted to the network."""
-
- network_reason_code: Optional[str] = None
- """Network reason code used to file the dispute."""
-
- prearbitration_date: Optional[datetime] = None
- """Date dispute entered pre-arbitration."""
-
- primary_claim_id: Optional[str] = None
- """Unique identifier for the dispute from the network.
-
- If there are multiple, this will be the first claim id set by the network
- """
-
- reason: Literal[
- "ATM_CASH_MISDISPENSE",
- "CANCELLED",
- "DUPLICATED",
- "FRAUD_CARD_NOT_PRESENT",
- "FRAUD_CARD_PRESENT",
- "FRAUD_OTHER",
- "GOODS_SERVICES_NOT_AS_DESCRIBED",
- "GOODS_SERVICES_NOT_RECEIVED",
- "INCORRECT_AMOUNT",
- "MISSING_AUTH",
- "OTHER",
- "PROCESSING_ERROR",
- "RECURRING_TRANSACTION_NOT_CANCELLED",
- "REFUND_NOT_PROCESSED",
- ]
- """Dispute reason:
-
- - `ATM_CASH_MISDISPENSE`: ATM cash misdispense.
- - `CANCELLED`: Transaction was cancelled by the customer.
- - `DUPLICATED`: The transaction was a duplicate.
- - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present.
- - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present.
- - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable
- merchant activity.
- - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as
- described.
- - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received.
- - `INCORRECT_AMOUNT`: The transaction amount was incorrect.
- - `MISSING_AUTH`: The transaction was missing authorization.
- - `OTHER`: Other reason.
- - `PROCESSING_ERROR`: Processing error.
- - `REFUND_NOT_PROCESSED`: The refund was not processed.
- - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not
- cancelled.
- """
-
- representment_date: Optional[datetime] = None
- """Date the representment was received."""
-
- resolution_date: Optional[datetime] = None
- """Date that the dispute was resolved."""
-
- resolution_note: Optional[str] = None
- """Note by Dispute team on the case resolution."""
-
- resolution_reason: Optional[
- Literal[
- "CASE_LOST",
- "NETWORK_REJECTED",
- "NO_DISPUTE_RIGHTS_3DS",
- "NO_DISPUTE_RIGHTS_BELOW_THRESHOLD",
- "NO_DISPUTE_RIGHTS_CONTACTLESS",
- "NO_DISPUTE_RIGHTS_HYBRID",
- "NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS",
- "NO_DISPUTE_RIGHTS_OTHER",
- "PAST_FILING_DATE",
- "PREARBITRATION_REJECTED",
- "PROCESSOR_REJECTED_OTHER",
- "REFUNDED",
- "REFUNDED_AFTER_CHARGEBACK",
- "WITHDRAWN",
- "WON_ARBITRATION",
- "WON_FIRST_CHARGEBACK",
- "WON_PREARBITRATION",
- ]
- ] = None
- """Reason for the dispute resolution:
-
- - `CASE_LOST`: This case was lost at final arbitration.
- - `NETWORK_REJECTED`: Network rejected.
- - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS.
- - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold.
- - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless.
- - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid.
- - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks.
- - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other.
- - `PAST_FILING_DATE`: Past filing date.
- - `PREARBITRATION_REJECTED`: Prearbitration rejected.
- - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other.
- - `REFUNDED`: Refunded.
- - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback.
- - `WITHDRAWN`: Withdrawn.
- - `WON_ARBITRATION`: Won arbitration.
- - `WON_FIRST_CHARGEBACK`: Won first chargeback.
- - `WON_PREARBITRATION`: Won prearbitration.
- """
-
- status: Literal[
- "ARBITRATION",
- "CASE_CLOSED",
- "CASE_WON",
- "NEW",
- "PENDING_CUSTOMER",
- "PREARBITRATION",
- "REPRESENTMENT",
- "SUBMITTED",
- ]
- """Status types:
-
- - `NEW` - New dispute case is opened.
- - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more
- information.
- - `SUBMITTED` - Dispute is submitted to the card network.
- - `REPRESENTMENT` - Case has entered second presentment.
- - `PREARBITRATION` - Case has entered prearbitration.
- - `ARBITRATION` - Case has entered arbitration.
- - `CASE_WON` - Case was won and credit will be issued.
- - `CASE_CLOSED` - Case was lost or withdrawn.
- """
-
- transaction_token: str
- """The transaction that is being disputed.
-
- A transaction can only be disputed once but may have multiple dispute cases.
- """
diff --git a/src/lithic/types/dispute_retrieve_response.py b/src/lithic/types/dispute_retrieve_response.py
deleted file mode 100644
index 9a72caee..00000000
--- a/src/lithic/types/dispute_retrieve_response.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["DisputeRetrieveResponse"]
-
-
-class DisputeRetrieveResponse(BaseModel):
- token: str
- """Globally unique identifier."""
-
- amount: int
- """Amount under dispute. May be different from the original transaction amount."""
-
- arbitration_date: Optional[datetime] = None
- """Date dispute entered arbitration."""
-
- created: datetime
- """Timestamp of when first Dispute was reported."""
-
- customer_filed_date: Optional[datetime] = None
- """Date that the dispute was filed by the customer making the dispute."""
-
- customer_note: Optional[str] = None
- """End customer description of the reason for the dispute."""
-
- network_claim_ids: Optional[List[str]] = None
- """Unique identifiers for the dispute from the network."""
-
- network_filed_date: Optional[datetime] = None
- """Date that the dispute was submitted to the network."""
-
- network_reason_code: Optional[str] = None
- """Network reason code used to file the dispute."""
-
- prearbitration_date: Optional[datetime] = None
- """Date dispute entered pre-arbitration."""
-
- primary_claim_id: Optional[str] = None
- """Unique identifier for the dispute from the network.
-
- If there are multiple, this will be the first claim id set by the network
- """
-
- reason: Literal[
- "ATM_CASH_MISDISPENSE",
- "CANCELLED",
- "DUPLICATED",
- "FRAUD_CARD_NOT_PRESENT",
- "FRAUD_CARD_PRESENT",
- "FRAUD_OTHER",
- "GOODS_SERVICES_NOT_AS_DESCRIBED",
- "GOODS_SERVICES_NOT_RECEIVED",
- "INCORRECT_AMOUNT",
- "MISSING_AUTH",
- "OTHER",
- "PROCESSING_ERROR",
- "RECURRING_TRANSACTION_NOT_CANCELLED",
- "REFUND_NOT_PROCESSED",
- ]
- """Dispute reason:
-
- - `ATM_CASH_MISDISPENSE`: ATM cash misdispense.
- - `CANCELLED`: Transaction was cancelled by the customer.
- - `DUPLICATED`: The transaction was a duplicate.
- - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present.
- - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present.
- - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable
- merchant activity.
- - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as
- described.
- - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received.
- - `INCORRECT_AMOUNT`: The transaction amount was incorrect.
- - `MISSING_AUTH`: The transaction was missing authorization.
- - `OTHER`: Other reason.
- - `PROCESSING_ERROR`: Processing error.
- - `REFUND_NOT_PROCESSED`: The refund was not processed.
- - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not
- cancelled.
- """
-
- representment_date: Optional[datetime] = None
- """Date the representment was received."""
-
- resolution_date: Optional[datetime] = None
- """Date that the dispute was resolved."""
-
- resolution_note: Optional[str] = None
- """Note by Dispute team on the case resolution."""
-
- resolution_reason: Optional[
- Literal[
- "CASE_LOST",
- "NETWORK_REJECTED",
- "NO_DISPUTE_RIGHTS_3DS",
- "NO_DISPUTE_RIGHTS_BELOW_THRESHOLD",
- "NO_DISPUTE_RIGHTS_CONTACTLESS",
- "NO_DISPUTE_RIGHTS_HYBRID",
- "NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS",
- "NO_DISPUTE_RIGHTS_OTHER",
- "PAST_FILING_DATE",
- "PREARBITRATION_REJECTED",
- "PROCESSOR_REJECTED_OTHER",
- "REFUNDED",
- "REFUNDED_AFTER_CHARGEBACK",
- "WITHDRAWN",
- "WON_ARBITRATION",
- "WON_FIRST_CHARGEBACK",
- "WON_PREARBITRATION",
- ]
- ] = None
- """Reason for the dispute resolution:
-
- - `CASE_LOST`: This case was lost at final arbitration.
- - `NETWORK_REJECTED`: Network rejected.
- - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS.
- - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold.
- - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless.
- - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid.
- - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks.
- - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other.
- - `PAST_FILING_DATE`: Past filing date.
- - `PREARBITRATION_REJECTED`: Prearbitration rejected.
- - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other.
- - `REFUNDED`: Refunded.
- - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback.
- - `WITHDRAWN`: Withdrawn.
- - `WON_ARBITRATION`: Won arbitration.
- - `WON_FIRST_CHARGEBACK`: Won first chargeback.
- - `WON_PREARBITRATION`: Won prearbitration.
- """
-
- status: Literal[
- "ARBITRATION",
- "CASE_CLOSED",
- "CASE_WON",
- "NEW",
- "PENDING_CUSTOMER",
- "PREARBITRATION",
- "REPRESENTMENT",
- "SUBMITTED",
- ]
- """Status types:
-
- - `NEW` - New dispute case is opened.
- - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more
- information.
- - `SUBMITTED` - Dispute is submitted to the card network.
- - `REPRESENTMENT` - Case has entered second presentment.
- - `PREARBITRATION` - Case has entered prearbitration.
- - `ARBITRATION` - Case has entered arbitration.
- - `CASE_WON` - Case was won and credit will be issued.
- - `CASE_CLOSED` - Case was lost or withdrawn.
- """
-
- transaction_token: str
- """The transaction that is being disputed.
-
- A transaction can only be disputed once but may have multiple dispute cases.
- """
diff --git a/src/lithic/types/dispute_update_response.py b/src/lithic/types/dispute_update_response.py
deleted file mode 100644
index a80cd8b8..00000000
--- a/src/lithic/types/dispute_update_response.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["DisputeUpdateResponse"]
-
-
-class DisputeUpdateResponse(BaseModel):
- token: str
- """Globally unique identifier."""
-
- amount: int
- """Amount under dispute. May be different from the original transaction amount."""
-
- arbitration_date: Optional[datetime] = None
- """Date dispute entered arbitration."""
-
- created: datetime
- """Timestamp of when first Dispute was reported."""
-
- customer_filed_date: Optional[datetime] = None
- """Date that the dispute was filed by the customer making the dispute."""
-
- customer_note: Optional[str] = None
- """End customer description of the reason for the dispute."""
-
- network_claim_ids: Optional[List[str]] = None
- """Unique identifiers for the dispute from the network."""
-
- network_filed_date: Optional[datetime] = None
- """Date that the dispute was submitted to the network."""
-
- network_reason_code: Optional[str] = None
- """Network reason code used to file the dispute."""
-
- prearbitration_date: Optional[datetime] = None
- """Date dispute entered pre-arbitration."""
-
- primary_claim_id: Optional[str] = None
- """Unique identifier for the dispute from the network.
-
- If there are multiple, this will be the first claim id set by the network
- """
-
- reason: Literal[
- "ATM_CASH_MISDISPENSE",
- "CANCELLED",
- "DUPLICATED",
- "FRAUD_CARD_NOT_PRESENT",
- "FRAUD_CARD_PRESENT",
- "FRAUD_OTHER",
- "GOODS_SERVICES_NOT_AS_DESCRIBED",
- "GOODS_SERVICES_NOT_RECEIVED",
- "INCORRECT_AMOUNT",
- "MISSING_AUTH",
- "OTHER",
- "PROCESSING_ERROR",
- "RECURRING_TRANSACTION_NOT_CANCELLED",
- "REFUND_NOT_PROCESSED",
- ]
- """Dispute reason:
-
- - `ATM_CASH_MISDISPENSE`: ATM cash misdispense.
- - `CANCELLED`: Transaction was cancelled by the customer.
- - `DUPLICATED`: The transaction was a duplicate.
- - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present.
- - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present.
- - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable
- merchant activity.
- - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as
- described.
- - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received.
- - `INCORRECT_AMOUNT`: The transaction amount was incorrect.
- - `MISSING_AUTH`: The transaction was missing authorization.
- - `OTHER`: Other reason.
- - `PROCESSING_ERROR`: Processing error.
- - `REFUND_NOT_PROCESSED`: The refund was not processed.
- - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not
- cancelled.
- """
-
- representment_date: Optional[datetime] = None
- """Date the representment was received."""
-
- resolution_date: Optional[datetime] = None
- """Date that the dispute was resolved."""
-
- resolution_note: Optional[str] = None
- """Note by Dispute team on the case resolution."""
-
- resolution_reason: Optional[
- Literal[
- "CASE_LOST",
- "NETWORK_REJECTED",
- "NO_DISPUTE_RIGHTS_3DS",
- "NO_DISPUTE_RIGHTS_BELOW_THRESHOLD",
- "NO_DISPUTE_RIGHTS_CONTACTLESS",
- "NO_DISPUTE_RIGHTS_HYBRID",
- "NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS",
- "NO_DISPUTE_RIGHTS_OTHER",
- "PAST_FILING_DATE",
- "PREARBITRATION_REJECTED",
- "PROCESSOR_REJECTED_OTHER",
- "REFUNDED",
- "REFUNDED_AFTER_CHARGEBACK",
- "WITHDRAWN",
- "WON_ARBITRATION",
- "WON_FIRST_CHARGEBACK",
- "WON_PREARBITRATION",
- ]
- ] = None
- """Reason for the dispute resolution:
-
- - `CASE_LOST`: This case was lost at final arbitration.
- - `NETWORK_REJECTED`: Network rejected.
- - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS.
- - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold.
- - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless.
- - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid.
- - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks.
- - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other.
- - `PAST_FILING_DATE`: Past filing date.
- - `PREARBITRATION_REJECTED`: Prearbitration rejected.
- - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other.
- - `REFUNDED`: Refunded.
- - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback.
- - `WITHDRAWN`: Withdrawn.
- - `WON_ARBITRATION`: Won arbitration.
- - `WON_FIRST_CHARGEBACK`: Won first chargeback.
- - `WON_PREARBITRATION`: Won prearbitration.
- """
-
- status: Literal[
- "ARBITRATION",
- "CASE_CLOSED",
- "CASE_WON",
- "NEW",
- "PENDING_CUSTOMER",
- "PREARBITRATION",
- "REPRESENTMENT",
- "SUBMITTED",
- ]
- """Status types:
-
- - `NEW` - New dispute case is opened.
- - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more
- information.
- - `SUBMITTED` - Dispute is submitted to the card network.
- - `REPRESENTMENT` - Case has entered second presentment.
- - `PREARBITRATION` - Case has entered prearbitration.
- - `ARBITRATION` - Case has entered arbitration.
- - `CASE_WON` - Case was won and credit will be issued.
- - `CASE_CLOSED` - Case was lost or withdrawn.
- """
-
- transaction_token: str
- """The transaction that is being disputed.
-
- A transaction can only be disputed once but may have multiple dispute cases.
- """
diff --git a/src/lithic/types/dispute_v2.py b/src/lithic/types/dispute_v2.py
new file mode 100644
index 00000000..49248838
--- /dev/null
+++ b/src/lithic/types/dispute_v2.py
@@ -0,0 +1,172 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union, Optional
+from datetime import datetime
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from .._utils import PropertyInfo
+from .._models import BaseModel
+from .shared.merchant import Merchant
+
+__all__ = [
+ "DisputeV2",
+ "Event",
+ "EventData",
+ "EventDataWorkflow",
+ "EventDataFinancial",
+ "EventDataCardholderLiability",
+ "LiabilityAllocation",
+ "TransactionSeries",
+]
+
+
+class EventDataWorkflow(BaseModel):
+ action: Literal["OPENED", "CLOSED", "REOPENED"]
+ """Action taken in this stage"""
+
+ amount: Optional[int] = None
+ """Amount in minor units"""
+
+ disposition: Optional[Literal["WON", "LOST", "PARTIALLY_WON", "WITHDRAWN", "DENIED"]] = None
+ """Dispute resolution outcome"""
+
+ reason: Optional[str] = None
+ """Reason for the action"""
+
+ stage: Literal["CLAIM"]
+ """Current stage of the dispute workflow"""
+
+ type: Literal["WORKFLOW"]
+ """Event type discriminator"""
+
+
+class EventDataFinancial(BaseModel):
+ amount: int
+ """Amount in minor units"""
+
+ polarity: Literal["CREDIT", "DEBIT"]
+ """Direction of funds flow"""
+
+ stage: Literal["CHARGEBACK", "REPRESENTMENT", "PREARBITRATION", "ARBITRATION", "COLLABORATION"]
+ """Stage at which the financial event occurred"""
+
+ type: Literal["FINANCIAL"]
+ """Event type discriminator"""
+
+
+class EventDataCardholderLiability(BaseModel):
+ action: Literal["PROVISIONAL_CREDIT_GRANTED", "PROVISIONAL_CREDIT_REVERSED", "WRITTEN_OFF"]
+ """Action taken regarding cardholder liability"""
+
+ amount: int
+ """Amount in minor units"""
+
+ reason: str
+ """Reason for the action"""
+
+ type: Literal["CARDHOLDER_LIABILITY"]
+ """Event type discriminator"""
+
+
+EventData: TypeAlias = Annotated[
+ Union[EventDataWorkflow, EventDataFinancial, EventDataCardholderLiability], PropertyInfo(discriminator="type")
+]
+
+
+class Event(BaseModel):
+ token: str
+ """Unique identifier for the event, in UUID format"""
+
+ created: datetime
+ """When the event occurred"""
+
+ data: EventData
+ """Details specific to the event type"""
+
+ type: Literal["WORKFLOW", "FINANCIAL", "CARDHOLDER_LIABILITY"]
+ """Type of event"""
+
+
+class LiabilityAllocation(BaseModel):
+ denied_amount: int
+ """The amount that has been denied to the cardholder"""
+
+ original_amount: int
+ """The initial amount disputed"""
+
+ recovered_amount: int
+ """
+ The amount that has been recovered from the merchant through the dispute process
+ """
+
+ remaining_amount: int
+ """Any disputed amount that is still outstanding, i.e.
+
+ has not been recovered, written off, or denied
+ """
+
+ written_off_amount: int
+ """The amount the issuer has chosen to write off"""
+
+
+class TransactionSeries(BaseModel):
+ related_transaction_event_token: Optional[str] = None
+ """
+ Token of the specific event in the original transaction being disputed, in UUID
+ format; null if no event can be identified
+ """
+
+ related_transaction_token: str
+ """Token of the original transaction being disputed, in UUID format"""
+
+ type: Literal["DISPUTE"]
+ """
+ The type of transaction series associating the dispute and the original
+ transaction. Always set to DISPUTE
+ """
+
+
+class DisputeV2(BaseModel):
+ token: str
+ """Token assigned by Lithic for the dispute, in UUID format."""
+
+ account_token: str
+ """Token for the account associated with the dispute, in UUID format."""
+
+ card_token: str
+ """Token for the card used in the dispute, in UUID format."""
+
+ case_id: Optional[str] = None
+ """Identifier assigned by the network for this dispute."""
+
+ created: datetime
+ """When the dispute was created."""
+
+ currency: str
+ """Three-letter ISO 4217 currency code."""
+
+ disposition: Optional[Literal["WON", "LOST", "PARTIALLY_WON", "WITHDRAWN", "DENIED"]] = None
+ """Dispute resolution outcome"""
+
+ events: List[Event]
+ """Chronological list of events that have occurred in the dispute lifecycle"""
+
+ liability_allocation: LiabilityAllocation
+ """Current breakdown of how liability is allocated for the disputed amount"""
+
+ merchant: Merchant
+
+ network: Literal["VISA", "MASTERCARD"]
+ """Card network handling the dispute."""
+
+ status: Optional[Literal["OPEN", "CLOSED"]] = None
+ """Current status of the dispute."""
+
+ transaction_series: Optional[TransactionSeries] = None
+ """
+ Contains identifiers for the transaction and specific event within being
+ disputed; null if no transaction can be identified
+ """
+
+ updated: datetime
+ """When the dispute was last updated."""
diff --git a/src/lithic/types/disputes_v2_list_params.py b/src/lithic/types/disputes_v2_list_params.py
new file mode 100644
index 00000000..5f061147
--- /dev/null
+++ b/src/lithic/types/disputes_v2_list_params.py
@@ -0,0 +1,47 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from datetime import datetime
+from typing_extensions import Annotated, TypedDict
+
+from .._utils import PropertyInfo
+
+__all__ = ["DisputesV2ListParams"]
+
+
+class DisputesV2ListParams(TypedDict, total=False):
+ account_token: str
+ """Filter by account token."""
+
+ begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
+ """RFC 3339 timestamp for filtering by created date, inclusive."""
+
+ card_token: str
+ """Filter by card token."""
+
+ disputed_transaction_token: str
+ """Filter by the token of the transaction being disputed.
+
+ Corresponds with transaction_series.related_transaction_token in the Dispute.
+ """
+
+ end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
+ """RFC 3339 timestamp for filtering by created date, inclusive."""
+
+ ending_before: str
+ """A cursor representing an item's token before which a page of results should end.
+
+ Used to retrieve the previous page of results before this item.
+ """
+
+ page_size: int
+ """Number of items to return."""
+
+ starting_after: str
+ """A cursor representing an item's token after which a page of results should
+ begin.
+
+ Used to retrieve the next page of results after this item.
+ """
diff --git a/src/lithic/types/external_bank_account_address_param.py b/src/lithic/types/external_bank_account_address_param.py
index f201ef84..ff178c71 100644
--- a/src/lithic/types/external_bank_account_address_param.py
+++ b/src/lithic/types/external_bank_account_address_param.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import Required, TypedDict
__all__ = ["ExternalBankAccountAddressParam"]
@@ -18,4 +19,4 @@ class ExternalBankAccountAddressParam(TypedDict, total=False):
state: Required[str]
- address2: str
+ address2: Optional[str]
diff --git a/src/lithic/types/external_bank_account_unpause_response.py b/src/lithic/types/external_bank_account_unpause_response.py
new file mode 100644
index 00000000..97982c04
--- /dev/null
+++ b/src/lithic/types/external_bank_account_unpause_response.py
@@ -0,0 +1,105 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import date, datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .owner_type import OwnerType
+from .verification_method import VerificationMethod
+from .external_bank_account_address import ExternalBankAccountAddress
+
+__all__ = ["ExternalBankAccountUnpauseResponse"]
+
+
+class ExternalBankAccountUnpauseResponse(BaseModel):
+ token: str
+ """
+ A globally unique identifier for this record of an external bank account
+ association. If a program links an external bank account to more than one
+ end-user or to both the program and the end-user, then Lithic will return each
+ record of the association
+ """
+
+ country: str
+ """The country that the bank account is located in using ISO 3166-1.
+
+ We will only accept USA bank accounts e.g., USA
+ """
+
+ created: datetime
+ """
+ An ISO 8601 string representing when this funding source was added to the Lithic
+ account.
+ """
+
+ currency: str
+ """currency of the external account 3-character alphabetic ISO 4217 code"""
+
+ last_four: str
+ """The last 4 digits of the bank account.
+
+ Derived by Lithic from the account number passed
+ """
+
+ owner: str
+ """Legal Name of the business or individual who owns the external account.
+
+ This will appear in statements
+ """
+
+ owner_type: OwnerType
+ """Owner Type"""
+
+ routing_number: str
+ """Routing Number"""
+
+ state: Literal["ENABLED", "CLOSED", "PAUSED"]
+ """Account State"""
+
+ type: Literal["CHECKING", "SAVINGS"]
+ """Account Type"""
+
+ verification_attempts: int
+ """The number of attempts at verification"""
+
+ verification_method: VerificationMethod
+ """Verification Method"""
+
+ verification_state: Literal["PENDING", "ENABLED", "FAILED_VERIFICATION", "INSUFFICIENT_FUNDS"]
+ """Verification State"""
+
+ account_token: Optional[str] = None
+ """Indicates which Lithic account the external account is associated with.
+
+ For external accounts that are associated with the program, account_token field
+ returned will be null
+ """
+
+ address: Optional[ExternalBankAccountAddress] = None
+ """Address"""
+
+ company_id: Optional[str] = None
+ """Optional field that helps identify bank accounts in receipts"""
+
+ dob: Optional[date] = None
+ """Date of Birth of the Individual that owns the external bank account"""
+
+ doing_business_as: Optional[str] = None
+ """Doing Business As"""
+
+ financial_account_token: Optional[str] = None
+ """The financial account token of the operating account to fund the micro deposits"""
+
+ name: Optional[str] = None
+ """The nickname for this External Bank Account"""
+
+ user_defined_id: Optional[str] = None
+ """User Defined ID"""
+
+ verification_failed_reason: Optional[str] = None
+ """Optional free text description of the reason for the failed verification.
+
+ For ACH micro-deposits returned, this field will display the reason return code
+ sent by the ACH network
+ """
diff --git a/src/lithic/types/external_payment.py b/src/lithic/types/external_payment.py
index 666be1e2..874dc552 100644
--- a/src/lithic/types/external_payment.py
+++ b/src/lithic/types/external_payment.py
@@ -55,7 +55,7 @@ class ExternalPayment(BaseModel):
created: datetime
"""ISO 8601 timestamp of when the transaction was created"""
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]
"""The status of the transaction"""
updated: datetime
diff --git a/src/lithic/types/external_payment_list_params.py b/src/lithic/types/external_payment_list_params.py
index c1ce26ff..1cca6e22 100644
--- a/src/lithic/types/external_payment_list_params.py
+++ b/src/lithic/types/external_payment_list_params.py
@@ -54,5 +54,5 @@ class ExternalPaymentListParams(TypedDict, total=False):
Used to retrieve the next page of results after this item.
"""
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]
"""Book transfer status to be returned."""
diff --git a/src/lithic/types/financial_account.py b/src/lithic/types/financial_account.py
index 94d7db28..4ca056c1 100644
--- a/src/lithic/types/financial_account.py
+++ b/src/lithic/types/financial_account.py
@@ -15,7 +15,7 @@ class CreditConfigurationAutoCollectionConfiguration(BaseModel):
class CreditConfiguration(BaseModel):
- auto_collection_configuration: CreditConfigurationAutoCollectionConfiguration
+ auto_collection_configuration: Optional[CreditConfigurationAutoCollectionConfiguration] = None
credit_limit: Optional[int] = None
diff --git a/src/lithic/types/financial_accounts/__init__.py b/src/lithic/types/financial_accounts/__init__.py
index 75207d61..1616fa89 100644
--- a/src/lithic/types/financial_accounts/__init__.py
+++ b/src/lithic/types/financial_accounts/__init__.py
@@ -5,6 +5,7 @@
from .loan_tape import LoanTape as LoanTape
from .statement import Statement as Statement
from .statements import Statements as Statements
+from .category_balances import CategoryBalances as CategoryBalances
from .balance_list_params import BalanceListParams as BalanceListParams
from .balance_list_response import BalanceListResponse as BalanceListResponse
from .loan_tape_list_params import LoanTapeListParams as LoanTapeListParams
diff --git a/src/lithic/types/financial_accounts/category_balances.py b/src/lithic/types/financial_accounts/category_balances.py
new file mode 100644
index 00000000..bce87764
--- /dev/null
+++ b/src/lithic/types/financial_accounts/category_balances.py
@@ -0,0 +1,13 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from ..._models import BaseModel
+
+__all__ = ["CategoryBalances"]
+
+
+class CategoryBalances(BaseModel):
+ fees: int
+
+ interest: int
+
+ principal: int
diff --git a/src/lithic/types/financial_accounts/loan_tape.py b/src/lithic/types/financial_accounts/loan_tape.py
index 3e1fe155..f14ce634 100644
--- a/src/lithic/types/financial_accounts/loan_tape.py
+++ b/src/lithic/types/financial_accounts/loan_tape.py
@@ -5,26 +5,18 @@
from typing_extensions import Literal
from ..._models import BaseModel
+from ..category_details import CategoryDetails
+from ..statement_totals import StatementTotals
+from .category_balances import CategoryBalances
__all__ = [
"LoanTape",
"AccountStanding",
"AccountStandingFinancialAccountState",
"Balances",
- "BalancesDue",
- "BalancesNextStatementDue",
- "BalancesPastDue",
- "BalancesPastStatementsDue",
- "DayTotals",
"InterestDetails",
- "InterestDetailsDailyBalanceAmounts",
- "InterestDetailsEffectiveApr",
- "InterestDetailsInterestForPeriod",
"MinimumPaymentBalance",
- "PaymentAllocation",
- "PeriodTotals",
"PreviousStatementBalance",
- "YtdTotals",
]
@@ -63,132 +55,38 @@ class AccountStanding(BaseModel):
period_state: Literal["STANDARD", "PROMO", "PENALTY"]
-class BalancesDue(BaseModel):
- fees: int
-
- interest: int
-
- principal: int
-
-
-class BalancesNextStatementDue(BaseModel):
- fees: int
-
- interest: int
-
- principal: int
-
-
-class BalancesPastDue(BaseModel):
- fees: int
-
- interest: int
-
- principal: int
-
-
-class BalancesPastStatementsDue(BaseModel):
- fees: int
-
- interest: int
-
- principal: int
-
-
class Balances(BaseModel):
- due: BalancesDue
+ due: CategoryBalances
"""Amount due for the prior billing cycle.
Any amounts not fully paid off on this due date will be considered past due the
next day
"""
- next_statement_due: BalancesNextStatementDue
+ next_statement_due: CategoryBalances
"""Amount due for the current billing cycle.
Any amounts not paid off by early payments or credits will be considered due at
the end of the current billing period
"""
- past_due: BalancesPastDue
+ past_due: CategoryBalances
"""Amount not paid off on previous due dates"""
- past_statements_due: BalancesPastStatementsDue
+ past_statements_due: CategoryBalances
"""Amount due for the past billing cycles."""
-class DayTotals(BaseModel):
- balance_transfers: int
- """Opening balance transferred from previous account in cents"""
-
- cash_advances: int
- """ATM and cashback transactions in cents"""
-
- credits: int
- """
- Volume of credit management operation transactions less any balance transfers in
- cents
- """
-
- debits: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- fees: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- interest: int
- """Interest accrued in cents"""
-
- payments: int
- """Any funds transfers which affective the balance in cents"""
-
- purchases: int
- """Net card transaction volume less any cash advances in cents"""
-
- credit_details: Optional[object] = None
- """Breakdown of credits"""
-
- debit_details: Optional[object] = None
- """Breakdown of debits"""
-
- payment_details: Optional[object] = None
- """Breakdown of payments"""
-
-
-class InterestDetailsDailyBalanceAmounts(BaseModel):
- balance_transfers: str
-
- cash_advances: str
-
- purchases: str
-
-
-class InterestDetailsEffectiveApr(BaseModel):
- balance_transfers: str
-
- cash_advances: str
-
- purchases: str
-
-
-class InterestDetailsInterestForPeriod(BaseModel):
- balance_transfers: str
-
- cash_advances: str
-
- purchases: str
-
-
class InterestDetails(BaseModel):
actual_interest_charged: Optional[int] = None
- daily_balance_amounts: InterestDetailsDailyBalanceAmounts
+ daily_balance_amounts: CategoryDetails
- effective_apr: InterestDetailsEffectiveApr
+ effective_apr: CategoryDetails
interest_calculation_method: Literal["DAILY", "AVERAGE_DAILY"]
- interest_for_period: InterestDetailsInterestForPeriod
+ interest_for_period: CategoryDetails
prime_rate: Optional[str] = None
@@ -201,96 +99,12 @@ class MinimumPaymentBalance(BaseModel):
remaining: int
-class PaymentAllocation(BaseModel):
- fees: int
-
- interest: int
-
- principal: int
-
-
-class PeriodTotals(BaseModel):
- balance_transfers: int
- """Opening balance transferred from previous account in cents"""
-
- cash_advances: int
- """ATM and cashback transactions in cents"""
-
- credits: int
- """
- Volume of credit management operation transactions less any balance transfers in
- cents
- """
-
- debits: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- fees: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- interest: int
- """Interest accrued in cents"""
-
- payments: int
- """Any funds transfers which affective the balance in cents"""
-
- purchases: int
- """Net card transaction volume less any cash advances in cents"""
-
- credit_details: Optional[object] = None
- """Breakdown of credits"""
-
- debit_details: Optional[object] = None
- """Breakdown of debits"""
-
- payment_details: Optional[object] = None
- """Breakdown of payments"""
-
-
class PreviousStatementBalance(BaseModel):
amount: int
remaining: int
-class YtdTotals(BaseModel):
- balance_transfers: int
- """Opening balance transferred from previous account in cents"""
-
- cash_advances: int
- """ATM and cashback transactions in cents"""
-
- credits: int
- """
- Volume of credit management operation transactions less any balance transfers in
- cents
- """
-
- debits: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- fees: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- interest: int
- """Interest accrued in cents"""
-
- payments: int
- """Any funds transfers which affective the balance in cents"""
-
- purchases: int
- """Net card transaction volume less any cash advances in cents"""
-
- credit_details: Optional[object] = None
- """Breakdown of credits"""
-
- debit_details: Optional[object] = None
- """Breakdown of debits"""
-
- payment_details: Optional[object] = None
- """Breakdown of payments"""
-
-
class LoanTape(BaseModel):
token: str
"""Globally unique identifier for a loan tape"""
@@ -318,7 +132,7 @@ class LoanTape(BaseModel):
date: datetime.date
"""Date of transactions that this loan tape covers"""
- day_totals: DayTotals
+ day_totals: StatementTotals
ending_balance: int
"""Balance at the end of the day"""
@@ -338,9 +152,9 @@ class LoanTape(BaseModel):
minimum_payment_balance: MinimumPaymentBalance
- payment_allocation: PaymentAllocation
+ payment_allocation: CategoryBalances
- period_totals: PeriodTotals
+ period_totals: StatementTotals
previous_statement_balance: PreviousStatementBalance
@@ -353,7 +167,7 @@ class LoanTape(BaseModel):
version: int
"""Version number of the loan tape. This starts at 1"""
- ytd_totals: YtdTotals
+ ytd_totals: StatementTotals
tier: Optional[str] = None
"""Interest tier to which this account belongs to"""
diff --git a/src/lithic/types/financial_accounts/statement.py b/src/lithic/types/financial_accounts/statement.py
index 5f629be0..246a3801 100644
--- a/src/lithic/types/financial_accounts/statement.py
+++ b/src/lithic/types/financial_accounts/statement.py
@@ -5,19 +5,10 @@
from typing_extensions import Literal
from ..._models import BaseModel
+from ..category_details import CategoryDetails
+from ..statement_totals import StatementTotals
-__all__ = [
- "Statement",
- "AccountStanding",
- "AccountStandingFinancialAccountState",
- "AmountDue",
- "PeriodTotals",
- "YtdTotals",
- "InterestDetails",
- "InterestDetailsDailyBalanceAmounts",
- "InterestDetailsEffectiveApr",
- "InterestDetailsInterestForPeriod",
-]
+__all__ = ["Statement", "AccountStanding", "AccountStandingFinancialAccountState", "AmountDue", "InterestDetails"]
class AccountStandingFinancialAccountState(BaseModel):
@@ -68,116 +59,16 @@ class AmountDue(BaseModel):
"""Amount past due for statement in cents"""
-class PeriodTotals(BaseModel):
- balance_transfers: int
- """Opening balance transferred from previous account in cents"""
-
- cash_advances: int
- """ATM and cashback transactions in cents"""
-
- credits: int
- """
- Volume of credit management operation transactions less any balance transfers in
- cents
- """
-
- debits: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- fees: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- interest: int
- """Interest accrued in cents"""
-
- payments: int
- """Any funds transfers which affective the balance in cents"""
-
- purchases: int
- """Net card transaction volume less any cash advances in cents"""
-
- credit_details: Optional[object] = None
- """Breakdown of credits"""
-
- debit_details: Optional[object] = None
- """Breakdown of debits"""
-
- payment_details: Optional[object] = None
- """Breakdown of payments"""
-
-
-class YtdTotals(BaseModel):
- balance_transfers: int
- """Opening balance transferred from previous account in cents"""
-
- cash_advances: int
- """ATM and cashback transactions in cents"""
-
- credits: int
- """
- Volume of credit management operation transactions less any balance transfers in
- cents
- """
-
- debits: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- fees: int
- """Volume of debit management operation transactions less any interest in cents"""
-
- interest: int
- """Interest accrued in cents"""
-
- payments: int
- """Any funds transfers which affective the balance in cents"""
-
- purchases: int
- """Net card transaction volume less any cash advances in cents"""
-
- credit_details: Optional[object] = None
- """Breakdown of credits"""
-
- debit_details: Optional[object] = None
- """Breakdown of debits"""
-
- payment_details: Optional[object] = None
- """Breakdown of payments"""
-
-
-class InterestDetailsDailyBalanceAmounts(BaseModel):
- balance_transfers: str
-
- cash_advances: str
-
- purchases: str
-
-
-class InterestDetailsEffectiveApr(BaseModel):
- balance_transfers: str
-
- cash_advances: str
-
- purchases: str
-
-
-class InterestDetailsInterestForPeriod(BaseModel):
- balance_transfers: str
-
- cash_advances: str
-
- purchases: str
-
-
class InterestDetails(BaseModel):
actual_interest_charged: Optional[int] = None
- daily_balance_amounts: InterestDetailsDailyBalanceAmounts
+ daily_balance_amounts: CategoryDetails
- effective_apr: InterestDetailsEffectiveApr
+ effective_apr: CategoryDetails
interest_calculation_method: Literal["DAILY", "AVERAGE_DAILY"]
- interest_for_period: InterestDetailsInterestForPeriod
+ interest_for_period: CategoryDetails
prime_rate: Optional[str] = None
@@ -219,7 +110,7 @@ class Statement(BaseModel):
payment_due_date: Optional[date] = None
"""Date when the payment is due"""
- period_totals: PeriodTotals
+ period_totals: StatementTotals
starting_balance: int
"""Balance at the start of the billing period"""
@@ -235,7 +126,7 @@ class Statement(BaseModel):
updated: datetime
"""Timestamp of when the statement was updated"""
- ytd_totals: YtdTotals
+ ytd_totals: StatementTotals
interest_details: Optional[InterestDetails] = None
diff --git a/src/lithic/types/financial_transaction.py b/src/lithic/types/financial_transaction.py
index 5bb20396..6b3032e7 100644
--- a/src/lithic/types/financial_transaction.py
+++ b/src/lithic/types/financial_transaction.py
@@ -1,108 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Optional
+from typing import List
from datetime import datetime
from typing_extensions import Literal
from .._models import BaseModel
+from .shared.financial_event import FinancialEvent
-__all__ = ["FinancialTransaction", "Event"]
-
-
-class Event(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_REJECTED",
- "ACH_ORIGINATION_REVIEWED",
- "ACH_ORIGINATION_SETTLED",
- "ACH_RECEIPT_PROCESSED",
- "ACH_RECEIPT_RELEASED",
- "ACH_RECEIPT_SETTLED",
- "ACH_RETURN_INITIATED",
- "ACH_RETURN_PROCESSED",
- "ACH_RETURN_REJECTED",
- "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
+__all__ = ["FinancialTransaction"]
class FinancialTransaction(BaseModel):
@@ -134,7 +39,7 @@ class FinancialTransaction(BaseModel):
to display to users.
"""
- events: List[Event]
+ events: List[FinancialEvent]
"""A list of all financial events that have modified this financial transaction."""
pending_amount: int
diff --git a/src/lithic/types/management_operation_list_params.py b/src/lithic/types/management_operation_list_params.py
index 7ce00805..c026ad91 100644
--- a/src/lithic/types/management_operation_list_params.py
+++ b/src/lithic/types/management_operation_list_params.py
@@ -53,5 +53,5 @@ class ManagementOperationListParams(TypedDict, total=False):
Used to retrieve the next page of results after this item.
"""
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]
"""Management operation status to be returned."""
diff --git a/src/lithic/types/management_operation_transaction.py b/src/lithic/types/management_operation_transaction.py
index c8410b5b..c1bbc11c 100644
--- a/src/lithic/types/management_operation_transaction.py
+++ b/src/lithic/types/management_operation_transaction.py
@@ -65,7 +65,7 @@ class ManagementOperationTransaction(BaseModel):
created: datetime
"""ISO 8601 timestamp of when the transaction was created"""
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]
"""The status of the transaction"""
updated: datetime
diff --git a/src/lithic/types/payment.py b/src/lithic/types/payment.py
index e34d4299..3e77e3d3 100644
--- a/src/lithic/types/payment.py
+++ b/src/lithic/types/payment.py
@@ -82,6 +82,7 @@ class Event(BaseModel):
List[
Literal[
"APPROVED",
+ "DECLINED",
"FUNDS_INSUFFICIENT",
"ACCOUNT_INVALID",
"PROGRAM_TRANSACTION_LIMIT_EXCEEDED",
@@ -201,8 +202,8 @@ class Payment(BaseModel):
pending_amount: int
"""Pending amount in cents"""
- related_account_tokens: RelatedAccountTokens
- """Related account tokens for the transaction"""
+ related_account_tokens: Optional[RelatedAccountTokens] = None
+ """Account tokens related to a payment transaction"""
result: Literal["APPROVED", "DECLINED"]
"""Transaction result"""
@@ -213,7 +214,7 @@ class Payment(BaseModel):
source: Literal["LITHIC", "EXTERNAL", "CUSTOMER"]
"""Transaction source"""
- status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
+ status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]
"""The status of the transaction"""
updated: datetime
diff --git a/src/lithic/types/payment_return_params.py b/src/lithic/types/payment_return_params.py
new file mode 100644
index 00000000..a466b8c6
--- /dev/null
+++ b/src/lithic/types/payment_return_params.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Optional
+from datetime import date
+from typing_extensions import Required, Annotated, TypedDict
+
+from .._utils import PropertyInfo
+
+__all__ = ["PaymentReturnParams"]
+
+
+class PaymentReturnParams(TypedDict, total=False):
+ financial_account_token: Required[str]
+ """Globally unique identifier for the financial account"""
+
+ return_reason_code: Required[str]
+ """ACH return reason code indicating the reason for returning the payment.
+
+ Supported codes include R01-R53 and R80-R85. For a complete list of return codes
+ and their meanings, see
+ [ACH Return Reasons](https://docs.lithic.com/docs/ach-overview#ach-return-reasons)
+ """
+
+ addenda: Optional[str]
+ """Optional additional information about the return. Limited to 44 characters"""
+
+ date_of_death: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]
+ """Date of death in YYYY-MM-DD format.
+
+ Required when using return codes **R14** (representative payee deceased) or
+ **R15** (beneficiary or account holder deceased)
+ """
+
+ memo: Optional[str]
+ """Optional memo for the return. Limited to 10 characters"""
diff --git a/src/lithic/types/payment_return_response.py b/src/lithic/types/payment_return_response.py
new file mode 100644
index 00000000..3efce5dc
--- /dev/null
+++ b/src/lithic/types/payment_return_response.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["PaymentReturnResponse"]
+
+
+class PaymentReturnResponse(BaseModel):
+ result: Literal["APPROVED", "DECLINED"]
+ """Transaction result"""
+
+ transaction_group_uuid: str
+ """Globally unique identifier for the transaction group"""
+
+ transaction_uuid: str
+ """Globally unique identifier for the transaction"""
diff --git a/src/lithic/types/shared/__init__.py b/src/lithic/types/shared/__init__.py
index f9248f1c..fc923958 100644
--- a/src/lithic/types/shared/__init__.py
+++ b/src/lithic/types/shared/__init__.py
@@ -4,6 +4,8 @@
from .carrier import Carrier as Carrier
from .currency import Currency as Currency
from .document import Document as Document
+from .merchant import Merchant as Merchant
+from .financial_event import FinancialEvent as FinancialEvent
from .shipping_address import ShippingAddress as ShippingAddress
from .account_financial_account_type import AccountFinancialAccountType as AccountFinancialAccountType
from .instance_financial_account_type import InstanceFinancialAccountType as InstanceFinancialAccountType
diff --git a/src/lithic/types/shared/financial_event.py b/src/lithic/types/shared/financial_event.py
new file mode 100644
index 00000000..72188dc7
--- /dev/null
+++ b/src/lithic/types/shared/financial_event.py
@@ -0,0 +1,105 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["FinancialEvent"]
+
+
+class FinancialEvent(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_REJECTED",
+ "ACH_ORIGINATION_REVIEWED",
+ "ACH_ORIGINATION_SETTLED",
+ "ACH_RECEIPT_PROCESSED",
+ "ACH_RECEIPT_RELEASED",
+ "ACH_RECEIPT_SETTLED",
+ "ACH_RETURN_INITIATED",
+ "ACH_RETURN_PROCESSED",
+ "ACH_RETURN_REJECTED",
+ "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
diff --git a/src/lithic/types/shared/merchant.py b/src/lithic/types/shared/merchant.py
new file mode 100644
index 00000000..99c38f9e
--- /dev/null
+++ b/src/lithic/types/shared/merchant.py
@@ -0,0 +1,40 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from ..._models import BaseModel
+
+__all__ = ["Merchant"]
+
+
+class Merchant(BaseModel):
+ acceptor_id: str
+ """Unique alphanumeric identifier for the payment card acceptor (merchant)."""
+
+ acquiring_institution_id: str
+ """Unique numeric identifier of the acquiring institution."""
+
+ city: str
+ """City of card acceptor.
+
+ Note that in many cases, particularly in card-not-present transactions,
+ merchants may send through a phone number or URL in this field.
+ """
+
+ country: str
+ """Country or entity of card acceptor.
+
+ Possible values are: (1) all ISO 3166-1 alpha-3 country codes, (2) QZZ for
+ Kosovo, and (3) ANT for Netherlands Antilles.
+ """
+
+ descriptor: str
+ """Short description of card acceptor."""
+
+ mcc: str
+ """Merchant category code (MCC).
+
+ A four-digit number listed in ISO 18245. An MCC is used to classify a business
+ by the types of goods or services it provides.
+ """
+
+ state: str
+ """Geographic state of card acceptor."""
diff --git a/src/lithic/types/statement_totals.py b/src/lithic/types/statement_totals.py
new file mode 100644
index 00000000..0f4ac3e1
--- /dev/null
+++ b/src/lithic/types/statement_totals.py
@@ -0,0 +1,45 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+
+from .._models import BaseModel
+
+__all__ = ["StatementTotals"]
+
+
+class StatementTotals(BaseModel):
+ balance_transfers: int
+ """Opening balance transferred from previous account in cents"""
+
+ cash_advances: int
+ """ATM and cashback transactions in cents"""
+
+ credits: int
+ """
+ Volume of credit management operation transactions less any balance transfers in
+ cents
+ """
+
+ debits: int
+ """Volume of debit management operation transactions less any interest in cents"""
+
+ fees: int
+ """Volume of debit management operation transactions less any interest in cents"""
+
+ interest: int
+ """Interest accrued in cents"""
+
+ payments: int
+ """Any funds transfers which affective the balance in cents"""
+
+ purchases: int
+ """Net card transaction volume less any cash advances in cents"""
+
+ credit_details: Optional[object] = None
+ """Breakdown of credits"""
+
+ debit_details: Optional[object] = None
+ """Breakdown of debits"""
+
+ payment_details: Optional[object] = None
+ """Breakdown of payments"""
diff --git a/src/lithic/types/three_ds/authentication_retrieve_response.py b/src/lithic/types/three_ds/authentication_retrieve_response.py
index 3637b11b..5de77b1b 100644
--- a/src/lithic/types/three_ds/authentication_retrieve_response.py
+++ b/src/lithic/types/three_ds/authentication_retrieve_response.py
@@ -99,19 +99,19 @@ class Cardholder(BaseModel):
"""Name of the cardholder. Maps to EMV 3DS field `cardholderName`."""
phone_number_home: Optional[str] = None
- """Home phone number provided by the cardholder.
+ """Home phone number in E.164 format provided by the cardholder.
Maps to EMV 3DS fields `homePhone.cc` and `homePhone.subscriber`.
"""
phone_number_mobile: Optional[str] = None
- """Mobile/cell phone number provided by the cardholder.
+ """Mobile/cell phone number in E.164 format provided by the cardholder.
Maps to EMV 3DS fields `mobilePhone.cc` and `mobilePhone.subscriber`.
"""
phone_number_work: Optional[str] = None
- """Work phone number provided by the cardholder.
+ """Work phone number in E.164 format provided by the cardholder.
Maps to EMV 3DS fields `workPhone.cc` and `workPhone.subscriber`.
"""
diff --git a/src/lithic/types/transaction.py b/src/lithic/types/transaction.py
index ed78ffb5..cbdbea4b 100644
--- a/src/lithic/types/transaction.py
+++ b/src/lithic/types/transaction.py
@@ -6,6 +6,7 @@
from .._models import BaseModel
from .shared.currency import Currency
+from .shared.merchant import Merchant
__all__ = [
"Transaction",
@@ -16,7 +17,6 @@
"AmountsSettlement",
"Avs",
"CardholderAuthentication",
- "Merchant",
"Pos",
"PosEntryMode",
"PosTerminal",
@@ -133,41 +133,6 @@ class CardholderAuthentication(BaseModel):
"""
-class Merchant(BaseModel):
- acceptor_id: str
- """Unique alphanumeric identifier for the payment card acceptor (merchant)."""
-
- acquiring_institution_id: str
- """Unique numeric identifier of the acquiring institution."""
-
- city: str
- """City of card acceptor.
-
- Note that in many cases, particularly in card-not-present transactions,
- merchants may send through a phone number or URL in this field.
- """
-
- country: str
- """Country or entity of card acceptor.
-
- Possible values are: (1) all ISO 3166-1 alpha-3 country codes, (2) QZZ for
- Kosovo, and (3) ANT for Netherlands Antilles.
- """
-
- descriptor: str
- """Short description of card acceptor."""
-
- mcc: str
- """Merchant category code (MCC).
-
- A four-digit number listed in ISO 18245. An MCC is used to classify a business
- by the types of goods or services it provides.
- """
-
- state: str
- """Geographic state of card acceptor."""
-
-
class PosEntryMode(BaseModel):
card: Literal["NOT_PRESENT", "PREAUTHORIZED", "PRESENT", "UNKNOWN"]
"""Card presence indicator"""
diff --git a/tests/api_resources/auth_rules/test_v2.py b/tests/api_resources/auth_rules/test_v2.py
index 6ecf7404..20b4e519 100644
--- a/tests/api_resources/auth_rules/test_v2.py
+++ b/tests/api_resources/auth_rules/test_v2.py
@@ -31,7 +31,15 @@ class TestV2:
@parametrize
def test_method_create_overload_1(self, client: Lithic) -> None:
v2 = client.auth_rules.v2.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
)
assert_matches_type(V2CreateResponse, v2, path=["response"])
@@ -59,7 +67,15 @@ def test_method_create_with_all_params_overload_1(self, client: Lithic) -> None:
@parametrize
def test_raw_response_create_overload_1(self, client: Lithic) -> None:
response = client.auth_rules.v2.with_raw_response.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
)
@@ -71,7 +87,15 @@ def test_raw_response_create_overload_1(self, client: Lithic) -> None:
@parametrize
def test_streaming_response_create_overload_1(self, client: Lithic) -> None:
with client.auth_rules.v2.with_streaming_response.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
) as response:
assert not response.is_closed
@@ -86,7 +110,15 @@ def test_streaming_response_create_overload_1(self, client: Lithic) -> None:
def test_method_create_overload_2(self, client: Lithic) -> None:
v2 = client.auth_rules.v2.create(
card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
)
assert_matches_type(V2CreateResponse, v2, path=["response"])
@@ -114,7 +146,15 @@ def test_method_create_with_all_params_overload_2(self, client: Lithic) -> None:
def test_raw_response_create_overload_2(self, client: Lithic) -> None:
response = client.auth_rules.v2.with_raw_response.create(
card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
)
@@ -127,7 +167,15 @@ def test_raw_response_create_overload_2(self, client: Lithic) -> None:
def test_streaming_response_create_overload_2(self, client: Lithic) -> None:
with client.auth_rules.v2.with_streaming_response.create(
card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
) as response:
assert not response.is_closed
@@ -141,7 +189,15 @@ def test_streaming_response_create_overload_2(self, client: Lithic) -> None:
@parametrize
def test_method_create_overload_3(self, client: Lithic) -> None:
v2 = client.auth_rules.v2.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
program_level=True,
type="CONDITIONAL_BLOCK",
)
@@ -170,7 +226,15 @@ def test_method_create_with_all_params_overload_3(self, client: Lithic) -> None:
@parametrize
def test_raw_response_create_overload_3(self, client: Lithic) -> None:
response = client.auth_rules.v2.with_raw_response.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
program_level=True,
type="CONDITIONAL_BLOCK",
)
@@ -183,7 +247,15 @@ def test_raw_response_create_overload_3(self, client: Lithic) -> None:
@parametrize
def test_streaming_response_create_overload_3(self, client: Lithic) -> None:
with client.auth_rules.v2.with_streaming_response.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
program_level=True,
type="CONDITIONAL_BLOCK",
) as response:
@@ -650,7 +722,15 @@ class TestAsyncV2:
@parametrize
async def test_method_create_overload_1(self, async_client: AsyncLithic) -> None:
v2 = await async_client.auth_rules.v2.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
)
assert_matches_type(V2CreateResponse, v2, path=["response"])
@@ -678,7 +758,15 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
@parametrize
async def test_raw_response_create_overload_1(self, async_client: AsyncLithic) -> None:
response = await async_client.auth_rules.v2.with_raw_response.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
)
@@ -690,7 +778,15 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncLithic) -
@parametrize
async def test_streaming_response_create_overload_1(self, async_client: AsyncLithic) -> None:
async with async_client.auth_rules.v2.with_streaming_response.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
) as response:
assert not response.is_closed
@@ -705,7 +801,15 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncLit
async def test_method_create_overload_2(self, async_client: AsyncLithic) -> None:
v2 = await async_client.auth_rules.v2.create(
card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
)
assert_matches_type(V2CreateResponse, v2, path=["response"])
@@ -733,7 +837,15 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
async def test_raw_response_create_overload_2(self, async_client: AsyncLithic) -> None:
response = await async_client.auth_rules.v2.with_raw_response.create(
card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
)
@@ -746,7 +858,15 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncLithic) -
async def test_streaming_response_create_overload_2(self, async_client: AsyncLithic) -> None:
async with async_client.auth_rules.v2.with_streaming_response.create(
card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
type="CONDITIONAL_BLOCK",
) as response:
assert not response.is_closed
@@ -760,7 +880,15 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncLit
@parametrize
async def test_method_create_overload_3(self, async_client: AsyncLithic) -> None:
v2 = await async_client.auth_rules.v2.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
program_level=True,
type="CONDITIONAL_BLOCK",
)
@@ -789,7 +917,15 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn
@parametrize
async def test_raw_response_create_overload_3(self, async_client: AsyncLithic) -> None:
response = await async_client.auth_rules.v2.with_raw_response.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
program_level=True,
type="CONDITIONAL_BLOCK",
)
@@ -802,7 +938,15 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncLithic) -
@parametrize
async def test_streaming_response_create_overload_3(self, async_client: AsyncLithic) -> None:
async with async_client.auth_rules.v2.with_streaming_response.create(
- parameters={"conditions": [{}]},
+ parameters={
+ "conditions": [
+ {
+ "attribute": "MCC",
+ "operation": "IS_ONE_OF",
+ "value": "string",
+ }
+ ]
+ },
program_level=True,
type="CONDITIONAL_BLOCK",
) as response:
diff --git a/tests/api_resources/test_disputes.py b/tests/api_resources/test_disputes.py
index 595dfa6d..28821e5c 100644
--- a/tests/api_resources/test_disputes.py
+++ b/tests/api_resources/test_disputes.py
@@ -10,12 +10,8 @@
from lithic import Lithic, AsyncLithic
from tests.utils import assert_matches_type
from lithic.types import (
+ Dispute,
DisputeEvidence,
- DisputeListResponse,
- DisputeCreateResponse,
- DisputeDeleteResponse,
- DisputeUpdateResponse,
- DisputeRetrieveResponse,
)
from lithic._utils import parse_datetime
from lithic.pagination import SyncCursorPage, AsyncCursorPage
@@ -33,7 +29,7 @@ def test_method_create(self, client: Lithic) -> None:
reason="FRAUD_CARD_PRESENT",
transaction_token="12345624-aa69-4cbc-a946-30d90181b621",
)
- assert_matches_type(DisputeCreateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Lithic) -> None:
@@ -44,7 +40,7 @@ def test_method_create_with_all_params(self, client: Lithic) -> None:
customer_filed_date=parse_datetime("2021-06-28T22:53:15Z"),
customer_note="customer_note",
)
- assert_matches_type(DisputeCreateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_raw_response_create(self, client: Lithic) -> None:
@@ -57,7 +53,7 @@ def test_raw_response_create(self, client: Lithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeCreateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Lithic) -> None:
@@ -70,7 +66,7 @@ def test_streaming_response_create(self, client: Lithic) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeCreateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -79,7 +75,7 @@ def test_method_retrieve(self, client: Lithic) -> None:
dispute = client.disputes.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DisputeRetrieveResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_raw_response_retrieve(self, client: Lithic) -> None:
@@ -90,7 +86,7 @@ def test_raw_response_retrieve(self, client: Lithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeRetrieveResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_streaming_response_retrieve(self, client: Lithic) -> None:
@@ -101,7 +97,7 @@ def test_streaming_response_retrieve(self, client: Lithic) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeRetrieveResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -117,7 +113,7 @@ def test_method_update(self, client: Lithic) -> None:
dispute = client.disputes.update(
dispute_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DisputeUpdateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Lithic) -> None:
@@ -128,7 +124,7 @@ def test_method_update_with_all_params(self, client: Lithic) -> None:
customer_note="customer_note",
reason="ATM_CASH_MISDISPENSE",
)
- assert_matches_type(DisputeUpdateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_raw_response_update(self, client: Lithic) -> None:
@@ -139,7 +135,7 @@ def test_raw_response_update(self, client: Lithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeUpdateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Lithic) -> None:
@@ -150,7 +146,7 @@ def test_streaming_response_update(self, client: Lithic) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeUpdateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -164,7 +160,7 @@ def test_path_params_update(self, client: Lithic) -> None:
@parametrize
def test_method_list(self, client: Lithic) -> None:
dispute = client.disputes.list()
- assert_matches_type(SyncCursorPage[DisputeListResponse], dispute, path=["response"])
+ assert_matches_type(SyncCursorPage[Dispute], dispute, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Lithic) -> None:
@@ -177,7 +173,7 @@ def test_method_list_with_all_params(self, client: Lithic) -> None:
status="ARBITRATION",
transaction_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
- assert_matches_type(SyncCursorPage[DisputeListResponse], dispute, path=["response"])
+ assert_matches_type(SyncCursorPage[Dispute], dispute, path=["response"])
@parametrize
def test_raw_response_list(self, client: Lithic) -> None:
@@ -186,7 +182,7 @@ def test_raw_response_list(self, client: Lithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(SyncCursorPage[DisputeListResponse], dispute, path=["response"])
+ assert_matches_type(SyncCursorPage[Dispute], dispute, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Lithic) -> None:
@@ -195,7 +191,7 @@ def test_streaming_response_list(self, client: Lithic) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(SyncCursorPage[DisputeListResponse], dispute, path=["response"])
+ assert_matches_type(SyncCursorPage[Dispute], dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -204,7 +200,7 @@ def test_method_delete(self, client: Lithic) -> None:
dispute = client.disputes.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DisputeDeleteResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Lithic) -> None:
@@ -215,7 +211,7 @@ def test_raw_response_delete(self, client: Lithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeDeleteResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
def test_streaming_response_delete(self, client: Lithic) -> None:
@@ -226,7 +222,7 @@ def test_streaming_response_delete(self, client: Lithic) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeDeleteResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -442,7 +438,7 @@ async def test_method_create(self, async_client: AsyncLithic) -> None:
reason="FRAUD_CARD_PRESENT",
transaction_token="12345624-aa69-4cbc-a946-30d90181b621",
)
- assert_matches_type(DisputeCreateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncLithic) -> None:
@@ -453,7 +449,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) ->
customer_filed_date=parse_datetime("2021-06-28T22:53:15Z"),
customer_note="customer_note",
)
- assert_matches_type(DisputeCreateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncLithic) -> None:
@@ -466,7 +462,7 @@ async def test_raw_response_create(self, async_client: AsyncLithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeCreateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncLithic) -> None:
@@ -479,7 +475,7 @@ async def test_streaming_response_create(self, async_client: AsyncLithic) -> Non
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = await response.parse()
- assert_matches_type(DisputeCreateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -488,7 +484,7 @@ async def test_method_retrieve(self, async_client: AsyncLithic) -> None:
dispute = await async_client.disputes.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DisputeRetrieveResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
@@ -499,7 +495,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeRetrieveResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> None:
@@ -510,7 +506,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = await response.parse()
- assert_matches_type(DisputeRetrieveResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -526,7 +522,7 @@ async def test_method_update(self, async_client: AsyncLithic) -> None:
dispute = await async_client.disputes.update(
dispute_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DisputeUpdateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncLithic) -> None:
@@ -537,7 +533,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncLithic) ->
customer_note="customer_note",
reason="ATM_CASH_MISDISPENSE",
)
- assert_matches_type(DisputeUpdateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncLithic) -> None:
@@ -548,7 +544,7 @@ async def test_raw_response_update(self, async_client: AsyncLithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeUpdateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncLithic) -> None:
@@ -559,7 +555,7 @@ async def test_streaming_response_update(self, async_client: AsyncLithic) -> Non
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = await response.parse()
- assert_matches_type(DisputeUpdateResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -573,7 +569,7 @@ async def test_path_params_update(self, async_client: AsyncLithic) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncLithic) -> None:
dispute = await async_client.disputes.list()
- assert_matches_type(AsyncCursorPage[DisputeListResponse], dispute, path=["response"])
+ assert_matches_type(AsyncCursorPage[Dispute], dispute, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> None:
@@ -586,7 +582,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> N
status="ARBITRATION",
transaction_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
- assert_matches_type(AsyncCursorPage[DisputeListResponse], dispute, path=["response"])
+ assert_matches_type(AsyncCursorPage[Dispute], dispute, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncLithic) -> None:
@@ -595,7 +591,7 @@ async def test_raw_response_list(self, async_client: AsyncLithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(AsyncCursorPage[DisputeListResponse], dispute, path=["response"])
+ assert_matches_type(AsyncCursorPage[Dispute], dispute, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncLithic) -> None:
@@ -604,7 +600,7 @@ async def test_streaming_response_list(self, async_client: AsyncLithic) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = await response.parse()
- assert_matches_type(AsyncCursorPage[DisputeListResponse], dispute, path=["response"])
+ assert_matches_type(AsyncCursorPage[Dispute], dispute, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -613,7 +609,7 @@ async def test_method_delete(self, async_client: AsyncLithic) -> None:
dispute = await async_client.disputes.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DisputeDeleteResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncLithic) -> None:
@@ -624,7 +620,7 @@ async def test_raw_response_delete(self, async_client: AsyncLithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = response.parse()
- assert_matches_type(DisputeDeleteResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncLithic) -> None:
@@ -635,7 +631,7 @@ async def test_streaming_response_delete(self, async_client: AsyncLithic) -> Non
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dispute = await response.parse()
- assert_matches_type(DisputeDeleteResponse, dispute, path=["response"])
+ assert_matches_type(Dispute, dispute, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_disputes_v2.py b/tests/api_resources/test_disputes_v2.py
new file mode 100644
index 00000000..31ff9d31
--- /dev/null
+++ b/tests/api_resources/test_disputes_v2.py
@@ -0,0 +1,180 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from lithic import Lithic, AsyncLithic
+from tests.utils import assert_matches_type
+from lithic.types import DisputeV2
+from lithic._utils import parse_datetime
+from lithic.pagination import SyncCursorPage, AsyncCursorPage
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestDisputesV2:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_retrieve(self, client: Lithic) -> None:
+ disputes_v2 = client.disputes_v2.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(DisputeV2, disputes_v2, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Lithic) -> None:
+ response = client.disputes_v2.with_raw_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ disputes_v2 = response.parse()
+ assert_matches_type(DisputeV2, disputes_v2, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Lithic) -> None:
+ with client.disputes_v2.with_streaming_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ disputes_v2 = response.parse()
+ assert_matches_type(DisputeV2, disputes_v2, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Lithic) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispute_token` but received ''"):
+ client.disputes_v2.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ def test_method_list(self, client: Lithic) -> None:
+ disputes_v2 = client.disputes_v2.list()
+ assert_matches_type(SyncCursorPage[DisputeV2], disputes_v2, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Lithic) -> None:
+ disputes_v2 = client.disputes_v2.list(
+ account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ begin=parse_datetime("2019-12-27T18:11:19.117Z"),
+ card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ disputed_transaction_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end=parse_datetime("2019-12-27T18:11:19.117Z"),
+ ending_before="ending_before",
+ page_size=1,
+ starting_after="starting_after",
+ )
+ assert_matches_type(SyncCursorPage[DisputeV2], disputes_v2, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Lithic) -> None:
+ response = client.disputes_v2.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ disputes_v2 = response.parse()
+ assert_matches_type(SyncCursorPage[DisputeV2], disputes_v2, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Lithic) -> None:
+ with client.disputes_v2.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ disputes_v2 = response.parse()
+ assert_matches_type(SyncCursorPage[DisputeV2], disputes_v2, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncDisputesV2:
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncLithic) -> None:
+ disputes_v2 = await async_client.disputes_v2.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(DisputeV2, disputes_v2, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
+ response = await async_client.disputes_v2.with_raw_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ disputes_v2 = response.parse()
+ assert_matches_type(DisputeV2, disputes_v2, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> None:
+ async with async_client.disputes_v2.with_streaming_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ disputes_v2 = await response.parse()
+ assert_matches_type(DisputeV2, disputes_v2, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncLithic) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispute_token` but received ''"):
+ await async_client.disputes_v2.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncLithic) -> None:
+ disputes_v2 = await async_client.disputes_v2.list()
+ assert_matches_type(AsyncCursorPage[DisputeV2], disputes_v2, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> None:
+ disputes_v2 = await async_client.disputes_v2.list(
+ account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ begin=parse_datetime("2019-12-27T18:11:19.117Z"),
+ card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ disputed_transaction_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ end=parse_datetime("2019-12-27T18:11:19.117Z"),
+ ending_before="ending_before",
+ page_size=1,
+ starting_after="starting_after",
+ )
+ assert_matches_type(AsyncCursorPage[DisputeV2], disputes_v2, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncLithic) -> None:
+ response = await async_client.disputes_v2.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ disputes_v2 = response.parse()
+ assert_matches_type(AsyncCursorPage[DisputeV2], disputes_v2, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncLithic) -> None:
+ async with async_client.disputes_v2.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ disputes_v2 = await response.parse()
+ assert_matches_type(AsyncCursorPage[DisputeV2], disputes_v2, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_external_bank_accounts.py b/tests/api_resources/test_external_bank_accounts.py
index 5b7ae910..809bafe2 100644
--- a/tests/api_resources/test_external_bank_accounts.py
+++ b/tests/api_resources/test_external_bank_accounts.py
@@ -13,6 +13,7 @@
ExternalBankAccountListResponse,
ExternalBankAccountCreateResponse,
ExternalBankAccountUpdateResponse,
+ ExternalBankAccountUnpauseResponse,
ExternalBankAccountRetrieveResponse,
ExternalBankAccountRetryPrenoteResponse,
ExternalBankAccountRetryMicroDepositsResponse,
@@ -512,6 +513,46 @@ def test_path_params_retry_prenote(self, client: Lithic) -> None:
external_bank_account_token="",
)
+ @parametrize
+ def test_method_unpause(self, client: Lithic) -> None:
+ external_bank_account = client.external_bank_accounts.unpause(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ExternalBankAccountUnpauseResponse, external_bank_account, path=["response"])
+
+ @parametrize
+ def test_raw_response_unpause(self, client: Lithic) -> None:
+ response = client.external_bank_accounts.with_raw_response.unpause(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ external_bank_account = response.parse()
+ assert_matches_type(ExternalBankAccountUnpauseResponse, external_bank_account, path=["response"])
+
+ @parametrize
+ def test_streaming_response_unpause(self, client: Lithic) -> None:
+ with client.external_bank_accounts.with_streaming_response.unpause(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ external_bank_account = response.parse()
+ assert_matches_type(ExternalBankAccountUnpauseResponse, external_bank_account, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_unpause(self, client: Lithic) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `external_bank_account_token` but received ''"
+ ):
+ client.external_bank_accounts.with_raw_response.unpause(
+ "",
+ )
+
class TestAsyncExternalBankAccounts:
parametrize = pytest.mark.parametrize(
@@ -1003,3 +1044,43 @@ async def test_path_params_retry_prenote(self, async_client: AsyncLithic) -> Non
await async_client.external_bank_accounts.with_raw_response.retry_prenote(
external_bank_account_token="",
)
+
+ @parametrize
+ async def test_method_unpause(self, async_client: AsyncLithic) -> None:
+ external_bank_account = await async_client.external_bank_accounts.unpause(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ExternalBankAccountUnpauseResponse, external_bank_account, path=["response"])
+
+ @parametrize
+ async def test_raw_response_unpause(self, async_client: AsyncLithic) -> None:
+ response = await async_client.external_bank_accounts.with_raw_response.unpause(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ external_bank_account = response.parse()
+ assert_matches_type(ExternalBankAccountUnpauseResponse, external_bank_account, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_unpause(self, async_client: AsyncLithic) -> None:
+ async with async_client.external_bank_accounts.with_streaming_response.unpause(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ external_bank_account = await response.parse()
+ assert_matches_type(ExternalBankAccountUnpauseResponse, external_bank_account, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_unpause(self, async_client: AsyncLithic) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `external_bank_account_token` but received ''"
+ ):
+ await async_client.external_bank_accounts.with_raw_response.unpause(
+ "",
+ )
diff --git a/tests/api_resources/test_payments.py b/tests/api_resources/test_payments.py
index 1801c86f..81c77f2a 100644
--- a/tests/api_resources/test_payments.py
+++ b/tests/api_resources/test_payments.py
@@ -13,6 +13,7 @@
Payment,
PaymentRetryResponse,
PaymentCreateResponse,
+ PaymentReturnResponse,
PaymentSimulateActionResponse,
PaymentSimulateReturnResponse,
PaymentSimulateReceiptResponse,
@@ -209,6 +210,64 @@ def test_path_params_retry(self, client: Lithic) -> None:
"",
)
+ @parametrize
+ def test_method_return(self, client: Lithic) -> None:
+ payment = client.payments.return_(
+ payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ )
+ assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+
+ @parametrize
+ def test_method_return_with_all_params(self, client: Lithic) -> None:
+ payment = client.payments.return_(
+ payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ addenda="addenda",
+ date_of_death=parse_date("2025-01-15"),
+ memo="memo",
+ )
+ assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+
+ @parametrize
+ def test_raw_response_return(self, client: Lithic) -> None:
+ response = client.payments.with_raw_response.return_(
+ payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ payment = response.parse()
+ assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+
+ @parametrize
+ def test_streaming_response_return(self, client: Lithic) -> None:
+ with client.payments.with_streaming_response.return_(
+ payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ payment = response.parse()
+ assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_return(self, client: Lithic) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `payment_token` but received ''"):
+ client.payments.with_raw_response.return_(
+ payment_token="",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ )
+
@parametrize
def test_method_simulate_action(self, client: Lithic) -> None:
payment = client.payments.simulate_action(
@@ -572,6 +631,64 @@ async def test_path_params_retry(self, async_client: AsyncLithic) -> None:
"",
)
+ @parametrize
+ async def test_method_return(self, async_client: AsyncLithic) -> None:
+ payment = await async_client.payments.return_(
+ payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ )
+ assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+
+ @parametrize
+ async def test_method_return_with_all_params(self, async_client: AsyncLithic) -> None:
+ payment = await async_client.payments.return_(
+ payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ addenda="addenda",
+ date_of_death=parse_date("2025-01-15"),
+ memo="memo",
+ )
+ assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+
+ @parametrize
+ async def test_raw_response_return(self, async_client: AsyncLithic) -> None:
+ response = await async_client.payments.with_raw_response.return_(
+ payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ payment = response.parse()
+ assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_return(self, async_client: AsyncLithic) -> None:
+ async with async_client.payments.with_streaming_response.return_(
+ payment_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ payment = await response.parse()
+ assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_return(self, async_client: AsyncLithic) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `payment_token` but received ''"):
+ await async_client.payments.with_raw_response.return_(
+ payment_token="",
+ financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ return_reason_code="R01",
+ )
+
@parametrize
async def test_method_simulate_action(self, async_client: AsyncLithic) -> None:
payment = await async_client.payments.simulate_action(
From 8408ced534e41f25de0b62aa8f6ca0735001994a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 20 Nov 2025 13:27:48 +0000
Subject: [PATCH 2/3] fix(api): Modify return type of returns API to
payment-transaction feat(api): Add Payoff Details
---
.stats.yml | 4 +-
api.md | 3 +-
src/lithic/resources/payments.py | 9 ++--
src/lithic/types/__init__.py | 1 -
.../types/financial_accounts/statement.py | 41 ++++++++++++++++++-
src/lithic/types/payment_return_response.py | 18 --------
tests/api_resources/test_payments.py | 17 ++++----
7 files changed, 55 insertions(+), 38 deletions(-)
delete mode 100644 src/lithic/types/payment_return_response.py
diff --git a/.stats.yml b/.stats.yml
index f47fe045..2ec777a4 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 171
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-e1901db484e520cc1f6aa88c8b00d0fcda30c8f9e5ea562a12b9edfc3fb3b6d6.yml
-openapi_spec_hash: 59c317749628f3ed4cc7911b68f6351f
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-9791980619fc7ce8afb01f77dfe3c660a540975327378287cb666136ae4b0a99.yml
+openapi_spec_hash: 0752074b2a7b0534329a1e3176c94a62
config_hash: aab05d0cf41f1f6b9f4d5677273c1600
diff --git a/api.md b/api.md
index 3916b5e8..41ec2abd 100644
--- a/api.md
+++ b/api.md
@@ -563,7 +563,6 @@ from lithic.types import (
Payment,
PaymentCreateResponse,
PaymentRetryResponse,
- PaymentReturnResponse,
PaymentSimulateActionResponse,
PaymentSimulateReceiptResponse,
PaymentSimulateReleaseResponse,
@@ -577,7 +576,7 @@ Methods:
- client.payments.retrieve(payment_token) -> Payment
- client.payments.list(\*\*params) -> SyncCursorPage[Payment]
- client.payments.retry(payment_token) -> PaymentRetryResponse
-- client.payments.return\_(payment_token, \*\*params) -> PaymentReturnResponse
+- client.payments.return\_(payment_token, \*\*params) -> Payment
- client.payments.simulate_action(payment_token, \*\*params) -> PaymentSimulateActionResponse
- client.payments.simulate_receipt(\*\*params) -> PaymentSimulateReceiptResponse
- client.payments.simulate_release(\*\*params) -> PaymentSimulateReleaseResponse
diff --git a/src/lithic/resources/payments.py b/src/lithic/resources/payments.py
index 73e0fed0..59d0d978 100644
--- a/src/lithic/resources/payments.py
+++ b/src/lithic/resources/payments.py
@@ -28,7 +28,6 @@
from ..types.payment import Payment
from ..types.payment_retry_response import PaymentRetryResponse
from ..types.payment_create_response import PaymentCreateResponse
-from ..types.payment_return_response import PaymentReturnResponse
from ..types.payment_simulate_action_response import PaymentSimulateActionResponse
from ..types.payment_simulate_return_response import PaymentSimulateReturnResponse
from ..types.payment_simulate_receipt_response import PaymentSimulateReceiptResponse
@@ -269,7 +268,7 @@ def return_(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> PaymentReturnResponse:
+ ) -> Payment:
"""Return an ACH payment with a specified return reason code.
Returns must be
@@ -328,7 +327,7 @@ def return_(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=PaymentReturnResponse,
+ cast_to=Payment,
)
def simulate_action(
@@ -769,7 +768,7 @@ async def return_(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> PaymentReturnResponse:
+ ) -> Payment:
"""Return an ACH payment with a specified return reason code.
Returns must be
@@ -828,7 +827,7 @@ async def return_(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=PaymentReturnResponse,
+ cast_to=Payment,
)
async def simulate_action(
diff --git a/src/lithic/types/__init__.py b/src/lithic/types/__init__.py
index 3597c644..af857e3b 100644
--- a/src/lithic/types/__init__.py
+++ b/src/lithic/types/__init__.py
@@ -80,7 +80,6 @@
from .card_provision_response import CardProvisionResponse as CardProvisionResponse
from .disputes_v2_list_params import DisputesV2ListParams as DisputesV2ListParams
from .payment_create_response import PaymentCreateResponse as PaymentCreateResponse
-from .payment_return_response import PaymentReturnResponse as PaymentReturnResponse
from .transaction_list_params import TransactionListParams as TransactionListParams
from .card_program_list_params import CardProgramListParams as CardProgramListParams
from .tokenization_list_params import TokenizationListParams as TokenizationListParams
diff --git a/src/lithic/types/financial_accounts/statement.py b/src/lithic/types/financial_accounts/statement.py
index 246a3801..18909ea1 100644
--- a/src/lithic/types/financial_accounts/statement.py
+++ b/src/lithic/types/financial_accounts/statement.py
@@ -8,7 +8,14 @@
from ..category_details import CategoryDetails
from ..statement_totals import StatementTotals
-__all__ = ["Statement", "AccountStanding", "AccountStandingFinancialAccountState", "AmountDue", "InterestDetails"]
+__all__ = [
+ "Statement",
+ "AccountStanding",
+ "AccountStandingFinancialAccountState",
+ "AmountDue",
+ "InterestDetails",
+ "PayoffDetails",
+]
class AccountStandingFinancialAccountState(BaseModel):
@@ -75,6 +82,35 @@ class InterestDetails(BaseModel):
minimum_interest_charged: Optional[int] = None
+class PayoffDetails(BaseModel):
+ minimum_payment_months: str
+ """
+ The number of months it would take to pay off the balance in full by only paying
+ the minimum payment. "NA" will signal negative or zero amortization
+ """
+
+ minimum_payment_total: str
+ """
+ The sum of all interest and principal paid, in cents, when only paying minimum
+ monthly payment. "NA" will signal negative or zero amortization
+ """
+
+ payoff_period_length_months: int
+ """Number of months to full pay off"""
+
+ payoff_period_monthly_payment_amount: int
+ """
+ The amount needed to be paid, in cents, each month in order to pay off current
+ balance in the payoff period
+ """
+
+ payoff_period_payment_total: int
+ """
+ The sum of all interest and principal paid, in cents, when paying off in the
+ payoff period
+ """
+
+
class Statement(BaseModel):
token: str
"""Globally unique identifier for a statement"""
@@ -135,3 +171,6 @@ class Statement(BaseModel):
next_statement_end_date: Optional[date] = None
"""Date when the next billing period will end"""
+
+ payoff_details: Optional[PayoffDetails] = None
+ """Details on number and size of payments to pay off balance"""
diff --git a/src/lithic/types/payment_return_response.py b/src/lithic/types/payment_return_response.py
deleted file mode 100644
index 3efce5dc..00000000
--- a/src/lithic/types/payment_return_response.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["PaymentReturnResponse"]
-
-
-class PaymentReturnResponse(BaseModel):
- result: Literal["APPROVED", "DECLINED"]
- """Transaction result"""
-
- transaction_group_uuid: str
- """Globally unique identifier for the transaction group"""
-
- transaction_uuid: str
- """Globally unique identifier for the transaction"""
diff --git a/tests/api_resources/test_payments.py b/tests/api_resources/test_payments.py
index 81c77f2a..8eea30e8 100644
--- a/tests/api_resources/test_payments.py
+++ b/tests/api_resources/test_payments.py
@@ -13,7 +13,6 @@
Payment,
PaymentRetryResponse,
PaymentCreateResponse,
- PaymentReturnResponse,
PaymentSimulateActionResponse,
PaymentSimulateReturnResponse,
PaymentSimulateReceiptResponse,
@@ -217,7 +216,7 @@ def test_method_return(self, client: Lithic) -> None:
financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
return_reason_code="R01",
)
- assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+ assert_matches_type(Payment, payment, path=["response"])
@parametrize
def test_method_return_with_all_params(self, client: Lithic) -> None:
@@ -229,7 +228,7 @@ def test_method_return_with_all_params(self, client: Lithic) -> None:
date_of_death=parse_date("2025-01-15"),
memo="memo",
)
- assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+ assert_matches_type(Payment, payment, path=["response"])
@parametrize
def test_raw_response_return(self, client: Lithic) -> None:
@@ -242,7 +241,7 @@ def test_raw_response_return(self, client: Lithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
payment = response.parse()
- assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+ assert_matches_type(Payment, payment, path=["response"])
@parametrize
def test_streaming_response_return(self, client: Lithic) -> None:
@@ -255,7 +254,7 @@ def test_streaming_response_return(self, client: Lithic) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
payment = response.parse()
- assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+ assert_matches_type(Payment, payment, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -638,7 +637,7 @@ async def test_method_return(self, async_client: AsyncLithic) -> None:
financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
return_reason_code="R01",
)
- assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+ assert_matches_type(Payment, payment, path=["response"])
@parametrize
async def test_method_return_with_all_params(self, async_client: AsyncLithic) -> None:
@@ -650,7 +649,7 @@ async def test_method_return_with_all_params(self, async_client: AsyncLithic) ->
date_of_death=parse_date("2025-01-15"),
memo="memo",
)
- assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+ assert_matches_type(Payment, payment, path=["response"])
@parametrize
async def test_raw_response_return(self, async_client: AsyncLithic) -> None:
@@ -663,7 +662,7 @@ async def test_raw_response_return(self, async_client: AsyncLithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
payment = response.parse()
- assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+ assert_matches_type(Payment, payment, path=["response"])
@parametrize
async def test_streaming_response_return(self, async_client: AsyncLithic) -> None:
@@ -676,7 +675,7 @@ async def test_streaming_response_return(self, async_client: AsyncLithic) -> Non
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
payment = await response.parse()
- assert_matches_type(PaymentReturnResponse, payment, path=["response"])
+ assert_matches_type(Payment, payment, path=["response"])
assert cast(Any, response.is_closed) is True
From 07fe1a5ddcb0ca36d86a4436980b00be82b33b88 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 20 Nov 2025 13:28:24 +0000
Subject: [PATCH 3/3] release: 0.111.0
---
.release-please-manifest.json | 2 +-
CHANGELOG.md | 20 ++++++++++++++++++++
pyproject.toml | 2 +-
src/lithic/_version.py | 2 +-
4 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 2b2e8e43..2969a756 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.110.1"
+ ".": "0.111.0"
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 03ff936b..b9aa57e1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,25 @@
# Changelog
+## 0.111.0 (2025-11-20)
+
+Full Changelog: [v0.110.1...v0.111.0](https://github.com/lithic-com/lithic-python/compare/v0.110.1...v0.111.0)
+
+### Features
+
+* **api:** add disputes V2 endpoints ([a346176](https://github.com/lithic-com/lithic-python/commit/a3461767eaf97aa5b10dd356513a401644599722))
+* **api:** Add Payoff Details ([8408ced](https://github.com/lithic-com/lithic-python/commit/8408ced534e41f25de0b62aa8f6ca0735001994a))
+* **api:** add return payment method ([a346176](https://github.com/lithic-com/lithic-python/commit/a3461767eaf97aa5b10dd356513a401644599722))
+* **api:** add Tokenization and ACH Rules ([a346176](https://github.com/lithic-com/lithic-python/commit/a3461767eaf97aa5b10dd356513a401644599722))
+* **api:** add unpause external_bank_accounts API method ([a346176](https://github.com/lithic-com/lithic-python/commit/a3461767eaf97aa5b10dd356513a401644599722))
+* **api:** extract some common schemas into models ([a346176](https://github.com/lithic-com/lithic-python/commit/a3461767eaf97aa5b10dd356513a401644599722))
+
+
+### Bug Fixes
+
+* **api:** change allowed phone number length from 18 to 16 ([a346176](https://github.com/lithic-com/lithic-python/commit/a3461767eaf97aa5b10dd356513a401644599722))
+* **api:** mark certain optional fields as nullable ([a346176](https://github.com/lithic-com/lithic-python/commit/a3461767eaf97aa5b10dd356513a401644599722))
+* **api:** Modify return type of returns API to payment-transaction ([8408ced](https://github.com/lithic-com/lithic-python/commit/8408ced534e41f25de0b62aa8f6ca0735001994a))
+
## 0.110.1 (2025-11-11)
Full Changelog: [v0.110.0...v0.110.1](https://github.com/lithic-com/lithic-python/compare/v0.110.0...v0.110.1)
diff --git a/pyproject.toml b/pyproject.toml
index 8e3ce78c..c3caf279 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "lithic"
-version = "0.110.1"
+version = "0.111.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 3f970bbd..327f369c 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.110.1" # x-release-please-version
+__version__ = "0.111.0" # x-release-please-version