Skip to content

Commit 3bcc997

Browse files
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
1 parent 8e707f7 commit 3bcc997

File tree

73 files changed

+2770
-1647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2770
-1647
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 167
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c3f6c23018d70fd1b259b21cfd377b5d905872f0d3c5ce2cdb8013f4b6daa338.yml
3-
openapi_spec_hash: b551344da9d29eb4c5374874ed84a9b0
4-
config_hash: 012f050e575d1bbfe8db56a9eeaa5fcd
1+
configured_endpoints: 171
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-e1901db484e520cc1f6aa88c8b00d0fcda30c8f9e5ea562a12b9edfc3fb3b6d6.yml
3+
openapi_spec_hash: 59c317749628f3ed4cc7911b68f6351f
4+
config_hash: aab05d0cf41f1f6b9f4d5677273c1600

api.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ from lithic.types import (
77
Carrier,
88
Currency,
99
Document,
10+
FinancialEvent,
1011
InstanceFinancialAccountType,
12+
Merchant,
1113
ShippingAddress,
1214
)
1315
```
@@ -82,9 +84,13 @@ from lithic.types.auth_rules import (
8284
AuthRule,
8385
AuthRuleCondition,
8486
Conditional3DSActionParameters,
87+
ConditionalACHActionParameters,
8588
ConditionalAttribute,
8689
ConditionalAuthorizationActionParameters,
8790
ConditionalBlockParameters,
91+
ConditionalOperation,
92+
ConditionalTokenizationActionParameters,
93+
ConditionalValue,
8894
MerchantLockParameters,
8995
RuleStats,
9096
VelocityLimitParams,
@@ -269,30 +275,35 @@ Methods:
269275
Types:
270276

271277
```python
272-
from lithic.types import (
273-
Dispute,
274-
DisputeEvidence,
275-
DisputeCreateResponse,
276-
DisputeRetrieveResponse,
277-
DisputeUpdateResponse,
278-
DisputeListResponse,
279-
DisputeDeleteResponse,
280-
)
278+
from lithic.types import Dispute, DisputeEvidence
281279
```
282280

283281
Methods:
284282

285-
- <code title="post /v1/disputes">client.disputes.<a href="./src/lithic/resources/disputes.py">create</a>(\*\*<a href="src/lithic/types/dispute_create_params.py">params</a>) -> <a href="./src/lithic/types/dispute_create_response.py">DisputeCreateResponse</a></code>
286-
- <code title="get /v1/disputes/{dispute_token}">client.disputes.<a href="./src/lithic/resources/disputes.py">retrieve</a>(dispute_token) -> <a href="./src/lithic/types/dispute_retrieve_response.py">DisputeRetrieveResponse</a></code>
287-
- <code title="patch /v1/disputes/{dispute_token}">client.disputes.<a href="./src/lithic/resources/disputes.py">update</a>(dispute_token, \*\*<a href="src/lithic/types/dispute_update_params.py">params</a>) -> <a href="./src/lithic/types/dispute_update_response.py">DisputeUpdateResponse</a></code>
288-
- <code title="get /v1/disputes">client.disputes.<a href="./src/lithic/resources/disputes.py">list</a>(\*\*<a href="src/lithic/types/dispute_list_params.py">params</a>) -> <a href="./src/lithic/types/dispute_list_response.py">SyncCursorPage[DisputeListResponse]</a></code>
289-
- <code title="delete /v1/disputes/{dispute_token}">client.disputes.<a href="./src/lithic/resources/disputes.py">delete</a>(dispute_token) -> <a href="./src/lithic/types/dispute_delete_response.py">DisputeDeleteResponse</a></code>
283+
- <code title="post /v1/disputes">client.disputes.<a href="./src/lithic/resources/disputes.py">create</a>(\*\*<a href="src/lithic/types/dispute_create_params.py">params</a>) -> <a href="./src/lithic/types/dispute.py">Dispute</a></code>
284+
- <code title="get /v1/disputes/{dispute_token}">client.disputes.<a href="./src/lithic/resources/disputes.py">retrieve</a>(dispute_token) -> <a href="./src/lithic/types/dispute.py">Dispute</a></code>
285+
- <code title="patch /v1/disputes/{dispute_token}">client.disputes.<a href="./src/lithic/resources/disputes.py">update</a>(dispute_token, \*\*<a href="src/lithic/types/dispute_update_params.py">params</a>) -> <a href="./src/lithic/types/dispute.py">Dispute</a></code>
286+
- <code title="get /v1/disputes">client.disputes.<a href="./src/lithic/resources/disputes.py">list</a>(\*\*<a href="src/lithic/types/dispute_list_params.py">params</a>) -> <a href="./src/lithic/types/dispute.py">SyncCursorPage[Dispute]</a></code>
287+
- <code title="delete /v1/disputes/{dispute_token}">client.disputes.<a href="./src/lithic/resources/disputes.py">delete</a>(dispute_token) -> <a href="./src/lithic/types/dispute.py">Dispute</a></code>
290288
- <code title="delete /v1/disputes/{dispute_token}/evidences/{evidence_token}">client.disputes.<a href="./src/lithic/resources/disputes.py">delete_evidence</a>(evidence_token, \*, dispute_token) -> <a href="./src/lithic/types/dispute_evidence.py">DisputeEvidence</a></code>
291289
- <code title="post /v1/disputes/{dispute_token}/evidences">client.disputes.<a href="./src/lithic/resources/disputes.py">initiate_evidence_upload</a>(dispute_token, \*\*<a href="src/lithic/types/dispute_initiate_evidence_upload_params.py">params</a>) -> <a href="./src/lithic/types/dispute_evidence.py">DisputeEvidence</a></code>
292290
- <code title="get /v1/disputes/{dispute_token}/evidences">client.disputes.<a href="./src/lithic/resources/disputes.py">list_evidences</a>(dispute_token, \*\*<a href="src/lithic/types/dispute_list_evidences_params.py">params</a>) -> <a href="./src/lithic/types/dispute_evidence.py">SyncCursorPage[DisputeEvidence]</a></code>
293291
- <code title="get /v1/disputes/{dispute_token}/evidences/{evidence_token}">client.disputes.<a href="./src/lithic/resources/disputes.py">retrieve_evidence</a>(evidence_token, \*, dispute_token) -> <a href="./src/lithic/types/dispute_evidence.py">DisputeEvidence</a></code>
294292
- <code>client.disputes.<a href="./src/lithic/resources/disputes.py">upload_evidence</a>(\*args) -> None</code>
295293

294+
# DisputesV2
295+
296+
Types:
297+
298+
```python
299+
from lithic.types import DisputeV2
300+
```
301+
302+
Methods:
303+
304+
- <code title="get /v2/disputes/{dispute_token}">client.disputes_v2.<a href="./src/lithic/resources/disputes_v2.py">retrieve</a>(dispute_token) -> <a href="./src/lithic/types/dispute_v2.py">DisputeV2</a></code>
305+
- <code title="get /v2/disputes">client.disputes_v2.<a href="./src/lithic/resources/disputes_v2.py">list</a>(\*\*<a href="src/lithic/types/disputes_v2_list_params.py">params</a>) -> <a href="./src/lithic/types/dispute_v2.py">SyncCursorPage[DisputeV2]</a></code>
306+
296307
# Events
297308

298309
Types:
@@ -341,7 +352,7 @@ Methods:
341352
Types:
342353

343354
```python
344-
from lithic.types import FinancialAccount, FinancialTransaction
355+
from lithic.types import CategoryDetails, FinancialAccount, FinancialTransaction, StatementTotals
345356
```
346357

347358
Methods:
@@ -415,7 +426,7 @@ Methods:
415426
Types:
416427

417428
```python
418-
from lithic.types.financial_accounts import LoanTape
429+
from lithic.types.financial_accounts import CategoryBalances, LoanTape
419430
```
420431

421432
Methods:
@@ -517,6 +528,7 @@ from lithic.types import (
517528
ExternalBankAccountListResponse,
518529
ExternalBankAccountRetryMicroDepositsResponse,
519530
ExternalBankAccountRetryPrenoteResponse,
531+
ExternalBankAccountUnpauseResponse,
520532
)
521533
```
522534

@@ -528,6 +540,7 @@ Methods:
528540
- <code title="get /v1/external_bank_accounts">client.external_bank_accounts.<a href="./src/lithic/resources/external_bank_accounts/external_bank_accounts.py">list</a>(\*\*<a href="src/lithic/types/external_bank_account_list_params.py">params</a>) -> <a href="./src/lithic/types/external_bank_account_list_response.py">SyncCursorPage[ExternalBankAccountListResponse]</a></code>
529541
- <code title="post /v1/external_bank_accounts/{external_bank_account_token}/retry_micro_deposits">client.external_bank_accounts.<a href="./src/lithic/resources/external_bank_accounts/external_bank_accounts.py">retry_micro_deposits</a>(external_bank_account_token, \*\*<a href="src/lithic/types/external_bank_account_retry_micro_deposits_params.py">params</a>) -> <a href="./src/lithic/types/external_bank_account_retry_micro_deposits_response.py">ExternalBankAccountRetryMicroDepositsResponse</a></code>
530542
- <code title="post /v1/external_bank_accounts/{external_bank_account_token}/retry_prenote">client.external_bank_accounts.<a href="./src/lithic/resources/external_bank_accounts/external_bank_accounts.py">retry_prenote</a>(external_bank_account_token, \*\*<a href="src/lithic/types/external_bank_account_retry_prenote_params.py">params</a>) -> <a href="./src/lithic/types/external_bank_account_retry_prenote_response.py">ExternalBankAccountRetryPrenoteResponse</a></code>
543+
- <code title="post /v1/external_bank_accounts/{external_bank_account_token}/unpause">client.external_bank_accounts.<a href="./src/lithic/resources/external_bank_accounts/external_bank_accounts.py">unpause</a>(external_bank_account_token) -> <a href="./src/lithic/types/external_bank_account_unpause_response.py">ExternalBankAccountUnpauseResponse</a></code>
531544

532545
## MicroDeposits
533546

@@ -550,6 +563,7 @@ from lithic.types import (
550563
Payment,
551564
PaymentCreateResponse,
552565
PaymentRetryResponse,
566+
PaymentReturnResponse,
553567
PaymentSimulateActionResponse,
554568
PaymentSimulateReceiptResponse,
555569
PaymentSimulateReleaseResponse,
@@ -563,6 +577,7 @@ Methods:
563577
- <code title="get /v1/payments/{payment_token}">client.payments.<a href="./src/lithic/resources/payments.py">retrieve</a>(payment_token) -> <a href="./src/lithic/types/payment.py">Payment</a></code>
564578
- <code title="get /v1/payments">client.payments.<a href="./src/lithic/resources/payments.py">list</a>(\*\*<a href="src/lithic/types/payment_list_params.py">params</a>) -> <a href="./src/lithic/types/payment.py">SyncCursorPage[Payment]</a></code>
565579
- <code title="post /v1/payments/{payment_token}/retry">client.payments.<a href="./src/lithic/resources/payments.py">retry</a>(payment_token) -> <a href="./src/lithic/types/payment_retry_response.py">PaymentRetryResponse</a></code>
580+
- <code title="post /v1/payments/{payment_token}/return">client.payments.<a href="./src/lithic/resources/payments.py">return\_</a>(payment_token, \*\*<a href="src/lithic/types/payment_return_params.py">params</a>) -> <a href="./src/lithic/types/payment_return_response.py">PaymentReturnResponse</a></code>
566581
- <code title="post /v1/simulate/payments/{payment_token}/action">client.payments.<a href="./src/lithic/resources/payments.py">simulate_action</a>(payment_token, \*\*<a href="src/lithic/types/payment_simulate_action_params.py">params</a>) -> <a href="./src/lithic/types/payment_simulate_action_response.py">PaymentSimulateActionResponse</a></code>
567582
- <code title="post /v1/simulate/payments/receipt">client.payments.<a href="./src/lithic/resources/payments.py">simulate_receipt</a>(\*\*<a href="src/lithic/types/payment_simulate_receipt_params.py">params</a>) -> <a href="./src/lithic/types/payment_simulate_receipt_response.py">PaymentSimulateReceiptResponse</a></code>
568583
- <code title="post /v1/simulate/payments/release">client.payments.<a href="./src/lithic/resources/payments.py">simulate_release</a>(\*\*<a href="src/lithic/types/payment_simulate_release_params.py">params</a>) -> <a href="./src/lithic/types/payment_simulate_release_response.py">PaymentSimulateReleaseResponse</a></code>

examples/upload_evidence.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# 1. Install Rye and setup a Python virtual environment: ./scripts/bootstrap
77
# 2. Run the example: LITHIC_API_KEY=<your_api_key> rye run python examples/upload_evidence.py
88
from lithic import Lithic, file_from_path
9-
from lithic.types import DisputeListResponse, DisputeCreateResponse
9+
from lithic.types import Dispute
1010

1111
client = Lithic(environment="sandbox")
1212

@@ -17,7 +17,7 @@
1717
assert transaction.token, "Transaction must have a token"
1818

1919
disputes_page = client.disputes.list()
20-
dispute: DisputeCreateResponse | DisputeListResponse | None = disputes_page.data[0] if disputes_page.data else None
20+
dispute: Dispute | None = disputes_page.data[0] if disputes_page.data else None
2121
if not dispute:
2222
dispute = client.disputes.create(
2323
amount=42,

src/lithic/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
three_ds,
5050
webhooks,
5151
auth_rules,
52+
disputes_v2,
5253
transactions,
5354
card_programs,
5455
tokenizations,
@@ -73,6 +74,7 @@
7374
from .resources.disputes import Disputes, AsyncDisputes
7475
from .resources.payments import Payments, AsyncPayments
7576
from .resources.cards.cards import Cards, AsyncCards
77+
from .resources.disputes_v2 import DisputesV2, AsyncDisputesV2
7678
from .resources.fraud.fraud import Fraud, AsyncFraud
7779
from .resources.card_programs import CardPrograms, AsyncCardPrograms
7880
from .resources.events.events import Events, AsyncEvents
@@ -262,6 +264,12 @@ def disputes(self) -> Disputes:
262264

263265
return Disputes(self)
264266

267+
@cached_property
268+
def disputes_v2(self) -> DisputesV2:
269+
from .resources.disputes_v2 import DisputesV2
270+
271+
return DisputesV2(self)
272+
265273
@cached_property
266274
def events(self) -> Events:
267275
from .resources.events import Events
@@ -660,6 +668,12 @@ def disputes(self) -> AsyncDisputes:
660668

661669
return AsyncDisputes(self)
662670

671+
@cached_property
672+
def disputes_v2(self) -> AsyncDisputesV2:
673+
from .resources.disputes_v2 import AsyncDisputesV2
674+
675+
return AsyncDisputesV2(self)
676+
663677
@cached_property
664678
def events(self) -> AsyncEvents:
665679
from .resources.events import AsyncEvents
@@ -981,6 +995,12 @@ def disputes(self) -> disputes.DisputesWithRawResponse:
981995

982996
return DisputesWithRawResponse(self._client.disputes)
983997

998+
@cached_property
999+
def disputes_v2(self) -> disputes_v2.DisputesV2WithRawResponse:
1000+
from .resources.disputes_v2 import DisputesV2WithRawResponse
1001+
1002+
return DisputesV2WithRawResponse(self._client.disputes_v2)
1003+
9841004
@cached_property
9851005
def events(self) -> events.EventsWithRawResponse:
9861006
from .resources.events import EventsWithRawResponse
@@ -1160,6 +1180,12 @@ def disputes(self) -> disputes.AsyncDisputesWithRawResponse:
11601180

11611181
return AsyncDisputesWithRawResponse(self._client.disputes)
11621182

1183+
@cached_property
1184+
def disputes_v2(self) -> disputes_v2.AsyncDisputesV2WithRawResponse:
1185+
from .resources.disputes_v2 import AsyncDisputesV2WithRawResponse
1186+
1187+
return AsyncDisputesV2WithRawResponse(self._client.disputes_v2)
1188+
11631189
@cached_property
11641190
def events(self) -> events.AsyncEventsWithRawResponse:
11651191
from .resources.events import AsyncEventsWithRawResponse
@@ -1339,6 +1365,12 @@ def disputes(self) -> disputes.DisputesWithStreamingResponse:
13391365

13401366
return DisputesWithStreamingResponse(self._client.disputes)
13411367

1368+
@cached_property
1369+
def disputes_v2(self) -> disputes_v2.DisputesV2WithStreamingResponse:
1370+
from .resources.disputes_v2 import DisputesV2WithStreamingResponse
1371+
1372+
return DisputesV2WithStreamingResponse(self._client.disputes_v2)
1373+
13421374
@cached_property
13431375
def events(self) -> events.EventsWithStreamingResponse:
13441376
from .resources.events import EventsWithStreamingResponse
@@ -1518,6 +1550,12 @@ def disputes(self) -> disputes.AsyncDisputesWithStreamingResponse:
15181550

15191551
return AsyncDisputesWithStreamingResponse(self._client.disputes)
15201552

1553+
@cached_property
1554+
def disputes_v2(self) -> disputes_v2.AsyncDisputesV2WithStreamingResponse:
1555+
from .resources.disputes_v2 import AsyncDisputesV2WithStreamingResponse
1556+
1557+
return AsyncDisputesV2WithStreamingResponse(self._client.disputes_v2)
1558+
15211559
@cached_property
15221560
def events(self) -> events.AsyncEventsWithStreamingResponse:
15231561
from .resources.events import AsyncEventsWithStreamingResponse

src/lithic/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@
8181
AuthRulesWithStreamingResponse,
8282
AsyncAuthRulesWithStreamingResponse,
8383
)
84+
from .disputes_v2 import (
85+
DisputesV2,
86+
AsyncDisputesV2,
87+
DisputesV2WithRawResponse,
88+
AsyncDisputesV2WithRawResponse,
89+
DisputesV2WithStreamingResponse,
90+
AsyncDisputesV2WithStreamingResponse,
91+
)
8492
from .transactions import (
8593
Transactions,
8694
AsyncTransactions,
@@ -287,6 +295,12 @@
287295
"AsyncDisputesWithRawResponse",
288296
"DisputesWithStreamingResponse",
289297
"AsyncDisputesWithStreamingResponse",
298+
"DisputesV2",
299+
"AsyncDisputesV2",
300+
"DisputesV2WithRawResponse",
301+
"AsyncDisputesV2WithRawResponse",
302+
"DisputesV2WithStreamingResponse",
303+
"AsyncDisputesV2WithStreamingResponse",
290304
"Events",
291305
"AsyncEvents",
292306
"EventsWithRawResponse",

0 commit comments

Comments
 (0)