Skip to content

Commit 8bb0722

Browse files
feat(api): add bulk card creation APIs
fix(api): extract several common types to reduce duplication
1 parent 29ae3a9 commit 8bb0722

Some content is hidden

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

51 files changed

+1538
-598
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: 171
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a9de2732e7a28b7fc5b8b7b171781d617337b6223d82ef7d6a554d0bd2b33bab.yml
3-
openapi_spec_hash: fc6111d286c7002cd854af23841d137e
4-
config_hash: f6f5c7f37033e89a3cf91a48371a718a
1+
configured_endpoints: 175
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-6d54fb5bba49d761acf9d62a7e105443a80a0d34dda61932ff1d1cb8fe214393.yml
3+
openapi_spec_hash: 20da53572fec9742df4a6d403464521b
4+
config_hash: ba3fbfc99a1b8635d9e79e9e49d12952

api.md

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,15 @@ Methods:
156156
Types:
157157

158158
```python
159-
from lithic.types import Tokenization
159+
from lithic.types import (
160+
Device,
161+
DigitalWalletTokenMetadata,
162+
Tokenization,
163+
TokenizationDeclineReason,
164+
TokenizationRuleResult,
165+
TokenizationTfaReason,
166+
WalletDecisioningInfo,
167+
)
160168
```
161169

162170
Methods:
@@ -219,15 +227,9 @@ Methods:
219227

220228
## Balances
221229

222-
Types:
223-
224-
```python
225-
from lithic.types.cards import BalanceListResponse
226-
```
227-
228230
Methods:
229231

230-
- <code title="get /v1/cards/{card_token}/balances">client.cards.balances.<a href="./src/lithic/resources/cards/balances.py">list</a>(card_token, \*\*<a href="src/lithic/types/cards/balance_list_params.py">params</a>) -> <a href="./src/lithic/types/cards/balance_list_response.py">SyncSinglePage[BalanceListResponse]</a></code>
232+
- <code title="get /v1/cards/{card_token}/balances">client.cards.balances.<a href="./src/lithic/resources/cards/balances.py">list</a>(card_token, \*\*<a href="src/lithic/types/cards/balance_list_params.py">params</a>) -> <a href="./src/lithic/types/financial_account_balance.py">SyncSinglePage[FinancialAccountBalance]</a></code>
231233

232234
## FinancialTransactions
233235

@@ -236,6 +238,21 @@ Methods:
236238
- <code title="get /v1/cards/{card_token}/financial_transactions/{financial_transaction_token}">client.cards.financial_transactions.<a href="./src/lithic/resources/cards/financial_transactions.py">retrieve</a>(financial_transaction_token, \*, card_token) -> <a href="./src/lithic/types/financial_transaction.py">FinancialTransaction</a></code>
237239
- <code title="get /v1/cards/{card_token}/financial_transactions">client.cards.financial_transactions.<a href="./src/lithic/resources/cards/financial_transactions.py">list</a>(card_token, \*\*<a href="src/lithic/types/cards/financial_transaction_list_params.py">params</a>) -> <a href="./src/lithic/types/financial_transaction.py">SyncSinglePage[FinancialTransaction]</a></code>
238240

241+
# CardBulkOrders
242+
243+
Types:
244+
245+
```python
246+
from lithic.types import CardBulkOrder
247+
```
248+
249+
Methods:
250+
251+
- <code title="post /v1/card_bulk_orders">client.card_bulk_orders.<a href="./src/lithic/resources/card_bulk_orders.py">create</a>(\*\*<a href="src/lithic/types/card_bulk_order_create_params.py">params</a>) -> <a href="./src/lithic/types/card_bulk_order.py">CardBulkOrder</a></code>
252+
- <code title="get /v1/card_bulk_orders/{bulk_order_token}">client.card_bulk_orders.<a href="./src/lithic/resources/card_bulk_orders.py">retrieve</a>(bulk_order_token) -> <a href="./src/lithic/types/card_bulk_order.py">CardBulkOrder</a></code>
253+
- <code title="patch /v1/card_bulk_orders/{bulk_order_token}">client.card_bulk_orders.<a href="./src/lithic/resources/card_bulk_orders.py">update</a>(bulk_order_token, \*\*<a href="src/lithic/types/card_bulk_order_update_params.py">params</a>) -> <a href="./src/lithic/types/card_bulk_order.py">CardBulkOrder</a></code>
254+
- <code title="get /v1/card_bulk_orders">client.card_bulk_orders.<a href="./src/lithic/resources/card_bulk_orders.py">list</a>(\*\*<a href="src/lithic/types/card_bulk_order_list_params.py">params</a>) -> <a href="./src/lithic/types/card_bulk_order.py">SyncCursorPage[CardBulkOrder]</a></code>
255+
239256
# Balances
240257

241258
Types:
@@ -342,7 +359,13 @@ Methods:
342359
Types:
343360

344361
```python
345-
from lithic.types import CategoryDetails, FinancialAccount, FinancialTransaction, StatementTotals
362+
from lithic.types import (
363+
CategoryDetails,
364+
FinancialAccount,
365+
FinancialAccountBalance,
366+
FinancialTransaction,
367+
StatementTotals,
368+
)
346369
```
347370

348371
Methods:
@@ -356,15 +379,9 @@ Methods:
356379

357380
## Balances
358381

359-
Types:
360-
361-
```python
362-
from lithic.types.financial_accounts import BalanceListResponse
363-
```
364-
365382
Methods:
366383

367-
- <code title="get /v1/financial_accounts/{financial_account_token}/balances">client.financial_accounts.balances.<a href="./src/lithic/resources/financial_accounts/balances.py">list</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_accounts/balance_list_params.py">params</a>) -> <a href="./src/lithic/types/financial_accounts/balance_list_response.py">SyncSinglePage[BalanceListResponse]</a></code>
384+
- <code title="get /v1/financial_accounts/{financial_account_token}/balances">client.financial_accounts.balances.<a href="./src/lithic/resources/financial_accounts/balances.py">list</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_accounts/balance_list_params.py">params</a>) -> <a href="./src/lithic/types/financial_account_balance.py">SyncSinglePage[FinancialAccountBalance]</a></code>
368385

369386
## FinancialTransactions
370387

@@ -430,6 +447,8 @@ Types:
430447

431448
```python
432449
from lithic.types import (
450+
CardholderAuthentication,
451+
TokenInfo,
433452
Transaction,
434453
TransactionSimulateAuthorizationResponse,
435454
TransactionSimulateAuthorizationAdviceResponse,
@@ -509,6 +528,7 @@ Types:
509528

510529
```python
511530
from lithic.types import (
531+
ExternalBankAccount,
512532
ExternalBankAccountAddress,
513533
OwnerType,
514534
VerificationMethod,
@@ -517,8 +537,6 @@ from lithic.types import (
517537
ExternalBankAccountUpdateResponse,
518538
ExternalBankAccountListResponse,
519539
ExternalBankAccountRetryMicroDepositsResponse,
520-
ExternalBankAccountRetryPrenoteResponse,
521-
ExternalBankAccountUnpauseResponse,
522540
)
523541
```
524542

@@ -529,8 +547,8 @@ Methods:
529547
- <code title="patch /v1/external_bank_accounts/{external_bank_account_token}">client.external_bank_accounts.<a href="./src/lithic/resources/external_bank_accounts/external_bank_accounts.py">update</a>(external_bank_account_token, \*\*<a href="src/lithic/types/external_bank_account_update_params.py">params</a>) -> <a href="./src/lithic/types/external_bank_account_update_response.py">ExternalBankAccountUpdateResponse</a></code>
530548
- <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>
531549
- <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>
532-
- <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>
533-
- <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>
550+
- <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.py">ExternalBankAccount</a></code>
551+
- <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.py">ExternalBankAccount</a></code>
534552

535553
## MicroDeposits
536554

@@ -574,17 +592,23 @@ Methods:
574592

575593
# ThreeDS
576594

595+
Types:
596+
597+
```python
598+
from lithic.types import ThreeDSAuthentication
599+
```
600+
577601
## Authentication
578602

579603
Types:
580604

581605
```python
582-
from lithic.types.three_ds import AuthenticationRetrieveResponse, AuthenticationSimulateResponse
606+
from lithic.types.three_ds import AuthenticationSimulateResponse
583607
```
584608

585609
Methods:
586610

587-
- <code title="get /v1/three_ds_authentication/{three_ds_authentication_token}">client.three_ds.authentication.<a href="./src/lithic/resources/three_ds/authentication.py">retrieve</a>(three_ds_authentication_token) -> <a href="./src/lithic/types/three_ds/authentication_retrieve_response.py">AuthenticationRetrieveResponse</a></code>
611+
- <code title="get /v1/three_ds_authentication/{three_ds_authentication_token}">client.three_ds.authentication.<a href="./src/lithic/resources/three_ds/authentication.py">retrieve</a>(three_ds_authentication_token) -> <a href="./src/lithic/types/three_ds_authentication.py">ThreeDSAuthentication</a></code>
588612
- <code title="post /v1/three_ds_authentication/simulate">client.three_ds.authentication.<a href="./src/lithic/resources/three_ds/authentication.py">simulate</a>(\*\*<a href="src/lithic/types/three_ds/authentication_simulate_params.py">params</a>) -> <a href="./src/lithic/types/three_ds/authentication_simulate_response.py">AuthenticationSimulateResponse</a></code>
589613
- <code title="post /v1/three_ds_decisioning/simulate/enter_otp">client.three_ds.authentication.<a href="./src/lithic/resources/three_ds/authentication.py">simulate_otp_entry</a>(\*\*<a href="src/lithic/types/three_ds/authentication_simulate_otp_entry_params.py">params</a>) -> None</code>
590614

@@ -611,7 +635,7 @@ Methods:
611635
Types:
612636

613637
```python
614-
from lithic.types import SettlementDetail, SettlementReport, SettlementSummaryDetails
638+
from lithic.types import NetworkTotal, SettlementDetail, SettlementReport, SettlementSummaryDetails
615639
```
616640

617641
## Settlement
@@ -623,16 +647,10 @@ Methods:
623647

624648
### NetworkTotals
625649

626-
Types:
627-
628-
```python
629-
from lithic.types.reports.settlement import NetworkTotalRetrieveResponse, NetworkTotalListResponse
630-
```
631-
632650
Methods:
633651

634-
- <code title="get /v1/reports/settlement/network_totals/{token}">client.reports.settlement.network_totals.<a href="./src/lithic/resources/reports/settlement/network_totals.py">retrieve</a>(token) -> <a href="./src/lithic/types/reports/settlement/network_total_retrieve_response.py">NetworkTotalRetrieveResponse</a></code>
635-
- <code title="get /v1/reports/settlement/network_totals">client.reports.settlement.network_totals.<a href="./src/lithic/resources/reports/settlement/network_totals.py">list</a>(\*\*<a href="src/lithic/types/reports/settlement/network_total_list_params.py">params</a>) -> <a href="./src/lithic/types/reports/settlement/network_total_list_response.py">SyncCursorPage[NetworkTotalListResponse]</a></code>
652+
- <code title="get /v1/reports/settlement/network_totals/{token}">client.reports.settlement.network_totals.<a href="./src/lithic/resources/reports/settlement/network_totals.py">retrieve</a>(token) -> <a href="./src/lithic/types/network_total.py">NetworkTotal</a></code>
653+
- <code title="get /v1/reports/settlement/network_totals">client.reports.settlement.network_totals.<a href="./src/lithic/resources/reports/settlement/network_totals.py">list</a>(\*\*<a href="src/lithic/types/reports/settlement/network_total_list_params.py">params</a>) -> <a href="./src/lithic/types/network_total.py">SyncCursorPage[NetworkTotal]</a></code>
636654

637655
# CardPrograms
638656

@@ -735,22 +753,26 @@ Methods:
735753
- <code title="get /v1/management_operations">client.management_operations.<a href="./src/lithic/resources/management_operations.py">list</a>(\*\*<a href="src/lithic/types/management_operation_list_params.py">params</a>) -> <a href="./src/lithic/types/management_operation_transaction.py">SyncCursorPage[ManagementOperationTransaction]</a></code>
736754
- <code title="post /v1/management_operations/{management_operation_token}/reverse">client.management_operations.<a href="./src/lithic/resources/management_operations.py">reverse</a>(management_operation_token, \*\*<a href="src/lithic/types/management_operation_reverse_params.py">params</a>) -> <a href="./src/lithic/types/management_operation_transaction.py">ManagementOperationTransaction</a></code>
737755

756+
# InternalTransaction
757+
758+
Types:
759+
760+
```python
761+
from lithic.types import InternalTransaction
762+
```
763+
738764
# FundingEvents
739765

740766
Types:
741767

742768
```python
743-
from lithic.types import (
744-
FundingEventRetrieveResponse,
745-
FundingEventListResponse,
746-
FundingEventRetrieveDetailsResponse,
747-
)
769+
from lithic.types import FundingEvent, FundingEventRetrieveDetailsResponse
748770
```
749771

750772
Methods:
751773

752-
- <code title="get /v1/funding_events/{funding_event_token}">client.funding_events.<a href="./src/lithic/resources/funding_events.py">retrieve</a>(funding_event_token) -> <a href="./src/lithic/types/funding_event_retrieve_response.py">FundingEventRetrieveResponse</a></code>
753-
- <code title="get /v1/funding_events">client.funding_events.<a href="./src/lithic/resources/funding_events.py">list</a>(\*\*<a href="src/lithic/types/funding_event_list_params.py">params</a>) -> <a href="./src/lithic/types/funding_event_list_response.py">SyncCursorPage[FundingEventListResponse]</a></code>
774+
- <code title="get /v1/funding_events/{funding_event_token}">client.funding_events.<a href="./src/lithic/resources/funding_events.py">retrieve</a>(funding_event_token) -> <a href="./src/lithic/types/funding_event.py">FundingEvent</a></code>
775+
- <code title="get /v1/funding_events">client.funding_events.<a href="./src/lithic/resources/funding_events.py">list</a>(\*\*<a href="src/lithic/types/funding_event_list_params.py">params</a>) -> <a href="./src/lithic/types/funding_event.py">SyncCursorPage[FundingEvent]</a></code>
754776
- <code title="get /v1/funding_events/{funding_event_token}/details">client.funding_events.<a href="./src/lithic/resources/funding_events.py">retrieve_details</a>(funding_event_token) -> <a href="./src/lithic/types/funding_event_retrieve_details_response.py">FundingEventRetrieveDetailsResponse</a></code>
755777

756778
# Fraud

src/lithic/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
account_holders,
5959
credit_products,
6060
account_activity,
61+
card_bulk_orders,
6162
digital_card_art,
6263
network_programs,
6364
external_payments,
@@ -84,6 +85,7 @@
8485
from .resources.account_holders import AccountHolders, AsyncAccountHolders
8586
from .resources.reports.reports import Reports, AsyncReports
8687
from .resources.account_activity import AccountActivity, AsyncAccountActivity
88+
from .resources.card_bulk_orders import CardBulkOrders, AsyncCardBulkOrders
8789
from .resources.digital_card_art import DigitalCardArtResource, AsyncDigitalCardArtResource
8890
from .resources.network_programs import NetworkPrograms, AsyncNetworkPrograms
8991
from .resources.external_payments import ExternalPayments, AsyncExternalPayments
@@ -246,6 +248,12 @@ def cards(self) -> Cards:
246248

247249
return Cards(self)
248250

251+
@cached_property
252+
def card_bulk_orders(self) -> CardBulkOrders:
253+
from .resources.card_bulk_orders import CardBulkOrders
254+
255+
return CardBulkOrders(self)
256+
249257
@cached_property
250258
def balances(self) -> Balances:
251259
from .resources.balances import Balances
@@ -650,6 +658,12 @@ def cards(self) -> AsyncCards:
650658

651659
return AsyncCards(self)
652660

661+
@cached_property
662+
def card_bulk_orders(self) -> AsyncCardBulkOrders:
663+
from .resources.card_bulk_orders import AsyncCardBulkOrders
664+
665+
return AsyncCardBulkOrders(self)
666+
653667
@cached_property
654668
def balances(self) -> AsyncBalances:
655669
from .resources.balances import AsyncBalances
@@ -977,6 +991,12 @@ def cards(self) -> cards.CardsWithRawResponse:
977991

978992
return CardsWithRawResponse(self._client.cards)
979993

994+
@cached_property
995+
def card_bulk_orders(self) -> card_bulk_orders.CardBulkOrdersWithRawResponse:
996+
from .resources.card_bulk_orders import CardBulkOrdersWithRawResponse
997+
998+
return CardBulkOrdersWithRawResponse(self._client.card_bulk_orders)
999+
9801000
@cached_property
9811001
def balances(self) -> balances.BalancesWithRawResponse:
9821002
from .resources.balances import BalancesWithRawResponse
@@ -1162,6 +1182,12 @@ def cards(self) -> cards.AsyncCardsWithRawResponse:
11621182

11631183
return AsyncCardsWithRawResponse(self._client.cards)
11641184

1185+
@cached_property
1186+
def card_bulk_orders(self) -> card_bulk_orders.AsyncCardBulkOrdersWithRawResponse:
1187+
from .resources.card_bulk_orders import AsyncCardBulkOrdersWithRawResponse
1188+
1189+
return AsyncCardBulkOrdersWithRawResponse(self._client.card_bulk_orders)
1190+
11651191
@cached_property
11661192
def balances(self) -> balances.AsyncBalancesWithRawResponse:
11671193
from .resources.balances import AsyncBalancesWithRawResponse
@@ -1347,6 +1373,12 @@ def cards(self) -> cards.CardsWithStreamingResponse:
13471373

13481374
return CardsWithStreamingResponse(self._client.cards)
13491375

1376+
@cached_property
1377+
def card_bulk_orders(self) -> card_bulk_orders.CardBulkOrdersWithStreamingResponse:
1378+
from .resources.card_bulk_orders import CardBulkOrdersWithStreamingResponse
1379+
1380+
return CardBulkOrdersWithStreamingResponse(self._client.card_bulk_orders)
1381+
13501382
@cached_property
13511383
def balances(self) -> balances.BalancesWithStreamingResponse:
13521384
from .resources.balances import BalancesWithStreamingResponse
@@ -1532,6 +1564,12 @@ def cards(self) -> cards.AsyncCardsWithStreamingResponse:
15321564

15331565
return AsyncCardsWithStreamingResponse(self._client.cards)
15341566

1567+
@cached_property
1568+
def card_bulk_orders(self) -> card_bulk_orders.AsyncCardBulkOrdersWithStreamingResponse:
1569+
from .resources.card_bulk_orders import AsyncCardBulkOrdersWithStreamingResponse
1570+
1571+
return AsyncCardBulkOrdersWithStreamingResponse(self._client.card_bulk_orders)
1572+
15351573
@cached_property
15361574
def balances(self) -> balances.AsyncBalancesWithStreamingResponse:
15371575
from .resources.balances import AsyncBalancesWithStreamingResponse

src/lithic/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@
153153
AccountActivityWithStreamingResponse,
154154
AsyncAccountActivityWithStreamingResponse,
155155
)
156+
from .card_bulk_orders import (
157+
CardBulkOrders,
158+
AsyncCardBulkOrders,
159+
CardBulkOrdersWithRawResponse,
160+
AsyncCardBulkOrdersWithRawResponse,
161+
CardBulkOrdersWithStreamingResponse,
162+
AsyncCardBulkOrdersWithStreamingResponse,
163+
)
156164
from .digital_card_art import (
157165
DigitalCardArtResource,
158166
AsyncDigitalCardArtResource,
@@ -277,6 +285,12 @@
277285
"AsyncCardsWithRawResponse",
278286
"CardsWithStreamingResponse",
279287
"AsyncCardsWithStreamingResponse",
288+
"CardBulkOrders",
289+
"AsyncCardBulkOrders",
290+
"CardBulkOrdersWithRawResponse",
291+
"AsyncCardBulkOrdersWithRawResponse",
292+
"CardBulkOrdersWithStreamingResponse",
293+
"AsyncCardBulkOrdersWithStreamingResponse",
280294
"Balances",
281295
"AsyncBalances",
282296
"BalancesWithRawResponse",

0 commit comments

Comments
 (0)