Skip to content

Commit 622ea33

Browse files
feat(api): add Management Operations and Loan Tapes API (#582)
- add business account token to list API’s - add additional reporting to account statements
1 parent 6a82098 commit 622ea33

39 files changed

+2475
-130
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 146
1+
configured_endpoints: 152

api.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,19 @@ Methods:
388388

389389
- <code title="get /v1/financial_accounts/{financial_account_token}/statements/{statement_token}/line_items">client.financial_accounts.statements.line_items.<a href="./src/lithic/resources/financial_accounts/statements/line_items.py">list</a>(statement_token, \*, financial_account_token, \*\*<a href="src/lithic/types/financial_accounts/statements/line_item_list_params.py">params</a>) -> <a href="./src/lithic/types/financial_accounts/statements/line_item_list_response.py">SyncCursorPage[LineItemListResponse]</a></code>
390390

391+
## LoanTapes
392+
393+
Types:
394+
395+
```python
396+
from lithic.types.financial_accounts import LoanTape
397+
```
398+
399+
Methods:
400+
401+
- <code title="get /v1/financial_accounts/{financial_account_token}/loan_tapes/{loan_tape_token}">client.financial_accounts.loan_tapes.<a href="./src/lithic/resources/financial_accounts/loan_tapes.py">retrieve</a>(loan_tape_token, \*, financial_account_token) -> <a href="./src/lithic/types/financial_accounts/loan_tape.py">LoanTape</a></code>
402+
- <code title="get /v1/financial_accounts/{financial_account_token}/loan_tapes">client.financial_accounts.loan_tapes.<a href="./src/lithic/resources/financial_accounts/loan_tapes.py">list</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_accounts/loan_tape_list_params.py">params</a>) -> <a href="./src/lithic/types/financial_accounts/loan_tape.py">SyncCursorPage[LoanTape]</a></code>
403+
391404
# Transactions
392405

393406
Types:
@@ -646,3 +659,18 @@ Methods:
646659
- <code title="post /v1/external_payments/{external_payment_token}/release">client.external_payments.<a href="./src/lithic/resources/external_payments.py">release</a>(external_payment_token, \*\*<a href="src/lithic/types/external_payment_release_params.py">params</a>) -> <a href="./src/lithic/types/external_payment.py">ExternalPayment</a></code>
647660
- <code title="post /v1/external_payments/{external_payment_token}/reverse">client.external_payments.<a href="./src/lithic/resources/external_payments.py">reverse</a>(external_payment_token, \*\*<a href="src/lithic/types/external_payment_reverse_params.py">params</a>) -> <a href="./src/lithic/types/external_payment.py">ExternalPayment</a></code>
648661
- <code title="post /v1/external_payments/{external_payment_token}/settle">client.external_payments.<a href="./src/lithic/resources/external_payments.py">settle</a>(external_payment_token, \*\*<a href="src/lithic/types/external_payment_settle_params.py">params</a>) -> <a href="./src/lithic/types/external_payment.py">ExternalPayment</a></code>
662+
663+
# ManagementOperations
664+
665+
Types:
666+
667+
```python
668+
from lithic.types import ManagementOperationTransaction
669+
```
670+
671+
Methods:
672+
673+
- <code title="post /v1/management_operations">client.management_operations.<a href="./src/lithic/resources/management_operations.py">create</a>(\*\*<a href="src/lithic/types/management_operation_create_params.py">params</a>) -> <a href="./src/lithic/types/management_operation_transaction.py">ManagementOperationTransaction</a></code>
674+
- <code title="get /v1/management_operations/{management_operation_token}">client.management_operations.<a href="./src/lithic/resources/management_operations.py">retrieve</a>(management_operation_token) -> <a href="./src/lithic/types/management_operation_transaction.py">ManagementOperationTransaction</a></code>
675+
- <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>
676+
- <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>

src/lithic/_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class Lithic(SyncAPIClient):
8686
book_transfers: resources.BookTransfers
8787
credit_products: resources.CreditProducts
8888
external_payments: resources.ExternalPayments
89+
management_operations: resources.ManagementOperations
8990
with_raw_response: LithicWithRawResponse
9091
with_streaming_response: LithicWithStreamedResponse
9192

@@ -208,6 +209,7 @@ def __init__(
208209
self.book_transfers = resources.BookTransfers(self)
209210
self.credit_products = resources.CreditProducts(self)
210211
self.external_payments = resources.ExternalPayments(self)
212+
self.management_operations = resources.ManagementOperations(self)
211213
self.with_raw_response = LithicWithRawResponse(self)
212214
self.with_streaming_response = LithicWithStreamedResponse(self)
213215

@@ -384,6 +386,7 @@ class AsyncLithic(AsyncAPIClient):
384386
book_transfers: resources.AsyncBookTransfers
385387
credit_products: resources.AsyncCreditProducts
386388
external_payments: resources.AsyncExternalPayments
389+
management_operations: resources.AsyncManagementOperations
387390
with_raw_response: AsyncLithicWithRawResponse
388391
with_streaming_response: AsyncLithicWithStreamedResponse
389392

@@ -506,6 +509,7 @@ def __init__(
506509
self.book_transfers = resources.AsyncBookTransfers(self)
507510
self.credit_products = resources.AsyncCreditProducts(self)
508511
self.external_payments = resources.AsyncExternalPayments(self)
512+
self.management_operations = resources.AsyncManagementOperations(self)
509513
self.with_raw_response = AsyncLithicWithRawResponse(self)
510514
self.with_streaming_response = AsyncLithicWithStreamedResponse(self)
511515

@@ -684,6 +688,7 @@ def __init__(self, client: Lithic) -> None:
684688
self.book_transfers = resources.BookTransfersWithRawResponse(client.book_transfers)
685689
self.credit_products = resources.CreditProductsWithRawResponse(client.credit_products)
686690
self.external_payments = resources.ExternalPaymentsWithRawResponse(client.external_payments)
691+
self.management_operations = resources.ManagementOperationsWithRawResponse(client.management_operations)
687692

688693
self.api_status = _legacy_response.to_raw_response_wrapper(
689694
client.api_status,
@@ -717,6 +722,7 @@ def __init__(self, client: AsyncLithic) -> None:
717722
self.book_transfers = resources.AsyncBookTransfersWithRawResponse(client.book_transfers)
718723
self.credit_products = resources.AsyncCreditProductsWithRawResponse(client.credit_products)
719724
self.external_payments = resources.AsyncExternalPaymentsWithRawResponse(client.external_payments)
725+
self.management_operations = resources.AsyncManagementOperationsWithRawResponse(client.management_operations)
720726

721727
self.api_status = _legacy_response.async_to_raw_response_wrapper(
722728
client.api_status,
@@ -750,6 +756,7 @@ def __init__(self, client: Lithic) -> None:
750756
self.book_transfers = resources.BookTransfersWithStreamingResponse(client.book_transfers)
751757
self.credit_products = resources.CreditProductsWithStreamingResponse(client.credit_products)
752758
self.external_payments = resources.ExternalPaymentsWithStreamingResponse(client.external_payments)
759+
self.management_operations = resources.ManagementOperationsWithStreamingResponse(client.management_operations)
753760

754761
self.api_status = to_streamed_response_wrapper(
755762
client.api_status,
@@ -787,6 +794,9 @@ def __init__(self, client: AsyncLithic) -> None:
787794
self.book_transfers = resources.AsyncBookTransfersWithStreamingResponse(client.book_transfers)
788795
self.credit_products = resources.AsyncCreditProductsWithStreamingResponse(client.credit_products)
789796
self.external_payments = resources.AsyncExternalPaymentsWithStreamingResponse(client.external_payments)
797+
self.management_operations = resources.AsyncManagementOperationsWithStreamingResponse(
798+
client.management_operations
799+
)
790800

791801
self.api_status = async_to_streamed_response_wrapper(
792802
client.api_status,

src/lithic/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@
161161
ResponderEndpointsWithStreamingResponse,
162162
AsyncResponderEndpointsWithStreamingResponse,
163163
)
164+
from .management_operations import (
165+
ManagementOperations,
166+
AsyncManagementOperations,
167+
ManagementOperationsWithRawResponse,
168+
AsyncManagementOperationsWithRawResponse,
169+
ManagementOperationsWithStreamingResponse,
170+
AsyncManagementOperationsWithStreamingResponse,
171+
)
164172
from .auth_stream_enrollment import (
165173
AuthStreamEnrollment,
166174
AsyncAuthStreamEnrollment,
@@ -327,4 +335,10 @@
327335
"AsyncExternalPaymentsWithRawResponse",
328336
"ExternalPaymentsWithStreamingResponse",
329337
"AsyncExternalPaymentsWithStreamingResponse",
338+
"ManagementOperations",
339+
"AsyncManagementOperations",
340+
"ManagementOperationsWithRawResponse",
341+
"AsyncManagementOperationsWithRawResponse",
342+
"ManagementOperationsWithStreamingResponse",
343+
"AsyncManagementOperationsWithStreamingResponse",
330344
]

src/lithic/resources/book_transfers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ def retrieve(
188188
def list(
189189
self,
190190
*,
191+
account_token: str | NotGiven = NOT_GIVEN,
191192
begin: Union[str, datetime] | NotGiven = NOT_GIVEN,
193+
business_account_token: str | NotGiven = NOT_GIVEN,
192194
category: Literal["BALANCE_OR_FUNDING", "FEE", "REWARD", "ADJUSTMENT", "DERECOGNITION", "DISPUTE", "INTERNAL"]
193195
| NotGiven = NOT_GIVEN,
194196
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
@@ -251,7 +253,9 @@ def list(
251253
timeout=timeout,
252254
query=maybe_transform(
253255
{
256+
"account_token": account_token,
254257
"begin": begin,
258+
"business_account_token": business_account_token,
255259
"category": category,
256260
"end": end,
257261
"ending_before": ending_before,
@@ -470,7 +474,9 @@ async def retrieve(
470474
def list(
471475
self,
472476
*,
477+
account_token: str | NotGiven = NOT_GIVEN,
473478
begin: Union[str, datetime] | NotGiven = NOT_GIVEN,
479+
business_account_token: str | NotGiven = NOT_GIVEN,
474480
category: Literal["BALANCE_OR_FUNDING", "FEE", "REWARD", "ADJUSTMENT", "DERECOGNITION", "DISPUTE", "INTERNAL"]
475481
| NotGiven = NOT_GIVEN,
476482
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
@@ -533,7 +539,9 @@ def list(
533539
timeout=timeout,
534540
query=maybe_transform(
535541
{
542+
"account_token": account_token,
536543
"begin": begin,
544+
"business_account_token": business_account_token,
537545
"category": category,
538546
"end": end,
539547
"ending_before": ending_before,

src/lithic/resources/events/events.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ def list(
120120
"external_payment.updated",
121121
"financial_account.created",
122122
"financial_account.updated",
123+
"loan_tape.created",
124+
"loan_tape.updated",
125+
"management_operation.created",
126+
"management_operation.updated",
123127
"payment_transaction.created",
124128
"payment_transaction.updated",
125129
"settlement_report.updated",
@@ -373,6 +377,10 @@ def list(
373377
"external_payment.updated",
374378
"financial_account.created",
375379
"financial_account.updated",
380+
"loan_tape.created",
381+
"loan_tape.updated",
382+
"management_operation.created",
383+
"management_operation.updated",
376384
"payment_transaction.created",
377385
"payment_transaction.updated",
378386
"settlement_report.updated",

src/lithic/resources/events/subscriptions.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ def create(
8787
"external_payment.updated",
8888
"financial_account.created",
8989
"financial_account.updated",
90+
"loan_tape.created",
91+
"loan_tape.updated",
92+
"management_operation.created",
93+
"management_operation.updated",
9094
"payment_transaction.created",
9195
"payment_transaction.updated",
9296
"settlement_report.updated",
@@ -214,6 +218,10 @@ def update(
214218
"external_payment.updated",
215219
"financial_account.created",
216220
"financial_account.updated",
221+
"loan_tape.created",
222+
"loan_tape.updated",
223+
"management_operation.created",
224+
"management_operation.updated",
217225
"payment_transaction.created",
218226
"payment_transaction.updated",
219227
"settlement_report.updated",
@@ -647,6 +655,10 @@ def send_simulated_example(
647655
"external_payment.updated",
648656
"financial_account.created",
649657
"financial_account.updated",
658+
"loan_tape.created",
659+
"loan_tape.updated",
660+
"management_operation.created",
661+
"management_operation.updated",
650662
"payment_transaction.created",
651663
"payment_transaction.updated",
652664
"settlement_report.updated",
@@ -750,6 +762,10 @@ async def create(
750762
"external_payment.updated",
751763
"financial_account.created",
752764
"financial_account.updated",
765+
"loan_tape.created",
766+
"loan_tape.updated",
767+
"management_operation.created",
768+
"management_operation.updated",
753769
"payment_transaction.created",
754770
"payment_transaction.updated",
755771
"settlement_report.updated",
@@ -877,6 +893,10 @@ async def update(
877893
"external_payment.updated",
878894
"financial_account.created",
879895
"financial_account.updated",
896+
"loan_tape.created",
897+
"loan_tape.updated",
898+
"management_operation.created",
899+
"management_operation.updated",
880900
"payment_transaction.created",
881901
"payment_transaction.updated",
882902
"settlement_report.updated",
@@ -1310,6 +1330,10 @@ async def send_simulated_example(
13101330
"external_payment.updated",
13111331
"financial_account.created",
13121332
"financial_account.updated",
1333+
"loan_tape.created",
1334+
"loan_tape.updated",
1335+
"management_operation.created",
1336+
"management_operation.updated",
13131337
"payment_transaction.created",
13141338
"payment_transaction.updated",
13151339
"settlement_report.updated",

src/lithic/resources/external_payments.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def list(
144144
self,
145145
*,
146146
begin: Union[str, datetime] | NotGiven = NOT_GIVEN,
147+
business_account_token: str | NotGiven = NOT_GIVEN,
147148
category: Literal["EXTERNAL_WIRE", "EXTERNAL_ACH", "EXTERNAL_CHECK", "EXTERNAL_TRANSFER"]
148149
| NotGiven = NOT_GIVEN,
149150
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
@@ -207,6 +208,7 @@ def list(
207208
query=maybe_transform(
208209
{
209210
"begin": begin,
211+
"business_account_token": business_account_token,
210212
"category": category,
211213
"end": end,
212214
"ending_before": ending_before,
@@ -513,6 +515,7 @@ def list(
513515
self,
514516
*,
515517
begin: Union[str, datetime] | NotGiven = NOT_GIVEN,
518+
business_account_token: str | NotGiven = NOT_GIVEN,
516519
category: Literal["EXTERNAL_WIRE", "EXTERNAL_ACH", "EXTERNAL_CHECK", "EXTERNAL_TRANSFER"]
517520
| NotGiven = NOT_GIVEN,
518521
end: Union[str, datetime] | NotGiven = NOT_GIVEN,
@@ -576,6 +579,7 @@ def list(
576579
query=maybe_transform(
577580
{
578581
"begin": begin,
582+
"business_account_token": business_account_token,
579583
"category": category,
580584
"end": end,
581585
"ending_before": ending_before,

src/lithic/resources/financial_accounts/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
BalancesWithStreamingResponse,
99
AsyncBalancesWithStreamingResponse,
1010
)
11+
from .loan_tapes import (
12+
LoanTapes,
13+
AsyncLoanTapes,
14+
LoanTapesWithRawResponse,
15+
AsyncLoanTapesWithRawResponse,
16+
LoanTapesWithStreamingResponse,
17+
AsyncLoanTapesWithStreamingResponse,
18+
)
1119
from .statements import (
1220
Statements,
1321
AsyncStatements,
@@ -66,6 +74,12 @@
6674
"AsyncStatementsWithRawResponse",
6775
"StatementsWithStreamingResponse",
6876
"AsyncStatementsWithStreamingResponse",
77+
"LoanTapes",
78+
"AsyncLoanTapes",
79+
"LoanTapesWithRawResponse",
80+
"AsyncLoanTapesWithRawResponse",
81+
"LoanTapesWithStreamingResponse",
82+
"AsyncLoanTapesWithStreamingResponse",
6983
"FinancialAccounts",
7084
"AsyncFinancialAccounts",
7185
"FinancialAccountsWithRawResponse",

src/lithic/resources/financial_accounts/financial_accounts.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
AsyncBalancesWithStreamingResponse,
2727
)
2828
from ..._compat import cached_property
29+
from .loan_tapes import (
30+
LoanTapes,
31+
AsyncLoanTapes,
32+
LoanTapesWithRawResponse,
33+
AsyncLoanTapesWithRawResponse,
34+
LoanTapesWithStreamingResponse,
35+
AsyncLoanTapesWithStreamingResponse,
36+
)
2937
from .statements import (
3038
Statements,
3139
AsyncStatements,
@@ -77,6 +85,10 @@ def credit_configuration(self) -> CreditConfiguration:
7785
def statements(self) -> Statements:
7886
return Statements(self._client)
7987

88+
@cached_property
89+
def loan_tapes(self) -> LoanTapes:
90+
return LoanTapes(self._client)
91+
8092
@cached_property
8193
def with_raw_response(self) -> FinancialAccountsWithRawResponse:
8294
"""
@@ -281,6 +293,10 @@ def credit_configuration(self) -> AsyncCreditConfiguration:
281293
def statements(self) -> AsyncStatements:
282294
return AsyncStatements(self._client)
283295

296+
@cached_property
297+
def loan_tapes(self) -> AsyncLoanTapes:
298+
return AsyncLoanTapes(self._client)
299+
284300
@cached_property
285301
def with_raw_response(self) -> AsyncFinancialAccountsWithRawResponse:
286302
"""
@@ -503,6 +519,10 @@ def credit_configuration(self) -> CreditConfigurationWithRawResponse:
503519
def statements(self) -> StatementsWithRawResponse:
504520
return StatementsWithRawResponse(self._financial_accounts.statements)
505521

522+
@cached_property
523+
def loan_tapes(self) -> LoanTapesWithRawResponse:
524+
return LoanTapesWithRawResponse(self._financial_accounts.loan_tapes)
525+
506526

507527
class AsyncFinancialAccountsWithRawResponse:
508528
def __init__(self, financial_accounts: AsyncFinancialAccounts) -> None:
@@ -537,6 +557,10 @@ def credit_configuration(self) -> AsyncCreditConfigurationWithRawResponse:
537557
def statements(self) -> AsyncStatementsWithRawResponse:
538558
return AsyncStatementsWithRawResponse(self._financial_accounts.statements)
539559

560+
@cached_property
561+
def loan_tapes(self) -> AsyncLoanTapesWithRawResponse:
562+
return AsyncLoanTapesWithRawResponse(self._financial_accounts.loan_tapes)
563+
540564

541565
class FinancialAccountsWithStreamingResponse:
542566
def __init__(self, financial_accounts: FinancialAccounts) -> None:
@@ -571,6 +595,10 @@ def credit_configuration(self) -> CreditConfigurationWithStreamingResponse:
571595
def statements(self) -> StatementsWithStreamingResponse:
572596
return StatementsWithStreamingResponse(self._financial_accounts.statements)
573597

598+
@cached_property
599+
def loan_tapes(self) -> LoanTapesWithStreamingResponse:
600+
return LoanTapesWithStreamingResponse(self._financial_accounts.loan_tapes)
601+
574602

575603
class AsyncFinancialAccountsWithStreamingResponse:
576604
def __init__(self, financial_accounts: AsyncFinancialAccounts) -> None:
@@ -604,3 +632,7 @@ def credit_configuration(self) -> AsyncCreditConfigurationWithStreamingResponse:
604632
@cached_property
605633
def statements(self) -> AsyncStatementsWithStreamingResponse:
606634
return AsyncStatementsWithStreamingResponse(self._financial_accounts.statements)
635+
636+
@cached_property
637+
def loan_tapes(self) -> AsyncLoanTapesWithStreamingResponse:
638+
return AsyncLoanTapesWithStreamingResponse(self._financial_accounts.loan_tapes)

0 commit comments

Comments
 (0)