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.97.2"
".": "0.98.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 164
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-41b87f6139d55188993492b9c042a6bc1bc0506c166334c387072b57b6c79869.yml
openapi_spec_hash: 3327246caf3bcbd3504ce99c81062075
config_hash: f390dcd4de9109eff9667160949feef2
configured_endpoints: 166
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-b9c76d077831114f1e4c5c15ff3f1d835ef3e9361b768af8468f8eb07a09ef3e.yml
openapi_spec_hash: 5f9bcf1afd68f962a870727c35628394
config_hash: e9a46eb8acb9dc2c236f3e1958a1c4dd
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.98.0 (2025-07-18)

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

### Features

* **api:** adds Network Programs and Account/Card Sub-statuses ([4065995](https://github.com/lithic-com/lithic-python/commit/4065995b2bb7cb922d182c3d952be29306e0470d))
* clean up environment call outs ([15419b7](https://github.com/lithic-com/lithic-python/commit/15419b76176c39ffacc152120bd390ea80542177))

## 0.97.2 (2025-07-11)

Full Changelog: [v0.97.1...v0.97.2](https://github.com/lithic-com/lithic-python/compare/v0.97.1...v0.97.2)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,14 @@ pip install lithic[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from lithic import DefaultAioHttpClient
from lithic import AsyncLithic


async def main() -> None:
async with AsyncLithic(
api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted
api_key="My Lithic API Key",
http_client=DefaultAioHttpClient(),
) as client:
card = await client.cards.create(
Expand Down
15 changes: 14 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ Methods:
Types:

```python
from lithic.types import ManagementOperationTransaction
from lithic.types import ExternalResource, ExternalResourceType, ManagementOperationTransaction
```

Methods:
Expand Down Expand Up @@ -754,3 +754,16 @@ Methods:

- <code title="get /v1/fraud/transactions/{transaction_token}">client.fraud.transactions.<a href="./src/lithic/resources/fraud/transactions.py">retrieve</a>(transaction_token) -> <a href="./src/lithic/types/fraud/transaction_retrieve_response.py">TransactionRetrieveResponse</a></code>
- <code title="post /v1/fraud/transactions/{transaction_token}">client.fraud.transactions.<a href="./src/lithic/resources/fraud/transactions.py">report</a>(transaction_token, \*\*<a href="src/lithic/types/fraud/transaction_report_params.py">params</a>) -> <a href="./src/lithic/types/fraud/transaction_report_response.py">TransactionReportResponse</a></code>

# NetworkPrograms

Types:

```python
from lithic.types import NetworkProgram
```

Methods:

- <code title="get /v1/network_programs/{network_program_token}">client.network_programs.<a href="./src/lithic/resources/network_programs.py">retrieve</a>(network_program_token) -> <a href="./src/lithic/types/network_program.py">NetworkProgram</a></code>
- <code title="get /v1/network_programs">client.network_programs.<a href="./src/lithic/resources/network_programs.py">list</a>(\*\*<a href="src/lithic/types/network_program_list_params.py">params</a>) -> <a href="./src/lithic/types/network_program.py">SyncSinglePage[NetworkProgram]</a></code>
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.97.2"
version = "0.98.0"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
38 changes: 38 additions & 0 deletions src/lithic/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
account_holders,
credit_products,
digital_card_art,
network_programs,
external_payments,
aggregate_balances,
financial_accounts,
Expand All @@ -80,6 +81,7 @@
from .resources.account_holders import AccountHolders, AsyncAccountHolders
from .resources.reports.reports import Reports, AsyncReports
from .resources.digital_card_art import DigitalCardArtResource, AsyncDigitalCardArtResource
from .resources.network_programs import NetworkPrograms, AsyncNetworkPrograms
from .resources.external_payments import ExternalPayments, AsyncExternalPayments
from .resources.three_ds.three_ds import ThreeDS, AsyncThreeDS
from .resources.aggregate_balances import AggregateBalances, AsyncAggregateBalances
Expand Down Expand Up @@ -360,6 +362,12 @@ def fraud(self) -> Fraud:

return Fraud(self)

@cached_property
def network_programs(self) -> NetworkPrograms:
from .resources.network_programs import NetworkPrograms

return NetworkPrograms(self)

@cached_property
def with_raw_response(self) -> LithicWithRawResponse:
return LithicWithRawResponse(self)
Expand Down Expand Up @@ -740,6 +748,12 @@ def fraud(self) -> AsyncFraud:

return AsyncFraud(self)

@cached_property
def network_programs(self) -> AsyncNetworkPrograms:
from .resources.network_programs import AsyncNetworkPrograms

return AsyncNetworkPrograms(self)

@cached_property
def webhooks(self) -> webhooks.AsyncWebhooks:
from .resources.webhooks import AsyncWebhooks
Expand Down Expand Up @@ -1049,6 +1063,12 @@ def fraud(self) -> fraud.FraudWithRawResponse:

return FraudWithRawResponse(self._client.fraud)

@cached_property
def network_programs(self) -> network_programs.NetworkProgramsWithRawResponse:
from .resources.network_programs import NetworkProgramsWithRawResponse

return NetworkProgramsWithRawResponse(self._client.network_programs)


class AsyncLithicWithRawResponse:
_client: AsyncLithic
Expand Down Expand Up @@ -1216,6 +1236,12 @@ def fraud(self) -> fraud.AsyncFraudWithRawResponse:

return AsyncFraudWithRawResponse(self._client.fraud)

@cached_property
def network_programs(self) -> network_programs.AsyncNetworkProgramsWithRawResponse:
from .resources.network_programs import AsyncNetworkProgramsWithRawResponse

return AsyncNetworkProgramsWithRawResponse(self._client.network_programs)


class LithicWithStreamedResponse:
_client: Lithic
Expand Down Expand Up @@ -1383,6 +1409,12 @@ def fraud(self) -> fraud.FraudWithStreamingResponse:

return FraudWithStreamingResponse(self._client.fraud)

@cached_property
def network_programs(self) -> network_programs.NetworkProgramsWithStreamingResponse:
from .resources.network_programs import NetworkProgramsWithStreamingResponse

return NetworkProgramsWithStreamingResponse(self._client.network_programs)


class AsyncLithicWithStreamedResponse:
_client: AsyncLithic
Expand Down Expand Up @@ -1550,6 +1582,12 @@ def fraud(self) -> fraud.AsyncFraudWithStreamingResponse:

return AsyncFraudWithStreamingResponse(self._client.fraud)

@cached_property
def network_programs(self) -> network_programs.AsyncNetworkProgramsWithStreamingResponse:
from .resources.network_programs import AsyncNetworkProgramsWithStreamingResponse

return AsyncNetworkProgramsWithStreamingResponse(self._client.network_programs)


Client = Lithic

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.97.2" # x-release-please-version
__version__ = "0.98.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/lithic/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@
DigitalCardArtResourceWithStreamingResponse,
AsyncDigitalCardArtResourceWithStreamingResponse,
)
from .network_programs import (
NetworkPrograms,
AsyncNetworkPrograms,
NetworkProgramsWithRawResponse,
AsyncNetworkProgramsWithRawResponse,
NetworkProgramsWithStreamingResponse,
AsyncNetworkProgramsWithStreamingResponse,
)
from .external_payments import (
ExternalPayments,
AsyncExternalPayments,
Expand Down Expand Up @@ -369,4 +377,10 @@
"AsyncFraudWithRawResponse",
"FraudWithStreamingResponse",
"AsyncFraudWithStreamingResponse",
"NetworkPrograms",
"AsyncNetworkPrograms",
"NetworkProgramsWithRawResponse",
"AsyncNetworkProgramsWithRawResponse",
"NetworkProgramsWithStreamingResponse",
"AsyncNetworkProgramsWithStreamingResponse",
]
90 changes: 90 additions & 0 deletions src/lithic/resources/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,22 @@ def update(
self,
account_token: str,
*,
comment: str | NotGiven = NOT_GIVEN,
daily_spend_limit: int | NotGiven = NOT_GIVEN,
lifetime_spend_limit: int | NotGiven = NOT_GIVEN,
monthly_spend_limit: int | NotGiven = NOT_GIVEN,
state: Literal["ACTIVE", "PAUSED", "CLOSED"] | NotGiven = NOT_GIVEN,
substatus: Literal[
"FRAUD_IDENTIFIED",
"SUSPICIOUS_ACTIVITY",
"RISK_VIOLATION",
"END_USER_REQUEST",
"ISSUER_REQUEST",
"NOT_ACTIVE",
"INTERNAL_REVIEW",
"OTHER",
]
| NotGiven = NOT_GIVEN,
verification_address: account_update_params.VerificationAddress | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -99,6 +111,8 @@ def update(
in the `PAUSED` state will not be able to transact or create new cards.

Args:
comment: Additional context or information related to the account.

daily_spend_limit: Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a
$1,000 limit). By default the daily spend limit is set to $1,250.

Expand All @@ -115,6 +129,35 @@ def update(

state: Account states.

substatus:
Account state substatus values:

- `FRAUD_IDENTIFIED` - The account has been recognized as being created or used
with stolen or fabricated identity information, encompassing both true
identity theft and synthetic identities.
- `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as
unauthorized access or fraudulent transactions, necessitating further
investigation.
- `RISK_VIOLATION` - The account has been involved in deliberate misuse by the
legitimate account holder. Examples include disputing valid transactions
without cause, falsely claiming non-receipt of goods, or engaging in
intentional bust-out schemes to exploit account services.
- `END_USER_REQUEST` - The account holder has voluntarily requested the closure
of the account for personal reasons. This encompasses situations such as
bankruptcy, other financial considerations, or the account holder's death.
- `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to
business strategy, risk management, inactivity, product changes, regulatory
concerns, or violations of terms and conditions.
- `NOT_ACTIVE` - The account has not had any transactions or payment activity
within a specified period. This status applies to accounts that are paused or
closed due to inactivity.
- `INTERNAL_REVIEW` - The account is temporarily paused pending further internal
review. In future implementations, this status may prevent clients from
activating the account via APIs until the review is completed.
- `OTHER` - The reason for the account's current status does not fall into any
of the above categories. A comment should be provided to specify the
particular reason.

verification_address: Address used during Address Verification Service (AVS) checks during
transactions if enabled via Auth Rules. This field is deprecated as AVS checks
are no longer supported by Auth Rules. The field will be removed from the schema
Expand All @@ -134,10 +177,12 @@ def update(
f"/v1/accounts/{account_token}",
body=maybe_transform(
{
"comment": comment,
"daily_spend_limit": daily_spend_limit,
"lifetime_spend_limit": lifetime_spend_limit,
"monthly_spend_limit": monthly_spend_limit,
"state": state,
"substatus": substatus,
"verification_address": verification_address,
},
account_update_params.AccountUpdateParams,
Expand Down Expand Up @@ -307,10 +352,22 @@ async def update(
self,
account_token: str,
*,
comment: str | NotGiven = NOT_GIVEN,
daily_spend_limit: int | NotGiven = NOT_GIVEN,
lifetime_spend_limit: int | NotGiven = NOT_GIVEN,
monthly_spend_limit: int | NotGiven = NOT_GIVEN,
state: Literal["ACTIVE", "PAUSED", "CLOSED"] | NotGiven = NOT_GIVEN,
substatus: Literal[
"FRAUD_IDENTIFIED",
"SUSPICIOUS_ACTIVITY",
"RISK_VIOLATION",
"END_USER_REQUEST",
"ISSUER_REQUEST",
"NOT_ACTIVE",
"INTERNAL_REVIEW",
"OTHER",
]
| NotGiven = NOT_GIVEN,
verification_address: account_update_params.VerificationAddress | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -326,6 +383,8 @@ async def update(
in the `PAUSED` state will not be able to transact or create new cards.

Args:
comment: Additional context or information related to the account.

daily_spend_limit: Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a
$1,000 limit). By default the daily spend limit is set to $1,250.

Expand All @@ -342,6 +401,35 @@ async def update(

state: Account states.

substatus:
Account state substatus values:

- `FRAUD_IDENTIFIED` - The account has been recognized as being created or used
with stolen or fabricated identity information, encompassing both true
identity theft and synthetic identities.
- `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as
unauthorized access or fraudulent transactions, necessitating further
investigation.
- `RISK_VIOLATION` - The account has been involved in deliberate misuse by the
legitimate account holder. Examples include disputing valid transactions
without cause, falsely claiming non-receipt of goods, or engaging in
intentional bust-out schemes to exploit account services.
- `END_USER_REQUEST` - The account holder has voluntarily requested the closure
of the account for personal reasons. This encompasses situations such as
bankruptcy, other financial considerations, or the account holder's death.
- `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to
business strategy, risk management, inactivity, product changes, regulatory
concerns, or violations of terms and conditions.
- `NOT_ACTIVE` - The account has not had any transactions or payment activity
within a specified period. This status applies to accounts that are paused or
closed due to inactivity.
- `INTERNAL_REVIEW` - The account is temporarily paused pending further internal
review. In future implementations, this status may prevent clients from
activating the account via APIs until the review is completed.
- `OTHER` - The reason for the account's current status does not fall into any
of the above categories. A comment should be provided to specify the
particular reason.

verification_address: Address used during Address Verification Service (AVS) checks during
transactions if enabled via Auth Rules. This field is deprecated as AVS checks
are no longer supported by Auth Rules. The field will be removed from the schema
Expand All @@ -361,10 +449,12 @@ async def update(
f"/v1/accounts/{account_token}",
body=await async_maybe_transform(
{
"comment": comment,
"daily_spend_limit": daily_spend_limit,
"lifetime_spend_limit": lifetime_spend_limit,
"monthly_spend_limit": monthly_spend_limit,
"state": state,
"substatus": substatus,
"verification_address": verification_address,
},
account_update_params.AccountUpdateParams,
Expand Down
4 changes: 2 additions & 2 deletions src/lithic/resources/aggregate_balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def with_streaming_response(self) -> AggregateBalancesWithStreamingResponse:
def list(
self,
*,
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] | NotGiven = NOT_GIVEN,
# 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,
Expand Down Expand Up @@ -106,7 +106,7 @@ def with_streaming_response(self) -> AsyncAggregateBalancesWithStreamingResponse
def list(
self,
*,
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] | NotGiven = NOT_GIVEN,
# 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,
Expand Down
Loading