diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 7c396f71..a8124647 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.97.2"
+ ".": "0.98.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index dd2b46a6..eb764367 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -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
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b4341d1c..581e4178 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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)
diff --git a/README.md b/README.md
index 9797a900..1b325b78 100644
--- a/README.md
+++ b/README.md
@@ -85,7 +85,6 @@ 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
@@ -93,7 +92,7 @@ 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(
diff --git a/api.md b/api.md
index c9f9805a..4186f822 100644
--- a/api.md
+++ b/api.md
@@ -712,7 +712,7 @@ Methods:
Types:
```python
-from lithic.types import ManagementOperationTransaction
+from lithic.types import ExternalResource, ExternalResourceType, ManagementOperationTransaction
```
Methods:
@@ -754,3 +754,16 @@ Methods:
- client.fraud.transactions.retrieve(transaction_token) -> TransactionRetrieveResponse
- client.fraud.transactions.report(transaction_token, \*\*params) -> TransactionReportResponse
+
+# NetworkPrograms
+
+Types:
+
+```python
+from lithic.types import NetworkProgram
+```
+
+Methods:
+
+- client.network_programs.retrieve(network_program_token) -> NetworkProgram
+- client.network_programs.list(\*\*params) -> SyncSinglePage[NetworkProgram]
diff --git a/pyproject.toml b/pyproject.toml
index 6b0f4e7b..7d41deb0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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"
diff --git a/src/lithic/_client.py b/src/lithic/_client.py
index 04f3d4c0..f847af26 100644
--- a/src/lithic/_client.py
+++ b/src/lithic/_client.py
@@ -57,6 +57,7 @@
account_holders,
credit_products,
digital_card_art,
+ network_programs,
external_payments,
aggregate_balances,
financial_accounts,
@@ -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
@@ -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)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
diff --git a/src/lithic/_version.py b/src/lithic/_version.py
index c511a789..7c8ff326 100644
--- a/src/lithic/_version.py
+++ b/src/lithic/_version.py
@@ -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
diff --git a/src/lithic/resources/__init__.py b/src/lithic/resources/__init__.py
index 4aeeec9b..8037eda6 100644
--- a/src/lithic/resources/__init__.py
+++ b/src/lithic/resources/__init__.py
@@ -145,6 +145,14 @@
DigitalCardArtResourceWithStreamingResponse,
AsyncDigitalCardArtResourceWithStreamingResponse,
)
+from .network_programs import (
+ NetworkPrograms,
+ AsyncNetworkPrograms,
+ NetworkProgramsWithRawResponse,
+ AsyncNetworkProgramsWithRawResponse,
+ NetworkProgramsWithStreamingResponse,
+ AsyncNetworkProgramsWithStreamingResponse,
+)
from .external_payments import (
ExternalPayments,
AsyncExternalPayments,
@@ -369,4 +377,10 @@
"AsyncFraudWithRawResponse",
"FraudWithStreamingResponse",
"AsyncFraudWithStreamingResponse",
+ "NetworkPrograms",
+ "AsyncNetworkPrograms",
+ "NetworkProgramsWithRawResponse",
+ "AsyncNetworkProgramsWithRawResponse",
+ "NetworkProgramsWithStreamingResponse",
+ "AsyncNetworkProgramsWithStreamingResponse",
]
diff --git a/src/lithic/resources/accounts.py b/src/lithic/resources/accounts.py
index 87d69eb8..9c2b4223 100644
--- a/src/lithic/resources/accounts.py
+++ b/src/lithic/resources/accounts.py
@@ -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.
@@ -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.
@@ -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
@@ -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,
@@ -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.
@@ -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.
@@ -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
@@ -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,
diff --git a/src/lithic/resources/aggregate_balances.py b/src/lithic/resources/aggregate_balances.py
index 8dce819b..ff88783f 100644
--- a/src/lithic/resources/aggregate_balances.py
+++ b/src/lithic/resources/aggregate_balances.py
@@ -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,
@@ -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,
diff --git a/src/lithic/resources/balances.py b/src/lithic/resources/balances.py
index e9bbc5c0..0fc26483 100644
--- a/src/lithic/resources/balances.py
+++ b/src/lithic/resources/balances.py
@@ -48,7 +48,7 @@ def list(
account_token: str | NotGiven = NOT_GIVEN,
balance_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
business_account_token: str | NotGiven = NOT_GIVEN,
- 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,
@@ -125,7 +125,7 @@ def list(
account_token: str | NotGiven = NOT_GIVEN,
balance_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
business_account_token: str | NotGiven = NOT_GIVEN,
- 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,
diff --git a/src/lithic/resources/cards/cards.py b/src/lithic/resources/cards/cards.py
index 6794a99d..2c2714d0 100644
--- a/src/lithic/resources/cards/cards.py
+++ b/src/lithic/resources/cards/cards.py
@@ -117,7 +117,22 @@ def create(
pin: str | NotGiven = NOT_GIVEN,
product_id: str | NotGiven = NOT_GIVEN,
replacement_account_token: str | NotGiven = NOT_GIVEN,
+ replacement_comment: str | NotGiven = NOT_GIVEN,
replacement_for: str | NotGiven = NOT_GIVEN,
+ replacement_substatus: Literal[
+ "LOST",
+ "COMPROMISED",
+ "DAMAGED",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "SUSPICIOUS_ACTIVITY",
+ "INTERNAL_REVIEW",
+ "EXPIRED",
+ "UNDELIVERABLE",
+ "OTHER",
+ ]
+ | NotGiven = NOT_GIVEN,
shipping_address: ShippingAddress | NotGiven = NOT_GIVEN,
shipping_method: Literal["2_DAY", "EXPEDITED", "EXPRESS", "PRIORITY", "STANDARD", "STANDARD_WITH_TRACKING"]
| NotGiven = NOT_GIVEN,
@@ -194,10 +209,42 @@ def create(
If `replacement_for` is specified and this field is omitted, the replacement
card's account will be inferred from the card being replaced.
+ replacement_comment: Additional context or information related to the card that this card will
+ replace.
+
replacement_for: Globally unique identifier for the card that this card will replace. If the card
type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is
`VIRTUAL` it will be replaced by a `VIRTUAL` card.
+ replacement_substatus:
+ Card state substatus values for the card that this card will replace:
+
+ - `LOST` - The physical card is no longer in the cardholder's possession due to
+ being lost or never received by the cardholder.
+ - `COMPROMISED` - Card information has been exposed, potentially leading to
+ unauthorized access. This may involve physical card theft, cloning, or online
+ data breaches.
+ - `DAMAGED` - The physical card is not functioning properly, such as having chip
+ failures or a demagnetized magnetic stripe.
+ - `END_USER_REQUEST` - The cardholder requested the closure of the card for
+ reasons unrelated to fraud or damage, such as switching to a different product
+ or closing the account.
+ - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud
+ or damage, such as account inactivity, product or policy changes, or
+ technology upgrades.
+ - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified
+ period, applicable to statuses like `PAUSED` or `CLOSED`.
+ - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or
+ activities that require review. This can involve prompting the cardholder to
+ confirm legitimate use or report confirmed fraud.
+ - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal
+ review.
+ - `EXPIRED` - The card has expired and has been closed without being reissued.
+ - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been
+ returned.
+ - `OTHER` - The reason for the status does not fall into any of the above
+ categories. A comment should be provided to specify the reason.
+
shipping_method: Shipping method for the card. Only applies to cards of type PHYSICAL. Use of
options besides `STANDARD` require additional permissions.
@@ -264,7 +311,9 @@ def create(
"pin": pin,
"product_id": product_id,
"replacement_account_token": replacement_account_token,
+ "replacement_comment": replacement_comment,
"replacement_for": replacement_for,
+ "replacement_substatus": replacement_substatus,
"shipping_address": shipping_address,
"shipping_method": shipping_method,
"spend_limit": spend_limit,
@@ -316,13 +365,29 @@ def update(
self,
card_token: str,
*,
+ comment: str | NotGiven = NOT_GIVEN,
digital_card_art_token: str | NotGiven = NOT_GIVEN,
memo: str | NotGiven = NOT_GIVEN,
+ network_program_token: str | NotGiven = NOT_GIVEN,
pin: str | NotGiven = NOT_GIVEN,
pin_status: Literal["OK"] | NotGiven = NOT_GIVEN,
spend_limit: int | NotGiven = NOT_GIVEN,
spend_limit_duration: SpendLimitDuration | NotGiven = NOT_GIVEN,
state: Literal["CLOSED", "OPEN", "PAUSED"] | NotGiven = NOT_GIVEN,
+ substatus: Literal[
+ "LOST",
+ "COMPROMISED",
+ "DAMAGED",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "SUSPICIOUS_ACTIVITY",
+ "INTERNAL_REVIEW",
+ "EXPIRED",
+ "UNDELIVERABLE",
+ "OTHER",
+ ]
+ | 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,
@@ -339,6 +404,8 @@ def update(
undone._
Args:
+ comment: Additional context or information related to the card.
+
digital_card_art_token: Specifies the digital card art to be displayed in the user’s digital wallet
after tokenization. This artwork must be approved by Mastercard and configured
by Lithic to use. See
@@ -346,6 +413,9 @@ def update(
memo: Friendly name to identify the card.
+ network_program_token: Globally unique identifier for the card's network program. Currently applicable
+ to Visa cards participating in Account Level Management only.
+
pin: Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and
`VIRTUAL`. Changing PIN also resets PIN status to `OK`. See
[Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block).
@@ -383,6 +453,35 @@ def update(
- `PAUSED` - Card will decline authorizations, but can be resumed at a later
time.
+ substatus:
+ Card state substatus values:
+
+ - `LOST` - The physical card is no longer in the cardholder's possession due to
+ being lost or never received by the cardholder.
+ - `COMPROMISED` - Card information has been exposed, potentially leading to
+ unauthorized access. This may involve physical card theft, cloning, or online
+ data breaches.
+ - `DAMAGED` - The physical card is not functioning properly, such as having chip
+ failures or a demagnetized magnetic stripe.
+ - `END_USER_REQUEST` - The cardholder requested the closure of the card for
+ reasons unrelated to fraud or damage, such as switching to a different product
+ or closing the account.
+ - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud
+ or damage, such as account inactivity, product or policy changes, or
+ technology upgrades.
+ - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified
+ period, applicable to statuses like `PAUSED` or `CLOSED`.
+ - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or
+ activities that require review. This can involve prompting the cardholder to
+ confirm legitimate use or report confirmed fraud.
+ - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal
+ review.
+ - `EXPIRED` - The card has expired and has been closed without being reissued.
+ - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been
+ returned.
+ - `OTHER` - The reason for the status does not fall into any of the above
+ categories. A comment should be provided to specify the reason.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -397,13 +496,16 @@ def update(
f"/v1/cards/{card_token}",
body=maybe_transform(
{
+ "comment": comment,
"digital_card_art_token": digital_card_art_token,
"memo": memo,
+ "network_program_token": network_program_token,
"pin": pin,
"pin_status": pin_status,
"spend_limit": spend_limit,
"spend_limit_duration": spend_limit_duration,
"state": state,
+ "substatus": substatus,
},
card_update_params.CardUpdateParams,
),
@@ -1158,7 +1260,22 @@ async def create(
pin: str | NotGiven = NOT_GIVEN,
product_id: str | NotGiven = NOT_GIVEN,
replacement_account_token: str | NotGiven = NOT_GIVEN,
+ replacement_comment: str | NotGiven = NOT_GIVEN,
replacement_for: str | NotGiven = NOT_GIVEN,
+ replacement_substatus: Literal[
+ "LOST",
+ "COMPROMISED",
+ "DAMAGED",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "SUSPICIOUS_ACTIVITY",
+ "INTERNAL_REVIEW",
+ "EXPIRED",
+ "UNDELIVERABLE",
+ "OTHER",
+ ]
+ | NotGiven = NOT_GIVEN,
shipping_address: ShippingAddress | NotGiven = NOT_GIVEN,
shipping_method: Literal["2_DAY", "EXPEDITED", "EXPRESS", "PRIORITY", "STANDARD", "STANDARD_WITH_TRACKING"]
| NotGiven = NOT_GIVEN,
@@ -1235,10 +1352,42 @@ async def create(
If `replacement_for` is specified and this field is omitted, the replacement
card's account will be inferred from the card being replaced.
+ replacement_comment: Additional context or information related to the card that this card will
+ replace.
+
replacement_for: Globally unique identifier for the card that this card will replace. If the card
type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is
`VIRTUAL` it will be replaced by a `VIRTUAL` card.
+ replacement_substatus:
+ Card state substatus values for the card that this card will replace:
+
+ - `LOST` - The physical card is no longer in the cardholder's possession due to
+ being lost or never received by the cardholder.
+ - `COMPROMISED` - Card information has been exposed, potentially leading to
+ unauthorized access. This may involve physical card theft, cloning, or online
+ data breaches.
+ - `DAMAGED` - The physical card is not functioning properly, such as having chip
+ failures or a demagnetized magnetic stripe.
+ - `END_USER_REQUEST` - The cardholder requested the closure of the card for
+ reasons unrelated to fraud or damage, such as switching to a different product
+ or closing the account.
+ - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud
+ or damage, such as account inactivity, product or policy changes, or
+ technology upgrades.
+ - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified
+ period, applicable to statuses like `PAUSED` or `CLOSED`.
+ - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or
+ activities that require review. This can involve prompting the cardholder to
+ confirm legitimate use or report confirmed fraud.
+ - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal
+ review.
+ - `EXPIRED` - The card has expired and has been closed without being reissued.
+ - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been
+ returned.
+ - `OTHER` - The reason for the status does not fall into any of the above
+ categories. A comment should be provided to specify the reason.
+
shipping_method: Shipping method for the card. Only applies to cards of type PHYSICAL. Use of
options besides `STANDARD` require additional permissions.
@@ -1305,7 +1454,9 @@ async def create(
"pin": pin,
"product_id": product_id,
"replacement_account_token": replacement_account_token,
+ "replacement_comment": replacement_comment,
"replacement_for": replacement_for,
+ "replacement_substatus": replacement_substatus,
"shipping_address": shipping_address,
"shipping_method": shipping_method,
"spend_limit": spend_limit,
@@ -1357,13 +1508,29 @@ async def update(
self,
card_token: str,
*,
+ comment: str | NotGiven = NOT_GIVEN,
digital_card_art_token: str | NotGiven = NOT_GIVEN,
memo: str | NotGiven = NOT_GIVEN,
+ network_program_token: str | NotGiven = NOT_GIVEN,
pin: str | NotGiven = NOT_GIVEN,
pin_status: Literal["OK"] | NotGiven = NOT_GIVEN,
spend_limit: int | NotGiven = NOT_GIVEN,
spend_limit_duration: SpendLimitDuration | NotGiven = NOT_GIVEN,
state: Literal["CLOSED", "OPEN", "PAUSED"] | NotGiven = NOT_GIVEN,
+ substatus: Literal[
+ "LOST",
+ "COMPROMISED",
+ "DAMAGED",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "SUSPICIOUS_ACTIVITY",
+ "INTERNAL_REVIEW",
+ "EXPIRED",
+ "UNDELIVERABLE",
+ "OTHER",
+ ]
+ | 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,
@@ -1380,6 +1547,8 @@ async def update(
undone._
Args:
+ comment: Additional context or information related to the card.
+
digital_card_art_token: Specifies the digital card art to be displayed in the user’s digital wallet
after tokenization. This artwork must be approved by Mastercard and configured
by Lithic to use. See
@@ -1387,6 +1556,9 @@ async def update(
memo: Friendly name to identify the card.
+ network_program_token: Globally unique identifier for the card's network program. Currently applicable
+ to Visa cards participating in Account Level Management only.
+
pin: Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and
`VIRTUAL`. Changing PIN also resets PIN status to `OK`. See
[Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block).
@@ -1424,6 +1596,35 @@ async def update(
- `PAUSED` - Card will decline authorizations, but can be resumed at a later
time.
+ substatus:
+ Card state substatus values:
+
+ - `LOST` - The physical card is no longer in the cardholder's possession due to
+ being lost or never received by the cardholder.
+ - `COMPROMISED` - Card information has been exposed, potentially leading to
+ unauthorized access. This may involve physical card theft, cloning, or online
+ data breaches.
+ - `DAMAGED` - The physical card is not functioning properly, such as having chip
+ failures or a demagnetized magnetic stripe.
+ - `END_USER_REQUEST` - The cardholder requested the closure of the card for
+ reasons unrelated to fraud or damage, such as switching to a different product
+ or closing the account.
+ - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud
+ or damage, such as account inactivity, product or policy changes, or
+ technology upgrades.
+ - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified
+ period, applicable to statuses like `PAUSED` or `CLOSED`.
+ - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or
+ activities that require review. This can involve prompting the cardholder to
+ confirm legitimate use or report confirmed fraud.
+ - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal
+ review.
+ - `EXPIRED` - The card has expired and has been closed without being reissued.
+ - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been
+ returned.
+ - `OTHER` - The reason for the status does not fall into any of the above
+ categories. A comment should be provided to specify the reason.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -1438,13 +1639,16 @@ async def update(
f"/v1/cards/{card_token}",
body=await async_maybe_transform(
{
+ "comment": comment,
"digital_card_art_token": digital_card_art_token,
"memo": memo,
+ "network_program_token": network_program_token,
"pin": pin,
"pin_status": pin_status,
"spend_limit": spend_limit,
"spend_limit_duration": spend_limit_duration,
"state": state,
+ "substatus": substatus,
},
card_update_params.CardUpdateParams,
),
diff --git a/src/lithic/resources/financial_accounts/financial_accounts.py b/src/lithic/resources/financial_accounts/financial_accounts.py
index 4bcbf6f9..7db97243 100644
--- a/src/lithic/resources/financial_accounts/financial_accounts.py
+++ b/src/lithic/resources/financial_accounts/financial_accounts.py
@@ -227,7 +227,7 @@ def list(
*,
account_token: str | NotGiven = NOT_GIVEN,
business_account_token: str | NotGiven = NOT_GIVEN,
- type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
+ 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,
@@ -525,7 +525,7 @@ def list(
*,
account_token: str | NotGiven = NOT_GIVEN,
business_account_token: str | NotGiven = NOT_GIVEN,
- type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
+ 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,
diff --git a/src/lithic/resources/management_operations.py b/src/lithic/resources/management_operations.py
index 9950e4fd..37f9cfa8 100644
--- a/src/lithic/resources/management_operations.py
+++ b/src/lithic/resources/management_operations.py
@@ -83,6 +83,7 @@ def create(
financial_account_token: str,
token: str | NotGiven = NOT_GIVEN,
memo: str | NotGiven = NOT_GIVEN,
+ on_closed_account: Literal["FAIL", "USE_SUSPENSE"] | NotGiven = NOT_GIVEN,
subtype: str | NotGiven = NOT_GIVEN,
user_defined_id: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -96,6 +97,8 @@ def create(
Create management operation
Args:
+ on_closed_account: What to do if the financial account is closed when posting an operation
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -116,6 +119,7 @@ def create(
"financial_account_token": financial_account_token,
"token": token,
"memo": memo,
+ "on_closed_account": on_closed_account,
"subtype": subtype,
"user_defined_id": user_defined_id,
},
@@ -350,6 +354,7 @@ async def create(
financial_account_token: str,
token: str | NotGiven = NOT_GIVEN,
memo: str | NotGiven = NOT_GIVEN,
+ on_closed_account: Literal["FAIL", "USE_SUSPENSE"] | NotGiven = NOT_GIVEN,
subtype: str | NotGiven = NOT_GIVEN,
user_defined_id: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -363,6 +368,8 @@ async def create(
Create management operation
Args:
+ on_closed_account: What to do if the financial account is closed when posting an operation
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -383,6 +390,7 @@ async def create(
"financial_account_token": financial_account_token,
"token": token,
"memo": memo,
+ "on_closed_account": on_closed_account,
"subtype": subtype,
"user_defined_id": user_defined_id,
},
diff --git a/src/lithic/resources/network_programs.py b/src/lithic/resources/network_programs.py
new file mode 100644
index 00000000..4b0b8bba
--- /dev/null
+++ b/src/lithic/resources/network_programs.py
@@ -0,0 +1,289 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from datetime import datetime
+
+import httpx
+
+from .. import _legacy_response
+from ..types import network_program_list_params
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._utils import maybe_transform
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
+from ..pagination import SyncSinglePage, AsyncSinglePage
+from .._base_client import AsyncPaginator, make_request_options
+from ..types.network_program import NetworkProgram
+
+__all__ = ["NetworkPrograms", "AsyncNetworkPrograms"]
+
+
+class NetworkPrograms(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> NetworkProgramsWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/lithic-com/lithic-python#accessing-raw-response-data-eg-headers
+ """
+ return NetworkProgramsWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> NetworkProgramsWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response
+ """
+ return NetworkProgramsWithStreamingResponse(self)
+
+ def retrieve(
+ self,
+ network_program_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,
+ ) -> NetworkProgram:
+ """
+ Get network program.
+
+ 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 network_program_token:
+ raise ValueError(
+ f"Expected a non-empty value for `network_program_token` but received {network_program_token!r}"
+ )
+ return self._get(
+ f"/v1/network_programs/{network_program_token}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=NetworkProgram,
+ )
+
+ def list(
+ self,
+ *,
+ begin: Union[str, datetime] | NotGiven = NOT_GIVEN,
+ end: Union[str, datetime] | NotGiven = NOT_GIVEN,
+ page_size: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> SyncSinglePage[NetworkProgram]:
+ """List network programs.
+
+ Args:
+ begin: Date string in RFC 3339 format.
+
+ Only entries created after the specified time
+ will be included. UTC time zone.
+
+ end: Date string in RFC 3339 format. Only entries created before the specified time
+ will be included. UTC time zone.
+
+ page_size: Page size (for pagination).
+
+ 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
+ """
+ return self._get_api_list(
+ "/v1/network_programs",
+ page=SyncSinglePage[NetworkProgram],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "begin": begin,
+ "end": end,
+ "page_size": page_size,
+ },
+ network_program_list_params.NetworkProgramListParams,
+ ),
+ ),
+ model=NetworkProgram,
+ )
+
+
+class AsyncNetworkPrograms(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncNetworkProgramsWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/lithic-com/lithic-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncNetworkProgramsWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncNetworkProgramsWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response
+ """
+ return AsyncNetworkProgramsWithStreamingResponse(self)
+
+ async def retrieve(
+ self,
+ network_program_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,
+ ) -> NetworkProgram:
+ """
+ Get network program.
+
+ 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 network_program_token:
+ raise ValueError(
+ f"Expected a non-empty value for `network_program_token` but received {network_program_token!r}"
+ )
+ return await self._get(
+ f"/v1/network_programs/{network_program_token}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=NetworkProgram,
+ )
+
+ def list(
+ self,
+ *,
+ begin: Union[str, datetime] | NotGiven = NOT_GIVEN,
+ end: Union[str, datetime] | NotGiven = NOT_GIVEN,
+ page_size: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> AsyncPaginator[NetworkProgram, AsyncSinglePage[NetworkProgram]]:
+ """List network programs.
+
+ Args:
+ begin: Date string in RFC 3339 format.
+
+ Only entries created after the specified time
+ will be included. UTC time zone.
+
+ end: Date string in RFC 3339 format. Only entries created before the specified time
+ will be included. UTC time zone.
+
+ page_size: Page size (for pagination).
+
+ 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
+ """
+ return self._get_api_list(
+ "/v1/network_programs",
+ page=AsyncSinglePage[NetworkProgram],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "begin": begin,
+ "end": end,
+ "page_size": page_size,
+ },
+ network_program_list_params.NetworkProgramListParams,
+ ),
+ ),
+ model=NetworkProgram,
+ )
+
+
+class NetworkProgramsWithRawResponse:
+ def __init__(self, network_programs: NetworkPrograms) -> None:
+ self._network_programs = network_programs
+
+ self.retrieve = _legacy_response.to_raw_response_wrapper(
+ network_programs.retrieve,
+ )
+ self.list = _legacy_response.to_raw_response_wrapper(
+ network_programs.list,
+ )
+
+
+class AsyncNetworkProgramsWithRawResponse:
+ def __init__(self, network_programs: AsyncNetworkPrograms) -> None:
+ self._network_programs = network_programs
+
+ self.retrieve = _legacy_response.async_to_raw_response_wrapper(
+ network_programs.retrieve,
+ )
+ self.list = _legacy_response.async_to_raw_response_wrapper(
+ network_programs.list,
+ )
+
+
+class NetworkProgramsWithStreamingResponse:
+ def __init__(self, network_programs: NetworkPrograms) -> None:
+ self._network_programs = network_programs
+
+ self.retrieve = to_streamed_response_wrapper(
+ network_programs.retrieve,
+ )
+ self.list = to_streamed_response_wrapper(
+ network_programs.list,
+ )
+
+
+class AsyncNetworkProgramsWithStreamingResponse:
+ def __init__(self, network_programs: AsyncNetworkPrograms) -> None:
+ self._network_programs = network_programs
+
+ self.retrieve = async_to_streamed_response_wrapper(
+ network_programs.retrieve,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ network_programs.list,
+ )
diff --git a/src/lithic/resources/payments.py b/src/lithic/resources/payments.py
index e1794618..f0a5b99b 100644
--- a/src/lithic/resources/payments.py
+++ b/src/lithic/resources/payments.py
@@ -262,6 +262,7 @@ def simulate_action(
"ACH_ORIGINATION_PROCESSED",
"ACH_ORIGINATION_SETTLED",
"ACH_RECEIPT_SETTLED",
+ "ACH_RECEIPT_RELEASED",
"ACH_RETURN_INITIATED",
"ACH_RETURN_PROCESSED",
"ACH_RETURN_SETTLED",
@@ -676,6 +677,7 @@ async def simulate_action(
"ACH_ORIGINATION_PROCESSED",
"ACH_ORIGINATION_SETTLED",
"ACH_RECEIPT_SETTLED",
+ "ACH_RECEIPT_RELEASED",
"ACH_RETURN_INITIATED",
"ACH_RETURN_PROCESSED",
"ACH_RETURN_SETTLED",
diff --git a/src/lithic/types/__init__.py b/src/lithic/types/__init__.py
index b2d297d2..18ce1226 100644
--- a/src/lithic/types/__init__.py
+++ b/src/lithic/types/__init__.py
@@ -27,6 +27,7 @@
from .tokenization import Tokenization as Tokenization
from .account_holder import AccountHolder as AccountHolder
from .message_attempt import MessageAttempt as MessageAttempt
+from .network_program import NetworkProgram as NetworkProgram
from .card_list_params import CardListParams as CardListParams
from .digital_card_art import DigitalCardArt as DigitalCardArt
from .dispute_evidence import DisputeEvidence as DisputeEvidence
@@ -37,6 +38,7 @@
from .card_renew_params import CardRenewParams as CardRenewParams
from .card_spend_limits import CardSpendLimits as CardSpendLimits
from .event_list_params import EventListParams as EventListParams
+from .external_resource import ExternalResource as ExternalResource
from .financial_account import FinancialAccount as FinancialAccount
from .required_document import RequiredDocument as RequiredDocument
from .settlement_detail import SettlementDetail as SettlementDetail
@@ -65,6 +67,7 @@
from .financial_transaction import FinancialTransaction as FinancialTransaction
from .payment_create_params import PaymentCreateParams as PaymentCreateParams
from .book_transfer_response import BookTransferResponse as BookTransferResponse
+from .external_resource_type import ExternalResourceType as ExternalResourceType
from .payment_retry_response import PaymentRetryResponse as PaymentRetryResponse
from .card_provision_response import CardProvisionResponse as CardProvisionResponse
from .payment_create_response import PaymentCreateResponse as PaymentCreateResponse
@@ -84,6 +87,7 @@
from .book_transfer_create_params import BookTransferCreateParams as BookTransferCreateParams
from .card_web_provision_response import CardWebProvisionResponse as CardWebProvisionResponse
from .funding_event_list_response import FundingEventListResponse as FundingEventListResponse
+from .network_program_list_params import NetworkProgramListParams as NetworkProgramListParams
from .account_holder_create_params import AccountHolderCreateParams as AccountHolderCreateParams
from .account_holder_update_params import AccountHolderUpdateParams as AccountHolderUpdateParams
from .book_transfer_reverse_params import BookTransferReverseParams as BookTransferReverseParams
diff --git a/src/lithic/types/account.py b/src/lithic/types/account.py
index 4b8a48c4..11bbfec8 100644
--- a/src/lithic/types/account.py
+++ b/src/lithic/types/account.py
@@ -114,4 +114,48 @@ class Account(BaseModel):
cardholder_currency: Optional[str] = None
"""3-character alphabetic ISO 4217 code for the currency of the cardholder."""
+ comment: Optional[str] = None
+ """Additional context or information related to the account."""
+
+ substatus: Optional[
+ Literal[
+ "FRAUD_IDENTIFIED",
+ "SUSPICIOUS_ACTIVITY",
+ "RISK_VIOLATION",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "INTERNAL_REVIEW",
+ "OTHER",
+ ]
+ ] = None
+ """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: Optional[VerificationAddress] = None
diff --git a/src/lithic/types/account_update_params.py b/src/lithic/types/account_update_params.py
index bef88c66..411f56b8 100644
--- a/src/lithic/types/account_update_params.py
+++ b/src/lithic/types/account_update_params.py
@@ -8,6 +8,9 @@
class AccountUpdateParams(TypedDict, total=False):
+ comment: str
+ """Additional context or information related to the account."""
+
daily_spend_limit: int
"""Amount (in cents) for the account's daily spend limit (e.g.
@@ -36,6 +39,45 @@ class AccountUpdateParams(TypedDict, total=False):
state: Literal["ACTIVE", "PAUSED", "CLOSED"]
"""Account states."""
+ substatus: Literal[
+ "FRAUD_IDENTIFIED",
+ "SUSPICIOUS_ACTIVITY",
+ "RISK_VIOLATION",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "INTERNAL_REVIEW",
+ "OTHER",
+ ]
+ """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: VerificationAddress
"""
Address used during Address Verification Service (AVS) checks during
diff --git a/src/lithic/types/aggregate_balance.py b/src/lithic/types/aggregate_balance.py
index 2c12c10a..571305cd 100644
--- a/src/lithic/types/aggregate_balance.py
+++ b/src/lithic/types/aggregate_balance.py
@@ -18,7 +18,7 @@ class AggregateBalance(BaseModel):
currency: str
"""3-character alphabetic ISO 4217 code for the local currency of the balance."""
- financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"]
+ financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"]
"""Type of financial account"""
last_financial_account_token: str
diff --git a/src/lithic/types/aggregate_balance_list_params.py b/src/lithic/types/aggregate_balance_list_params.py
index d098e821..519ad11d 100644
--- a/src/lithic/types/aggregate_balance_list_params.py
+++ b/src/lithic/types/aggregate_balance_list_params.py
@@ -8,5 +8,5 @@
class AggregateBalanceListParams(TypedDict, total=False):
- financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"]
+ financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"]
"""Get the aggregate balance for a given Financial Account type."""
diff --git a/src/lithic/types/auth_rules/__init__.py b/src/lithic/types/auth_rules/__init__.py
index ebfa23a1..4f7231b5 100644
--- a/src/lithic/types/auth_rules/__init__.py
+++ b/src/lithic/types/auth_rules/__init__.py
@@ -32,3 +32,6 @@
from .conditional_3ds_action_parameters_param import (
Conditional3DSActionParametersParam as Conditional3DSActionParametersParam,
)
+from .velocity_limit_params_period_window_param import (
+ VelocityLimitParamsPeriodWindowParam as VelocityLimitParamsPeriodWindowParam,
+)
diff --git a/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py b/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py
index a03f21ff..307d3f4d 100644
--- a/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py
+++ b/src/lithic/types/auth_rules/conditional_3ds_action_parameters.py
@@ -39,11 +39,8 @@ class Condition(BaseModel):
fee field in the settlement/cardholder billing currency. This is the amount
the issuer should authorize against unless the issuer is paying the acquirer
fee on behalf of the cardholder.
- - `RISK_SCORE`: Network-provided score assessing risk level associated with a
- given authentication. Scores are on a range of 0-999, with 0 representing the
- lowest risk and 999 representing the highest risk. For Visa transactions,
- where the raw score has a range of 0-99, Lithic will normalize the score by
- multiplying the raw score by 10x.
+ - `RISK_SCORE`: Mastercard only: Assessment by the network of the authentication
+ risk level, with a higher value indicating a higher amount of risk.
- `MESSAGE_CATEGORY`: The category of the authentication being processed.
"""
diff --git a/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py
index dee3e85c..29d5e084 100644
--- a/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py
+++ b/src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py
@@ -37,11 +37,8 @@ class Condition(TypedDict, total=False):
fee field in the settlement/cardholder billing currency. This is the amount
the issuer should authorize against unless the issuer is paying the acquirer
fee on behalf of the cardholder.
- - `RISK_SCORE`: Network-provided score assessing risk level associated with a
- given authentication. Scores are on a range of 0-999, with 0 representing the
- lowest risk and 999 representing the highest risk. For Visa transactions,
- where the raw score has a range of 0-99, Lithic will normalize the score by
- multiplying the raw score by 10x.
+ - `RISK_SCORE`: Mastercard only: Assessment by the network of the authentication
+ risk level, with a higher value indicating a higher amount of risk.
- `MESSAGE_CATEGORY`: The category of the authentication being processed.
"""
diff --git a/src/lithic/types/auth_rules/velocity_limit_params.py b/src/lithic/types/auth_rules/velocity_limit_params.py
index 134fe9ac..85dd1585 100644
--- a/src/lithic/types/auth_rules/velocity_limit_params.py
+++ b/src/lithic/types/auth_rules/velocity_limit_params.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import List, Optional
from typing_extensions import Literal
from ..._models import BaseModel
@@ -41,7 +41,7 @@ class Filters(BaseModel):
class VelocityLimitParams(BaseModel):
filters: Filters
- period: Union[int, VelocityLimitParamsPeriodWindow]
+ period: VelocityLimitParamsPeriodWindow
"""The size of the trailing window to calculate Spend Velocity over in seconds.
The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31
diff --git a/src/lithic/types/auth_rules/velocity_limit_params_param.py b/src/lithic/types/auth_rules/velocity_limit_params_param.py
index 2914fddb..c57926ea 100644
--- a/src/lithic/types/auth_rules/velocity_limit_params_param.py
+++ b/src/lithic/types/auth_rules/velocity_limit_params_param.py
@@ -2,10 +2,10 @@
from __future__ import annotations
-from typing import List, Union, Optional
+from typing import List, Optional
from typing_extensions import Literal, Required, TypedDict
-from .velocity_limit_params_period_window import VelocityLimitParamsPeriodWindow
+from .velocity_limit_params_period_window_param import VelocityLimitParamsPeriodWindowParam
__all__ = ["VelocityLimitParamsParam", "Filters"]
@@ -42,7 +42,7 @@ class Filters(TypedDict, total=False):
class VelocityLimitParamsParam(TypedDict, total=False):
filters: Required[Filters]
- period: Required[Union[int, VelocityLimitParamsPeriodWindow]]
+ period: Required[VelocityLimitParamsPeriodWindowParam]
"""The size of the trailing window to calculate Spend Velocity over in seconds.
The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31
diff --git a/src/lithic/types/auth_rules/velocity_limit_params_period_window.py b/src/lithic/types/auth_rules/velocity_limit_params_period_window.py
index 9e9e25fe..0d243e08 100644
--- a/src/lithic/types/auth_rules/velocity_limit_params_period_window.py
+++ b/src/lithic/types/auth_rules/velocity_limit_params_period_window.py
@@ -1,7 +1,80 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from typing import Union, Optional
from typing_extensions import Literal, TypeAlias
-__all__ = ["VelocityLimitParamsPeriodWindow"]
+from ..._models import BaseModel
-VelocityLimitParamsPeriodWindow: TypeAlias = Literal["DAY", "WEEK", "MONTH", "YEAR"]
+__all__ = [
+ "VelocityLimitParamsPeriodWindow",
+ "TrailingWindowObject",
+ "FixedWindowDay",
+ "FixedWindowWeek",
+ "FixedWindowMonth",
+ "FixedWindowYear",
+]
+
+
+class TrailingWindowObject(BaseModel):
+ duration: Optional[int] = None
+ """The size of the trailing window to calculate Spend Velocity over in seconds.
+
+ The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31
+ days).
+ """
+
+ type: Optional[Literal["CUSTOM"]] = None
+
+
+class FixedWindowDay(BaseModel):
+ type: Optional[Literal["DAY"]] = None
+
+
+class FixedWindowWeek(BaseModel):
+ day_of_week: Optional[int] = None
+ """The day of the week to start the week from.
+
+ Following ISO-8601, 1 is Monday and 7 is Sunday. Defaults to Monday if not
+ specified.
+ """
+
+ type: Optional[Literal["WEEK"]] = None
+
+
+class FixedWindowMonth(BaseModel):
+ day_of_month: Optional[int] = None
+ """The day of the month to start from.
+
+ Accepts values from 1 to 31, and will reset at the end of the month if the day
+ exceeds the number of days in the month. Defaults to the 1st of the month if not
+ specified.
+ """
+
+ type: Optional[Literal["MONTH"]] = None
+
+
+class FixedWindowYear(BaseModel):
+ day_of_month: Optional[int] = None
+ """The day of the month to start from.
+
+ Defaults to the 1st of the month if not specified.
+ """
+
+ month: Optional[int] = None
+ """The month to start from.
+
+ 1 is January and 12 is December. Defaults to January if not specified.
+ """
+
+ type: Optional[Literal["YEAR"]] = None
+
+
+VelocityLimitParamsPeriodWindow: TypeAlias = Union[
+ int,
+ Literal["DAY", "WEEK", "MONTH", "YEAR"],
+ TrailingWindowObject,
+ FixedWindowDay,
+ FixedWindowWeek,
+ FixedWindowMonth,
+ FixedWindowYear,
+]
diff --git a/src/lithic/types/auth_rules/velocity_limit_params_period_window_param.py b/src/lithic/types/auth_rules/velocity_limit_params_period_window_param.py
new file mode 100644
index 00000000..7da762af
--- /dev/null
+++ b/src/lithic/types/auth_rules/velocity_limit_params_period_window_param.py
@@ -0,0 +1,80 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from typing_extensions import Literal, TypeAlias, TypedDict
+
+__all__ = [
+ "VelocityLimitParamsPeriodWindowParam",
+ "TrailingWindowObject",
+ "FixedWindowDay",
+ "FixedWindowWeek",
+ "FixedWindowMonth",
+ "FixedWindowYear",
+]
+
+
+class TrailingWindowObject(TypedDict, total=False):
+ duration: int
+ """The size of the trailing window to calculate Spend Velocity over in seconds.
+
+ The minimum value is 10 seconds, and the maximum value is 2678400 seconds (31
+ days).
+ """
+
+ type: Literal["CUSTOM"]
+
+
+class FixedWindowDay(TypedDict, total=False):
+ type: Literal["DAY"]
+
+
+class FixedWindowWeek(TypedDict, total=False):
+ day_of_week: int
+ """The day of the week to start the week from.
+
+ Following ISO-8601, 1 is Monday and 7 is Sunday. Defaults to Monday if not
+ specified.
+ """
+
+ type: Literal["WEEK"]
+
+
+class FixedWindowMonth(TypedDict, total=False):
+ day_of_month: int
+ """The day of the month to start from.
+
+ Accepts values from 1 to 31, and will reset at the end of the month if the day
+ exceeds the number of days in the month. Defaults to the 1st of the month if not
+ specified.
+ """
+
+ type: Literal["MONTH"]
+
+
+class FixedWindowYear(TypedDict, total=False):
+ day_of_month: int
+ """The day of the month to start from.
+
+ Defaults to the 1st of the month if not specified.
+ """
+
+ month: int
+ """The month to start from.
+
+ 1 is January and 12 is December. Defaults to January if not specified.
+ """
+
+ type: Literal["YEAR"]
+
+
+VelocityLimitParamsPeriodWindowParam: TypeAlias = Union[
+ int,
+ Literal["DAY", "WEEK", "MONTH", "YEAR"],
+ TrailingWindowObject,
+ FixedWindowDay,
+ FixedWindowWeek,
+ FixedWindowMonth,
+ FixedWindowYear,
+]
diff --git a/src/lithic/types/balance.py b/src/lithic/types/balance.py
index 7be9fcc8..f969f42a 100644
--- a/src/lithic/types/balance.py
+++ b/src/lithic/types/balance.py
@@ -21,7 +21,7 @@ class Balance(BaseModel):
financial_account_token: str
"""Globally unique identifier for the financial account that holds this balance."""
- financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"]
+ financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"]
"""Type of financial account."""
last_transaction_event_token: str
diff --git a/src/lithic/types/balance_list_params.py b/src/lithic/types/balance_list_params.py
index e2829698..087f6e4a 100644
--- a/src/lithic/types/balance_list_params.py
+++ b/src/lithic/types/balance_list_params.py
@@ -24,5 +24,5 @@ class BalanceListParams(TypedDict, total=False):
business_account_token: str
"""List balances for all financial accounts of a given business_account_token."""
- financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"]
+ financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"]
"""List balances for a given Financial Account type."""
diff --git a/src/lithic/types/card_create_params.py b/src/lithic/types/card_create_params.py
index 3318f48e..d29aa0e7 100644
--- a/src/lithic/types/card_create_params.py
+++ b/src/lithic/types/card_create_params.py
@@ -101,6 +101,12 @@ class CardCreateParams(TypedDict, total=False):
card being replaced.
"""
+ replacement_comment: str
+ """
+ Additional context or information related to the card that this card will
+ replace.
+ """
+
replacement_for: str
"""Globally unique identifier for the card that this card will replace.
@@ -108,6 +114,48 @@ class CardCreateParams(TypedDict, total=False):
card type is `VIRTUAL` it will be replaced by a `VIRTUAL` card.
"""
+ replacement_substatus: Literal[
+ "LOST",
+ "COMPROMISED",
+ "DAMAGED",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "SUSPICIOUS_ACTIVITY",
+ "INTERNAL_REVIEW",
+ "EXPIRED",
+ "UNDELIVERABLE",
+ "OTHER",
+ ]
+ """Card state substatus values for the card that this card will replace:
+
+ - `LOST` - The physical card is no longer in the cardholder's possession due to
+ being lost or never received by the cardholder.
+ - `COMPROMISED` - Card information has been exposed, potentially leading to
+ unauthorized access. This may involve physical card theft, cloning, or online
+ data breaches.
+ - `DAMAGED` - The physical card is not functioning properly, such as having chip
+ failures or a demagnetized magnetic stripe.
+ - `END_USER_REQUEST` - The cardholder requested the closure of the card for
+ reasons unrelated to fraud or damage, such as switching to a different product
+ or closing the account.
+ - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud
+ or damage, such as account inactivity, product or policy changes, or
+ technology upgrades.
+ - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified
+ period, applicable to statuses like `PAUSED` or `CLOSED`.
+ - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or
+ activities that require review. This can involve prompting the cardholder to
+ confirm legitimate use or report confirmed fraud.
+ - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal
+ review.
+ - `EXPIRED` - The card has expired and has been closed without being reissued.
+ - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been
+ returned.
+ - `OTHER` - The reason for the status does not fall into any of the above
+ categories. A comment should be provided to specify the reason.
+ """
+
shipping_address: ShippingAddress
shipping_method: Literal["2_DAY", "EXPEDITED", "EXPRESS", "PRIORITY", "STANDARD", "STANDARD_WITH_TRACKING"]
diff --git a/src/lithic/types/card_program.py b/src/lithic/types/card_program.py
index 38a7a063..a70e2a24 100644
--- a/src/lithic/types/card_program.py
+++ b/src/lithic/types/card_program.py
@@ -24,6 +24,12 @@ class CardProgram(BaseModel):
pan_range_start: str
"""The first digits of the card number that this card program starts with."""
+ account_level_management_enabled: Optional[bool] = None
+ """Whether the card program is participating in Account Level Management.
+
+ Currently applicable to Visa card programs only.
+ """
+
cardholder_currency: Optional[str] = None
"""3-character alphabetic ISO 4217 code for the currency of the cardholder."""
diff --git a/src/lithic/types/card_update_params.py b/src/lithic/types/card_update_params.py
index 8eb72622..b658579c 100644
--- a/src/lithic/types/card_update_params.py
+++ b/src/lithic/types/card_update_params.py
@@ -10,6 +10,9 @@
class CardUpdateParams(TypedDict, total=False):
+ comment: str
+ """Additional context or information related to the card."""
+
digital_card_art_token: str
"""
Specifies the digital card art to be displayed in the user’s digital wallet
@@ -21,6 +24,13 @@ class CardUpdateParams(TypedDict, total=False):
memo: str
"""Friendly name to identify the card."""
+ network_program_token: str
+ """Globally unique identifier for the card's network program.
+
+ Currently applicable to Visa cards participating in Account Level Management
+ only.
+ """
+
pin: str
"""Encrypted PIN block (in base64).
@@ -69,3 +79,45 @@ class CardUpdateParams(TypedDict, total=False):
- `PAUSED` - Card will decline authorizations, but can be resumed at a later
time.
"""
+
+ substatus: Literal[
+ "LOST",
+ "COMPROMISED",
+ "DAMAGED",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "SUSPICIOUS_ACTIVITY",
+ "INTERNAL_REVIEW",
+ "EXPIRED",
+ "UNDELIVERABLE",
+ "OTHER",
+ ]
+ """Card state substatus values:
+
+ - `LOST` - The physical card is no longer in the cardholder's possession due to
+ being lost or never received by the cardholder.
+ - `COMPROMISED` - Card information has been exposed, potentially leading to
+ unauthorized access. This may involve physical card theft, cloning, or online
+ data breaches.
+ - `DAMAGED` - The physical card is not functioning properly, such as having chip
+ failures or a demagnetized magnetic stripe.
+ - `END_USER_REQUEST` - The cardholder requested the closure of the card for
+ reasons unrelated to fraud or damage, such as switching to a different product
+ or closing the account.
+ - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud
+ or damage, such as account inactivity, product or policy changes, or
+ technology upgrades.
+ - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified
+ period, applicable to statuses like `PAUSED` or `CLOSED`.
+ - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or
+ activities that require review. This can involve prompting the cardholder to
+ confirm legitimate use or report confirmed fraud.
+ - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal
+ review.
+ - `EXPIRED` - The card has expired and has been closed without being reissued.
+ - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been
+ returned.
+ - `OTHER` - The reason for the status does not fall into any of the above
+ categories. A comment should be provided to specify the reason.
+ """
diff --git a/src/lithic/types/cards/balance_list_response.py b/src/lithic/types/cards/balance_list_response.py
index 83f06974..7fbe6daf 100644
--- a/src/lithic/types/cards/balance_list_response.py
+++ b/src/lithic/types/cards/balance_list_response.py
@@ -45,7 +45,7 @@ class BalanceListResponse(BaseModel):
cents for USD).
"""
- type: Literal["ISSUING", "OPERATING", "RESERVE"]
+ type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"]
"""Type of financial account."""
updated: datetime
diff --git a/src/lithic/types/external_resource.py b/src/lithic/types/external_resource.py
new file mode 100644
index 00000000..ab60ac08
--- /dev/null
+++ b/src/lithic/types/external_resource.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+
+from .._models import BaseModel
+from .external_resource_type import ExternalResourceType
+
+__all__ = ["ExternalResource"]
+
+
+class ExternalResource(BaseModel):
+ external_resource_token: str
+ """Token identifying the external resource"""
+
+ external_resource_type: ExternalResourceType
+ """Type of external resource associated with the management operation"""
+
+ external_resource_sub_token: Optional[str] = None
+ """Token identifying the external resource sub-resource"""
diff --git a/src/lithic/types/external_resource_type.py b/src/lithic/types/external_resource_type.py
new file mode 100644
index 00000000..ed047939
--- /dev/null
+++ b/src/lithic/types/external_resource_type.py
@@ -0,0 +1,7 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["ExternalResourceType"]
+
+ExternalResourceType: TypeAlias = Literal["STATEMENT", "COLLECTION", "DISPUTE", "UNKNOWN"]
diff --git a/src/lithic/types/financial_account_list_params.py b/src/lithic/types/financial_account_list_params.py
index d465f5be..0228f2b6 100644
--- a/src/lithic/types/financial_account_list_params.py
+++ b/src/lithic/types/financial_account_list_params.py
@@ -14,5 +14,5 @@ class FinancialAccountListParams(TypedDict, total=False):
business_account_token: str
"""List financial accounts for a given business_account_token"""
- type: Literal["ISSUING", "OPERATING", "RESERVE"]
+ type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"]
"""List financial accounts of a given type"""
diff --git a/src/lithic/types/financial_accounts/balance_list_response.py b/src/lithic/types/financial_accounts/balance_list_response.py
index 83f06974..7fbe6daf 100644
--- a/src/lithic/types/financial_accounts/balance_list_response.py
+++ b/src/lithic/types/financial_accounts/balance_list_response.py
@@ -45,7 +45,7 @@ class BalanceListResponse(BaseModel):
cents for USD).
"""
- type: Literal["ISSUING", "OPERATING", "RESERVE"]
+ type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"]
"""Type of financial account."""
updated: datetime
diff --git a/src/lithic/types/management_operation_create_params.py b/src/lithic/types/management_operation_create_params.py
index df6a0956..525651f1 100644
--- a/src/lithic/types/management_operation_create_params.py
+++ b/src/lithic/types/management_operation_create_params.py
@@ -58,6 +58,9 @@ class ManagementOperationCreateParams(TypedDict, total=False):
memo: str
+ on_closed_account: Literal["FAIL", "USE_SUSPENSE"]
+ """What to do if the financial account is closed when posting an operation"""
+
subtype: str
user_defined_id: str
diff --git a/src/lithic/types/management_operation_transaction.py b/src/lithic/types/management_operation_transaction.py
index dce9996e..93dee879 100644
--- a/src/lithic/types/management_operation_transaction.py
+++ b/src/lithic/types/management_operation_transaction.py
@@ -5,6 +5,7 @@
from typing_extensions import Literal
from .._models import BaseModel
+from .external_resource import ExternalResource
__all__ = ["ManagementOperationTransaction", "Event", "TransactionSeries"]
@@ -86,4 +87,7 @@ class ManagementOperationTransaction(BaseModel):
updated: datetime
+ external_resource: Optional[ExternalResource] = None
+ """External resource associated with the management operation"""
+
user_defined_id: Optional[str] = None
diff --git a/src/lithic/types/network_program.py b/src/lithic/types/network_program.py
new file mode 100644
index 00000000..09f5bfe2
--- /dev/null
+++ b/src/lithic/types/network_program.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .._models import BaseModel
+
+__all__ = ["NetworkProgram"]
+
+
+class NetworkProgram(BaseModel):
+ token: str
+ """Lithic-generated unique identifier for the program"""
+
+ default_product_code: str
+ """Network product ID associated with this program."""
+
+ name: str
+ """The name of the network program."""
+
+ registered_program_identification_number: str
+ """RPIN value assigned by the network."""
diff --git a/src/lithic/types/network_program_list_params.py b/src/lithic/types/network_program_list_params.py
new file mode 100644
index 00000000..f171f6e2
--- /dev/null
+++ b/src/lithic/types/network_program_list_params.py
@@ -0,0 +1,28 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from datetime import datetime
+from typing_extensions import Annotated, TypedDict
+
+from .._utils import PropertyInfo
+
+__all__ = ["NetworkProgramListParams"]
+
+
+class NetworkProgramListParams(TypedDict, total=False):
+ begin: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
+ """Date string in RFC 3339 format.
+
+ Only entries created after the specified time will be included. UTC time zone.
+ """
+
+ end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
+ """Date string in RFC 3339 format.
+
+ Only entries created before the specified time will be included. UTC time zone.
+ """
+
+ page_size: int
+ """Page size (for pagination)."""
diff --git a/src/lithic/types/non_pci_card.py b/src/lithic/types/non_pci_card.py
index 8175e27d..fabbd4d1 100644
--- a/src/lithic/types/non_pci_card.py
+++ b/src/lithic/types/non_pci_card.py
@@ -139,6 +139,9 @@ class NonPCICard(BaseModel):
cardholder_currency: Optional[str] = None
"""3-character alphabetic ISO 4217 code for the currency of the cardholder."""
+ comment: Optional[str] = None
+ """Additional context or information related to the card."""
+
digital_card_art_token: Optional[str] = None
"""
Specifies the digital card art to be displayed in the user's digital wallet
@@ -158,6 +161,13 @@ class NonPCICard(BaseModel):
memo: Optional[str] = None
"""Friendly name to identify the card."""
+ network_program_token: Optional[str] = None
+ """Globally unique identifier for the card's network program.
+
+ Null if the card is not associated with a network program. Currently applicable
+ to Visa cards participating in Account Level Management only
+ """
+
pending_commands: Optional[List[str]] = None
"""
Indicates if there are offline PIN changes pending card interaction with an
@@ -177,3 +187,41 @@ class NonPCICard(BaseModel):
If the card is a replacement for another card, the globally unique identifier
for the card that was replaced.
"""
+
+ substatus: Optional[
+ Literal[
+ "LOST",
+ "COMPROMISED",
+ "DAMAGED",
+ "END_USER_REQUEST",
+ "ISSUER_REQUEST",
+ "NOT_ACTIVE",
+ "SUSPICIOUS_ACTIVITY",
+ "INTERNAL_REVIEW",
+ "EXPIRED",
+ "UNDELIVERABLE",
+ "OTHER",
+ ]
+ ] = None
+ """
+ Card state substatus values: _ `LOST` - The physical card is no longer in the
+ cardholder's possession due to being lost or never received by the cardholder. _
+ `COMPROMISED` - Card information has been exposed, potentially leading to
+ unauthorized access. This may involve physical card theft, cloning, or online
+ data breaches. _ `DAMAGED` - The physical card is not functioning properly, such
+ as having chip failures or a demagnetized magnetic stripe. _
+ `END_USER_REQUEST` - The cardholder requested the closure of the card for
+ reasons unrelated to fraud or damage, such as switching to a different product
+ or closing the account. _ `ISSUER_REQUEST` - The issuer closed the card for
+ reasons unrelated to fraud or damage, such as account inactivity, product or
+ policy changes, or technology upgrades. _ `NOT_ACTIVE` - The card hasn’t had any
+ transaction activity for a specified period, applicable to statuses like
+ `PAUSED` or `CLOSED`. _ `SUSPICIOUS_ACTIVITY` - The card has one or more
+ suspicious transactions or activities that require review. This can involve
+ prompting the cardholder to confirm legitimate use or report confirmed fraud. _
+ `INTERNAL_REVIEW` - The card is temporarily paused pending further internal
+ review. _ `EXPIRED` - The card has expired and has been closed without being
+ reissued. _ `UNDELIVERABLE` - The card cannot be delivered to the cardholder and
+ has been returned. \\** `OTHER` - The reason for the status does not fall into any
+ of the above categories. A comment can be provided to specify the reason.
+ """
diff --git a/src/lithic/types/payment_simulate_action_params.py b/src/lithic/types/payment_simulate_action_params.py
index c8d0c128..8fcf4f7c 100644
--- a/src/lithic/types/payment_simulate_action_params.py
+++ b/src/lithic/types/payment_simulate_action_params.py
@@ -15,6 +15,7 @@ class PaymentSimulateActionParams(TypedDict, total=False):
"ACH_ORIGINATION_PROCESSED",
"ACH_ORIGINATION_SETTLED",
"ACH_RECEIPT_SETTLED",
+ "ACH_RECEIPT_RELEASED",
"ACH_RETURN_INITIATED",
"ACH_RETURN_PROCESSED",
"ACH_RETURN_SETTLED",
diff --git a/src/lithic/types/transaction.py b/src/lithic/types/transaction.py
index 7d99a4b2..e3e7b3a8 100644
--- a/src/lithic/types/transaction.py
+++ b/src/lithic/types/transaction.py
@@ -114,27 +114,28 @@ class CardholderAuthentication(BaseModel):
"STRONG_CUSTOMER_AUTHENTICATION_DELEGATION",
"TRANSACTION_RISK_ANALYSIS",
]
- """Whether an acquirer exemption applied to the transaction."""
+ """Whether an acquirer exemption applied to the transaction.
+
+ Not currently populated and will be removed in the future.
+ """
authentication_result: Literal["ATTEMPTS", "DECLINE", "NONE", "SUCCESS"]
- """Indicates what the outcome of the 3DS authentication process is."""
+ """Indicates the outcome of the 3DS authentication process."""
decision_made_by: Literal[
"CUSTOMER_RULES", "CUSTOMER_ENDPOINT", "LITHIC_DEFAULT", "LITHIC_RULES", "NETWORK", "UNKNOWN"
]
"""Indicates which party made the 3DS authentication decision."""
- liability_shift: Literal["3DS_AUTHENTICATED", "ACQUIRER_EXEMPTION", "NONE", "TOKEN_AUTHENTICATED"]
+ liability_shift: Literal["3DS_AUTHENTICATED", "TOKEN_AUTHENTICATED", "NONE"]
"""Indicates whether chargeback liability shift applies to the transaction.
Possible enum values:
- * `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D Secure flow, chargeback liability shift applies.
-
- * `ACQUIRER_EXEMPTION`: The acquirer utilised an exemption to bypass Strong Customer Authentication (`transStatus = N`, or `transStatus = I`). Liability remains with the acquirer and in this case the `acquirer_exemption` field is expected to be not `NONE`.
-
- * `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the merchant is liable.
-
+ - `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D
+ Secure flow, chargeback liability shift applies.
+ - `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the
+ merchant is liable.
- `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated
cryptography, possibly recurring. Chargeback liability shift to the issuer
applies.
diff --git a/tests/api_resources/test_accounts.py b/tests/api_resources/test_accounts.py
index ef56f643..e9938613 100644
--- a/tests/api_resources/test_accounts.py
+++ b/tests/api_resources/test_accounts.py
@@ -70,10 +70,12 @@ def test_method_update(self, client: Lithic) -> None:
def test_method_update_with_all_params(self, client: Lithic) -> None:
account = client.accounts.update(
account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ comment="comment",
daily_spend_limit=1000,
lifetime_spend_limit=0,
monthly_spend_limit=0,
state="ACTIVE",
+ substatus="FRAUD_IDENTIFIED",
verification_address={
"address1": "address1",
"address2": "address2",
@@ -250,10 +252,12 @@ async def test_method_update(self, async_client: AsyncLithic) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncLithic) -> None:
account = await async_client.accounts.update(
account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ comment="comment",
daily_spend_limit=1000,
lifetime_spend_limit=0,
monthly_spend_limit=0,
state="ACTIVE",
+ substatus="FRAUD_IDENTIFIED",
verification_address={
"address1": "address1",
"address2": "address2",
diff --git a/tests/api_resources/test_cards.py b/tests/api_resources/test_cards.py
index 56149df3..de81e51c 100644
--- a/tests/api_resources/test_cards.py
+++ b/tests/api_resources/test_cards.py
@@ -46,7 +46,9 @@ def test_method_create_with_all_params(self, client: Lithic) -> None:
pin="pin",
product_id="1",
replacement_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ replacement_comment="replacement_comment",
replacement_for="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ replacement_substatus="LOST",
shipping_address={
"address1": "5 Broad Street",
"city": "NEW YORK",
@@ -140,13 +142,16 @@ def test_method_update(self, client: Lithic) -> None:
def test_method_update_with_all_params(self, client: Lithic) -> None:
card = client.cards.update(
card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ comment="comment",
digital_card_art_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
memo="Updated Name",
+ network_program_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
pin="pin",
pin_status="OK",
spend_limit=100,
spend_limit_duration="FOREVER",
state="OPEN",
+ substatus="LOST",
)
assert_matches_type(Card, card, path=["response"])
@@ -716,7 +721,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) ->
pin="pin",
product_id="1",
replacement_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ replacement_comment="replacement_comment",
replacement_for="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ replacement_substatus="LOST",
shipping_address={
"address1": "5 Broad Street",
"city": "NEW YORK",
@@ -810,13 +817,16 @@ async def test_method_update(self, async_client: AsyncLithic) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncLithic) -> None:
card = await async_client.cards.update(
card_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ comment="comment",
digital_card_art_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
memo="Updated Name",
+ network_program_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
pin="pin",
pin_status="OK",
spend_limit=100,
spend_limit_duration="FOREVER",
state="OPEN",
+ substatus="LOST",
)
assert_matches_type(Card, card, path=["response"])
diff --git a/tests/api_resources/test_management_operations.py b/tests/api_resources/test_management_operations.py
index 1199fa53..3cc03525 100644
--- a/tests/api_resources/test_management_operations.py
+++ b/tests/api_resources/test_management_operations.py
@@ -44,6 +44,7 @@ def test_method_create_with_all_params(self, client: Lithic) -> None:
financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
memo="memo",
+ on_closed_account="FAIL",
subtype="subtype",
user_defined_id="user_defined_id",
)
@@ -245,6 +246,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) ->
financial_account_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
memo="memo",
+ on_closed_account="FAIL",
subtype="subtype",
user_defined_id="user_defined_id",
)
diff --git a/tests/api_resources/test_network_programs.py b/tests/api_resources/test_network_programs.py
new file mode 100644
index 00000000..f6cf21c2
--- /dev/null
+++ b/tests/api_resources/test_network_programs.py
@@ -0,0 +1,170 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from lithic import Lithic, AsyncLithic
+from tests.utils import assert_matches_type
+from lithic.types import NetworkProgram
+from lithic._utils import parse_datetime
+from lithic.pagination import SyncSinglePage, AsyncSinglePage
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestNetworkPrograms:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_retrieve(self, client: Lithic) -> None:
+ network_program = client.network_programs.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(NetworkProgram, network_program, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Lithic) -> None:
+ response = client.network_programs.with_raw_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ network_program = response.parse()
+ assert_matches_type(NetworkProgram, network_program, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Lithic) -> None:
+ with client.network_programs.with_streaming_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ network_program = response.parse()
+ assert_matches_type(NetworkProgram, network_program, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Lithic) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `network_program_token` but received ''"):
+ client.network_programs.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ def test_method_list(self, client: Lithic) -> None:
+ network_program = client.network_programs.list()
+ assert_matches_type(SyncSinglePage[NetworkProgram], network_program, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Lithic) -> None:
+ network_program = client.network_programs.list(
+ begin=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end=parse_datetime("2019-12-27T18:11:19.117Z"),
+ page_size=1,
+ )
+ assert_matches_type(SyncSinglePage[NetworkProgram], network_program, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Lithic) -> None:
+ response = client.network_programs.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ network_program = response.parse()
+ assert_matches_type(SyncSinglePage[NetworkProgram], network_program, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Lithic) -> None:
+ with client.network_programs.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ network_program = response.parse()
+ assert_matches_type(SyncSinglePage[NetworkProgram], network_program, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncNetworkPrograms:
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncLithic) -> None:
+ network_program = await async_client.network_programs.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(NetworkProgram, network_program, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
+ response = await async_client.network_programs.with_raw_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ network_program = response.parse()
+ assert_matches_type(NetworkProgram, network_program, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> None:
+ async with async_client.network_programs.with_streaming_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ network_program = await response.parse()
+ assert_matches_type(NetworkProgram, network_program, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncLithic) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `network_program_token` but received ''"):
+ await async_client.network_programs.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncLithic) -> None:
+ network_program = await async_client.network_programs.list()
+ assert_matches_type(AsyncSinglePage[NetworkProgram], network_program, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> None:
+ network_program = await async_client.network_programs.list(
+ begin=parse_datetime("2019-12-27T18:11:19.117Z"),
+ end=parse_datetime("2019-12-27T18:11:19.117Z"),
+ page_size=1,
+ )
+ assert_matches_type(AsyncSinglePage[NetworkProgram], network_program, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncLithic) -> None:
+ response = await async_client.network_programs.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ network_program = response.parse()
+ assert_matches_type(AsyncSinglePage[NetworkProgram], network_program, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncLithic) -> None:
+ async with async_client.network_programs.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ network_program = await response.parse()
+ assert_matches_type(AsyncSinglePage[NetworkProgram], network_program, path=["response"])
+
+ assert cast(Any, response.is_closed) is True