Skip to content

Commit 4065995

Browse files
feat(api): adds Network Programs and Account/Card Sub-statuses
- Add detailed substatus enums for Account and Card state management with fraud, risk, and lifecycle reason codes - Add Network Program endpoints for program management.
1 parent 15419b7 commit 4065995

Some content is hidden

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

45 files changed

+1364
-44
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 164
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-41b87f6139d55188993492b9c042a6bc1bc0506c166334c387072b57b6c79869.yml
3-
openapi_spec_hash: 3327246caf3bcbd3504ce99c81062075
4-
config_hash: f390dcd4de9109eff9667160949feef2
1+
configured_endpoints: 166
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-b9c76d077831114f1e4c5c15ff3f1d835ef3e9361b768af8468f8eb07a09ef3e.yml
3+
openapi_spec_hash: 5f9bcf1afd68f962a870727c35628394
4+
config_hash: e9a46eb8acb9dc2c236f3e1958a1c4dd

api.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ Methods:
712712
Types:
713713

714714
```python
715-
from lithic.types import ManagementOperationTransaction
715+
from lithic.types import ExternalResource, ExternalResourceType, ManagementOperationTransaction
716716
```
717717

718718
Methods:
@@ -754,3 +754,16 @@ Methods:
754754

755755
- <code title="get /v1/fraud/transactions/{transaction_token}">client.fraud.transactions.<a href="./src/lithic/resources/fraud/transactions.py">retrieve</a>(transaction_token) -> <a href="./src/lithic/types/fraud/transaction_retrieve_response.py">TransactionRetrieveResponse</a></code>
756756
- <code title="post /v1/fraud/transactions/{transaction_token}">client.fraud.transactions.<a href="./src/lithic/resources/fraud/transactions.py">report</a>(transaction_token, \*\*<a href="src/lithic/types/fraud/transaction_report_params.py">params</a>) -> <a href="./src/lithic/types/fraud/transaction_report_response.py">TransactionReportResponse</a></code>
757+
758+
# NetworkPrograms
759+
760+
Types:
761+
762+
```python
763+
from lithic.types import NetworkProgram
764+
```
765+
766+
Methods:
767+
768+
- <code title="get /v1/network_programs/{network_program_token}">client.network_programs.<a href="./src/lithic/resources/network_programs.py">retrieve</a>(network_program_token) -> <a href="./src/lithic/types/network_program.py">NetworkProgram</a></code>
769+
- <code title="get /v1/network_programs">client.network_programs.<a href="./src/lithic/resources/network_programs.py">list</a>(\*\*<a href="src/lithic/types/network_program_list_params.py">params</a>) -> <a href="./src/lithic/types/network_program.py">SyncSinglePage[NetworkProgram]</a></code>

src/lithic/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
account_holders,
5858
credit_products,
5959
digital_card_art,
60+
network_programs,
6061
external_payments,
6162
aggregate_balances,
6263
financial_accounts,
@@ -80,6 +81,7 @@
8081
from .resources.account_holders import AccountHolders, AsyncAccountHolders
8182
from .resources.reports.reports import Reports, AsyncReports
8283
from .resources.digital_card_art import DigitalCardArtResource, AsyncDigitalCardArtResource
84+
from .resources.network_programs import NetworkPrograms, AsyncNetworkPrograms
8385
from .resources.external_payments import ExternalPayments, AsyncExternalPayments
8486
from .resources.three_ds.three_ds import ThreeDS, AsyncThreeDS
8587
from .resources.aggregate_balances import AggregateBalances, AsyncAggregateBalances
@@ -360,6 +362,12 @@ def fraud(self) -> Fraud:
360362

361363
return Fraud(self)
362364

365+
@cached_property
366+
def network_programs(self) -> NetworkPrograms:
367+
from .resources.network_programs import NetworkPrograms
368+
369+
return NetworkPrograms(self)
370+
363371
@cached_property
364372
def with_raw_response(self) -> LithicWithRawResponse:
365373
return LithicWithRawResponse(self)
@@ -740,6 +748,12 @@ def fraud(self) -> AsyncFraud:
740748

741749
return AsyncFraud(self)
742750

751+
@cached_property
752+
def network_programs(self) -> AsyncNetworkPrograms:
753+
from .resources.network_programs import AsyncNetworkPrograms
754+
755+
return AsyncNetworkPrograms(self)
756+
743757
@cached_property
744758
def webhooks(self) -> webhooks.AsyncWebhooks:
745759
from .resources.webhooks import AsyncWebhooks
@@ -1049,6 +1063,12 @@ def fraud(self) -> fraud.FraudWithRawResponse:
10491063

10501064
return FraudWithRawResponse(self._client.fraud)
10511065

1066+
@cached_property
1067+
def network_programs(self) -> network_programs.NetworkProgramsWithRawResponse:
1068+
from .resources.network_programs import NetworkProgramsWithRawResponse
1069+
1070+
return NetworkProgramsWithRawResponse(self._client.network_programs)
1071+
10521072

10531073
class AsyncLithicWithRawResponse:
10541074
_client: AsyncLithic
@@ -1216,6 +1236,12 @@ def fraud(self) -> fraud.AsyncFraudWithRawResponse:
12161236

12171237
return AsyncFraudWithRawResponse(self._client.fraud)
12181238

1239+
@cached_property
1240+
def network_programs(self) -> network_programs.AsyncNetworkProgramsWithRawResponse:
1241+
from .resources.network_programs import AsyncNetworkProgramsWithRawResponse
1242+
1243+
return AsyncNetworkProgramsWithRawResponse(self._client.network_programs)
1244+
12191245

12201246
class LithicWithStreamedResponse:
12211247
_client: Lithic
@@ -1383,6 +1409,12 @@ def fraud(self) -> fraud.FraudWithStreamingResponse:
13831409

13841410
return FraudWithStreamingResponse(self._client.fraud)
13851411

1412+
@cached_property
1413+
def network_programs(self) -> network_programs.NetworkProgramsWithStreamingResponse:
1414+
from .resources.network_programs import NetworkProgramsWithStreamingResponse
1415+
1416+
return NetworkProgramsWithStreamingResponse(self._client.network_programs)
1417+
13861418

13871419
class AsyncLithicWithStreamedResponse:
13881420
_client: AsyncLithic
@@ -1550,6 +1582,12 @@ def fraud(self) -> fraud.AsyncFraudWithStreamingResponse:
15501582

15511583
return AsyncFraudWithStreamingResponse(self._client.fraud)
15521584

1585+
@cached_property
1586+
def network_programs(self) -> network_programs.AsyncNetworkProgramsWithStreamingResponse:
1587+
from .resources.network_programs import AsyncNetworkProgramsWithStreamingResponse
1588+
1589+
return AsyncNetworkProgramsWithStreamingResponse(self._client.network_programs)
1590+
15531591

15541592
Client = Lithic
15551593

src/lithic/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@
145145
DigitalCardArtResourceWithStreamingResponse,
146146
AsyncDigitalCardArtResourceWithStreamingResponse,
147147
)
148+
from .network_programs import (
149+
NetworkPrograms,
150+
AsyncNetworkPrograms,
151+
NetworkProgramsWithRawResponse,
152+
AsyncNetworkProgramsWithRawResponse,
153+
NetworkProgramsWithStreamingResponse,
154+
AsyncNetworkProgramsWithStreamingResponse,
155+
)
148156
from .external_payments import (
149157
ExternalPayments,
150158
AsyncExternalPayments,
@@ -369,4 +377,10 @@
369377
"AsyncFraudWithRawResponse",
370378
"FraudWithStreamingResponse",
371379
"AsyncFraudWithStreamingResponse",
380+
"NetworkPrograms",
381+
"AsyncNetworkPrograms",
382+
"NetworkProgramsWithRawResponse",
383+
"AsyncNetworkProgramsWithRawResponse",
384+
"NetworkProgramsWithStreamingResponse",
385+
"AsyncNetworkProgramsWithStreamingResponse",
372386
]

src/lithic/resources/accounts.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,22 @@ def update(
8080
self,
8181
account_token: str,
8282
*,
83+
comment: str | NotGiven = NOT_GIVEN,
8384
daily_spend_limit: int | NotGiven = NOT_GIVEN,
8485
lifetime_spend_limit: int | NotGiven = NOT_GIVEN,
8586
monthly_spend_limit: int | NotGiven = NOT_GIVEN,
8687
state: Literal["ACTIVE", "PAUSED", "CLOSED"] | NotGiven = NOT_GIVEN,
88+
substatus: Literal[
89+
"FRAUD_IDENTIFIED",
90+
"SUSPICIOUS_ACTIVITY",
91+
"RISK_VIOLATION",
92+
"END_USER_REQUEST",
93+
"ISSUER_REQUEST",
94+
"NOT_ACTIVE",
95+
"INTERNAL_REVIEW",
96+
"OTHER",
97+
]
98+
| NotGiven = NOT_GIVEN,
8799
verification_address: account_update_params.VerificationAddress | NotGiven = NOT_GIVEN,
88100
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
89101
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -99,6 +111,8 @@ def update(
99111
in the `PAUSED` state will not be able to transact or create new cards.
100112
101113
Args:
114+
comment: Additional context or information related to the account.
115+
102116
daily_spend_limit: Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a
103117
$1,000 limit). By default the daily spend limit is set to $1,250.
104118
@@ -115,6 +129,35 @@ def update(
115129
116130
state: Account states.
117131
132+
substatus:
133+
Account state substatus values:
134+
135+
- `FRAUD_IDENTIFIED` - The account has been recognized as being created or used
136+
with stolen or fabricated identity information, encompassing both true
137+
identity theft and synthetic identities.
138+
- `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as
139+
unauthorized access or fraudulent transactions, necessitating further
140+
investigation.
141+
- `RISK_VIOLATION` - The account has been involved in deliberate misuse by the
142+
legitimate account holder. Examples include disputing valid transactions
143+
without cause, falsely claiming non-receipt of goods, or engaging in
144+
intentional bust-out schemes to exploit account services.
145+
- `END_USER_REQUEST` - The account holder has voluntarily requested the closure
146+
of the account for personal reasons. This encompasses situations such as
147+
bankruptcy, other financial considerations, or the account holder's death.
148+
- `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to
149+
business strategy, risk management, inactivity, product changes, regulatory
150+
concerns, or violations of terms and conditions.
151+
- `NOT_ACTIVE` - The account has not had any transactions or payment activity
152+
within a specified period. This status applies to accounts that are paused or
153+
closed due to inactivity.
154+
- `INTERNAL_REVIEW` - The account is temporarily paused pending further internal
155+
review. In future implementations, this status may prevent clients from
156+
activating the account via APIs until the review is completed.
157+
- `OTHER` - The reason for the account's current status does not fall into any
158+
of the above categories. A comment should be provided to specify the
159+
particular reason.
160+
118161
verification_address: Address used during Address Verification Service (AVS) checks during
119162
transactions if enabled via Auth Rules. This field is deprecated as AVS checks
120163
are no longer supported by Auth Rules. The field will be removed from the schema
@@ -134,10 +177,12 @@ def update(
134177
f"/v1/accounts/{account_token}",
135178
body=maybe_transform(
136179
{
180+
"comment": comment,
137181
"daily_spend_limit": daily_spend_limit,
138182
"lifetime_spend_limit": lifetime_spend_limit,
139183
"monthly_spend_limit": monthly_spend_limit,
140184
"state": state,
185+
"substatus": substatus,
141186
"verification_address": verification_address,
142187
},
143188
account_update_params.AccountUpdateParams,
@@ -307,10 +352,22 @@ async def update(
307352
self,
308353
account_token: str,
309354
*,
355+
comment: str | NotGiven = NOT_GIVEN,
310356
daily_spend_limit: int | NotGiven = NOT_GIVEN,
311357
lifetime_spend_limit: int | NotGiven = NOT_GIVEN,
312358
monthly_spend_limit: int | NotGiven = NOT_GIVEN,
313359
state: Literal["ACTIVE", "PAUSED", "CLOSED"] | NotGiven = NOT_GIVEN,
360+
substatus: Literal[
361+
"FRAUD_IDENTIFIED",
362+
"SUSPICIOUS_ACTIVITY",
363+
"RISK_VIOLATION",
364+
"END_USER_REQUEST",
365+
"ISSUER_REQUEST",
366+
"NOT_ACTIVE",
367+
"INTERNAL_REVIEW",
368+
"OTHER",
369+
]
370+
| NotGiven = NOT_GIVEN,
314371
verification_address: account_update_params.VerificationAddress | NotGiven = NOT_GIVEN,
315372
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
316373
# 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(
326383
in the `PAUSED` state will not be able to transact or create new cards.
327384
328385
Args:
386+
comment: Additional context or information related to the account.
387+
329388
daily_spend_limit: Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a
330389
$1,000 limit). By default the daily spend limit is set to $1,250.
331390
@@ -342,6 +401,35 @@ async def update(
342401
343402
state: Account states.
344403
404+
substatus:
405+
Account state substatus values:
406+
407+
- `FRAUD_IDENTIFIED` - The account has been recognized as being created or used
408+
with stolen or fabricated identity information, encompassing both true
409+
identity theft and synthetic identities.
410+
- `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as
411+
unauthorized access or fraudulent transactions, necessitating further
412+
investigation.
413+
- `RISK_VIOLATION` - The account has been involved in deliberate misuse by the
414+
legitimate account holder. Examples include disputing valid transactions
415+
without cause, falsely claiming non-receipt of goods, or engaging in
416+
intentional bust-out schemes to exploit account services.
417+
- `END_USER_REQUEST` - The account holder has voluntarily requested the closure
418+
of the account for personal reasons. This encompasses situations such as
419+
bankruptcy, other financial considerations, or the account holder's death.
420+
- `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to
421+
business strategy, risk management, inactivity, product changes, regulatory
422+
concerns, or violations of terms and conditions.
423+
- `NOT_ACTIVE` - The account has not had any transactions or payment activity
424+
within a specified period. This status applies to accounts that are paused or
425+
closed due to inactivity.
426+
- `INTERNAL_REVIEW` - The account is temporarily paused pending further internal
427+
review. In future implementations, this status may prevent clients from
428+
activating the account via APIs until the review is completed.
429+
- `OTHER` - The reason for the account's current status does not fall into any
430+
of the above categories. A comment should be provided to specify the
431+
particular reason.
432+
345433
verification_address: Address used during Address Verification Service (AVS) checks during
346434
transactions if enabled via Auth Rules. This field is deprecated as AVS checks
347435
are no longer supported by Auth Rules. The field will be removed from the schema
@@ -361,10 +449,12 @@ async def update(
361449
f"/v1/accounts/{account_token}",
362450
body=await async_maybe_transform(
363451
{
452+
"comment": comment,
364453
"daily_spend_limit": daily_spend_limit,
365454
"lifetime_spend_limit": lifetime_spend_limit,
366455
"monthly_spend_limit": monthly_spend_limit,
367456
"state": state,
457+
"substatus": substatus,
368458
"verification_address": verification_address,
369459
},
370460
account_update_params.AccountUpdateParams,

src/lithic/resources/aggregate_balances.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def with_streaming_response(self) -> AggregateBalancesWithStreamingResponse:
4343
def list(
4444
self,
4545
*,
46-
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
46+
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] | NotGiven = NOT_GIVEN,
4747
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4848
# The extra values given here take precedence over values defined on the client or passed to this method.
4949
extra_headers: Headers | None = None,
@@ -106,7 +106,7 @@ def with_streaming_response(self) -> AsyncAggregateBalancesWithStreamingResponse
106106
def list(
107107
self,
108108
*,
109-
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
109+
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] | NotGiven = NOT_GIVEN,
110110
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111111
# The extra values given here take precedence over values defined on the client or passed to this method.
112112
extra_headers: Headers | None = None,

src/lithic/resources/balances.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def list(
4848
account_token: str | NotGiven = NOT_GIVEN,
4949
balance_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
5050
business_account_token: str | NotGiven = NOT_GIVEN,
51-
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
51+
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] | NotGiven = NOT_GIVEN,
5252
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5353
# The extra values given here take precedence over values defined on the client or passed to this method.
5454
extra_headers: Headers | None = None,
@@ -125,7 +125,7 @@ def list(
125125
account_token: str | NotGiven = NOT_GIVEN,
126126
balance_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
127127
business_account_token: str | NotGiven = NOT_GIVEN,
128-
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE"] | NotGiven = NOT_GIVEN,
128+
financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] | NotGiven = NOT_GIVEN,
129129
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
130130
# The extra values given here take precedence over values defined on the client or passed to this method.
131131
extra_headers: Headers | None = None,

0 commit comments

Comments
 (0)