Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.86.2"
".": "0.87.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 154
configured_endpoints: 155
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.87.0 (2025-03-18)

Full Changelog: [v0.86.2...v0.87.0](https://github.com/lithic-com/lithic-python/compare/v0.86.2...v0.87.0)

### Features

* **api:** updates to 2 `FinancialAccounts` endpoints and new `ExpireAuthorization` endpoint ([#717](https://github.com/lithic-com/lithic-python/issues/717)) ([bc684e0](https://github.com/lithic-com/lithic-python/commit/bc684e0c336e7b243c371ad14b8cfdde619414c3))

## 0.86.2 (2025-03-17)

Full Changelog: [v0.86.1...v0.86.2](https://github.com/lithic-com/lithic-python/compare/v0.86.1...v0.86.2)
Expand Down
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ Methods:
- <code title="get /v1/financial_accounts/{financial_account_token}">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">retrieve</a>(financial_account_token) -> <a href="./src/lithic/types/financial_account.py">FinancialAccount</a></code>
- <code title="patch /v1/financial_accounts/{financial_account_token}">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">update</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_account_update_params.py">params</a>) -> <a href="./src/lithic/types/financial_account.py">FinancialAccount</a></code>
- <code title="get /v1/financial_accounts">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">list</a>(\*\*<a href="src/lithic/types/financial_account_list_params.py">params</a>) -> <a href="./src/lithic/types/financial_account.py">SyncSinglePage[FinancialAccount]</a></code>
- <code title="post /v1/financial_accounts/{financial_account_token}/charge_off">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">charge_off</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_account_charge_off_params.py">params</a>) -> <a href="./src/lithic/types/financial_accounts/financial_account_credit_config.py">FinancialAccountCreditConfig</a></code>
- <code title="post /v1/financial_accounts/{financial_account_token}/update_status">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">update_status</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_account_update_status_params.py">params</a>) -> <a href="./src/lithic/types/financial_account.py">FinancialAccount</a></code>

## Balances

Expand Down Expand Up @@ -422,6 +422,7 @@ Methods:

- <code title="get /v1/transactions/{transaction_token}">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">retrieve</a>(transaction_token) -> <a href="./src/lithic/types/transaction.py">Transaction</a></code>
- <code title="get /v1/transactions">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">list</a>(\*\*<a href="src/lithic/types/transaction_list_params.py">params</a>) -> <a href="./src/lithic/types/transaction.py">SyncCursorPage[Transaction]</a></code>
- <code title="post /v1/transactions/{transaction_token}/expire_authorization">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">expire_authorization</a>(transaction_token) -> None</code>
- <code title="post /v1/simulate/authorize">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_authorization</a>(\*\*<a href="src/lithic/types/transaction_simulate_authorization_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_authorization_response.py">TransactionSimulateAuthorizationResponse</a></code>
- <code title="post /v1/simulate/authorization_advice">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_authorization_advice</a>(\*\*<a href="src/lithic/types/transaction_simulate_authorization_advice_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_authorization_advice_response.py">TransactionSimulateAuthorizationAdviceResponse</a></code>
- <code title="post /v1/simulate/clearing">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_clearing</a>(\*\*<a href="src/lithic/types/transaction_simulate_clearing_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_clearing_response.py">TransactionSimulateClearingResponse</a></code>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lithic"
version = "0.86.2"
version = "0.87.0"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/lithic/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "lithic"
__version__ = "0.86.2" # x-release-please-version
__version__ = "0.87.0" # x-release-please-version
70 changes: 44 additions & 26 deletions src/lithic/resources/financial_accounts/financial_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from typing import Optional
from typing_extensions import Literal

import httpx
Expand All @@ -11,7 +12,7 @@
financial_account_list_params,
financial_account_create_params,
financial_account_update_params,
financial_account_charge_off_params,
financial_account_update_status_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
Expand Down Expand Up @@ -64,7 +65,6 @@
AsyncFinancialTransactionsWithStreamingResponse,
)
from ...types.financial_account import FinancialAccount
from ...types.financial_accounts.financial_account_credit_config import FinancialAccountCreditConfig

__all__ = ["FinancialAccounts", "AsyncFinancialAccounts"]

Expand Down Expand Up @@ -276,23 +276,28 @@ def list(
model=FinancialAccount,
)

def charge_off(
def update_status(
self,
financial_account_token: str,
*,
reason: Literal["DELINQUENT", "FRAUD"],
status: Literal["OPEN", "CLOSED", "SUSPENDED", "PENDING"],
status_change_reason: Optional[
Literal["CHARGED_OFF_FRAUD", "END_USER_REQUEST", "BANK_REQUEST", "CHARGED_OFF_DELINQUENT"]
],
# 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,
) -> FinancialAccountCreditConfig:
) -> FinancialAccount:
"""
Update issuing account state to charged off
Update financial account status

Args:
reason: Reason for the financial account being marked as Charged Off
status: Status of the financial account

status_change_reason: Reason for the financial account status change

extra_headers: Send extra headers

Expand All @@ -307,14 +312,18 @@ def charge_off(
f"Expected a non-empty value for `financial_account_token` but received {financial_account_token!r}"
)
return self._post(
f"/v1/financial_accounts/{financial_account_token}/charge_off",
f"/v1/financial_accounts/{financial_account_token}/update_status",
body=maybe_transform(
{"reason": reason}, financial_account_charge_off_params.FinancialAccountChargeOffParams
{
"status": status,
"status_change_reason": status_change_reason,
},
financial_account_update_status_params.FinancialAccountUpdateStatusParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=FinancialAccountCreditConfig,
cast_to=FinancialAccount,
)


Expand Down Expand Up @@ -527,23 +536,28 @@ def list(
model=FinancialAccount,
)

async def charge_off(
async def update_status(
self,
financial_account_token: str,
*,
reason: Literal["DELINQUENT", "FRAUD"],
status: Literal["OPEN", "CLOSED", "SUSPENDED", "PENDING"],
status_change_reason: Optional[
Literal["CHARGED_OFF_FRAUD", "END_USER_REQUEST", "BANK_REQUEST", "CHARGED_OFF_DELINQUENT"]
],
# 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,
) -> FinancialAccountCreditConfig:
) -> FinancialAccount:
"""
Update issuing account state to charged off
Update financial account status

Args:
reason: Reason for the financial account being marked as Charged Off
status: Status of the financial account

status_change_reason: Reason for the financial account status change

extra_headers: Send extra headers

Expand All @@ -558,14 +572,18 @@ async def charge_off(
f"Expected a non-empty value for `financial_account_token` but received {financial_account_token!r}"
)
return await self._post(
f"/v1/financial_accounts/{financial_account_token}/charge_off",
f"/v1/financial_accounts/{financial_account_token}/update_status",
body=await async_maybe_transform(
{"reason": reason}, financial_account_charge_off_params.FinancialAccountChargeOffParams
{
"status": status,
"status_change_reason": status_change_reason,
},
financial_account_update_status_params.FinancialAccountUpdateStatusParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=FinancialAccountCreditConfig,
cast_to=FinancialAccount,
)


Expand All @@ -585,8 +603,8 @@ def __init__(self, financial_accounts: FinancialAccounts) -> None:
self.list = _legacy_response.to_raw_response_wrapper(
financial_accounts.list,
)
self.charge_off = _legacy_response.to_raw_response_wrapper(
financial_accounts.charge_off,
self.update_status = _legacy_response.to_raw_response_wrapper(
financial_accounts.update_status,
)

@cached_property
Expand Down Expand Up @@ -626,8 +644,8 @@ def __init__(self, financial_accounts: AsyncFinancialAccounts) -> None:
self.list = _legacy_response.async_to_raw_response_wrapper(
financial_accounts.list,
)
self.charge_off = _legacy_response.async_to_raw_response_wrapper(
financial_accounts.charge_off,
self.update_status = _legacy_response.async_to_raw_response_wrapper(
financial_accounts.update_status,
)

@cached_property
Expand Down Expand Up @@ -667,8 +685,8 @@ def __init__(self, financial_accounts: FinancialAccounts) -> None:
self.list = to_streamed_response_wrapper(
financial_accounts.list,
)
self.charge_off = to_streamed_response_wrapper(
financial_accounts.charge_off,
self.update_status = to_streamed_response_wrapper(
financial_accounts.update_status,
)

@cached_property
Expand Down Expand Up @@ -708,8 +726,8 @@ def __init__(self, financial_accounts: AsyncFinancialAccounts) -> None:
self.list = async_to_streamed_response_wrapper(
financial_accounts.list,
)
self.charge_off = async_to_streamed_response_wrapper(
financial_accounts.charge_off,
self.update_status = async_to_streamed_response_wrapper(
financial_accounts.update_status,
)

@cached_property
Expand Down
2 changes: 2 additions & 0 deletions src/lithic/resources/management_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def create(
"LATE_PAYMENT",
"BILLING_ERROR",
"PROVISIONAL_CREDIT",
"LOSS_WRITE_OFF",
"CASH_BACK_REVERSAL",
"CURRENCY_CONVERSION_REVERSAL",
"INTEREST_REVERSAL",
Expand Down Expand Up @@ -313,6 +314,7 @@ async def create(
"LATE_PAYMENT",
"BILLING_ERROR",
"PROVISIONAL_CREDIT",
"LOSS_WRITE_OFF",
"CASH_BACK_REVERSAL",
"CURRENCY_CONVERSION_REVERSAL",
"INTEREST_REVERSAL",
Expand Down
80 changes: 79 additions & 1 deletion src/lithic/resources/transactions/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
transaction_simulate_authorization_advice_params,
transaction_simulate_credit_authorization_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
from ..._utils import (
maybe_transform,
async_maybe_transform,
Expand Down Expand Up @@ -202,6 +202,39 @@ def list(
model=Transaction,
)

def expire_authorization(
self,
transaction_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,
) -> None:
"""
Expire authorization

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 transaction_token:
raise ValueError(f"Expected a non-empty value for `transaction_token` but received {transaction_token!r}")
return self._post(
f"/v1/transactions/{transaction_token}/expire_authorization",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
)

def simulate_authorization(
self,
*,
Expand Down Expand Up @@ -771,6 +804,39 @@ def list(
model=Transaction,
)

async def expire_authorization(
self,
transaction_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,
) -> None:
"""
Expire authorization

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 transaction_token:
raise ValueError(f"Expected a non-empty value for `transaction_token` but received {transaction_token!r}")
return await self._post(
f"/v1/transactions/{transaction_token}/expire_authorization",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
)

async def simulate_authorization(
self,
*,
Expand Down Expand Up @@ -1205,6 +1271,9 @@ def __init__(self, transactions: Transactions) -> None:
self.list = _legacy_response.to_raw_response_wrapper(
transactions.list,
)
self.expire_authorization = _legacy_response.to_raw_response_wrapper(
transactions.expire_authorization,
)
self.simulate_authorization = _legacy_response.to_raw_response_wrapper(
transactions.simulate_authorization,
)
Expand Down Expand Up @@ -1246,6 +1315,9 @@ def __init__(self, transactions: AsyncTransactions) -> None:
self.list = _legacy_response.async_to_raw_response_wrapper(
transactions.list,
)
self.expire_authorization = _legacy_response.async_to_raw_response_wrapper(
transactions.expire_authorization,
)
self.simulate_authorization = _legacy_response.async_to_raw_response_wrapper(
transactions.simulate_authorization,
)
Expand Down Expand Up @@ -1287,6 +1359,9 @@ def __init__(self, transactions: Transactions) -> None:
self.list = to_streamed_response_wrapper(
transactions.list,
)
self.expire_authorization = to_streamed_response_wrapper(
transactions.expire_authorization,
)
self.simulate_authorization = to_streamed_response_wrapper(
transactions.simulate_authorization,
)
Expand Down Expand Up @@ -1328,6 +1403,9 @@ def __init__(self, transactions: AsyncTransactions) -> None:
self.list = async_to_streamed_response_wrapper(
transactions.list,
)
self.expire_authorization = async_to_streamed_response_wrapper(
transactions.expire_authorization,
)
self.simulate_authorization = async_to_streamed_response_wrapper(
transactions.simulate_authorization,
)
Expand Down
4 changes: 3 additions & 1 deletion src/lithic/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
from .external_bank_account_create_params import ExternalBankAccountCreateParams as ExternalBankAccountCreateParams
from .external_bank_account_list_response import ExternalBankAccountListResponse as ExternalBankAccountListResponse
from .external_bank_account_update_params import ExternalBankAccountUpdateParams as ExternalBankAccountUpdateParams
from .financial_account_charge_off_params import FinancialAccountChargeOffParams as FinancialAccountChargeOffParams
from .management_operation_reverse_params import ManagementOperationReverseParams as ManagementOperationReverseParams
from .transaction_simulate_clearing_params import TransactionSimulateClearingParams as TransactionSimulateClearingParams
from .transaction_simulate_return_response import TransactionSimulateReturnResponse as TransactionSimulateReturnResponse
Expand All @@ -139,6 +138,9 @@
from .account_holder_list_documents_response import (
AccountHolderListDocumentsResponse as AccountHolderListDocumentsResponse,
)
from .financial_account_update_status_params import (
FinancialAccountUpdateStatusParams as FinancialAccountUpdateStatusParams,
)
from .responder_endpoint_check_status_params import (
ResponderEndpointCheckStatusParams as ResponderEndpointCheckStatusParams,
)
Expand Down
Loading