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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.114.0"
".": "0.115.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 175
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ce2adff9b644ed4562b5342a4a43d0b40c98d43b4e063b4626f4ca5d342f1b92.yml
openapi_spec_hash: fbc84b866ce96457261ac58b4e75c71d
config_hash: 31d71922d7838f34ae0875c9b8026d99
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-05d665e9c7e81d85c0d6629bf3898e2eb221268d677b772ef3da3891b25d8346.yml
openapi_spec_hash: fd8900412ab9a393719dba3669d44d3a
config_hash: faacaff68ffb3a4d051f0a7b8442e099
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.115.0 (2026-01-30)

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

### Features

* **api:** Add naics_code to account holder requests/responses ([a7135fb](https://github.com/lithic-com/lithic-python/commit/a7135fb5f63687973cc1856731eb6c7f524994e3))
* **client:** add custom JSON encoder for extended type support ([5658dcc](https://github.com/lithic-com/lithic-python/commit/5658dccf4d989063d2d4ffdb243cfec17861a000))


### Chores

* configure new SDK language ([292317d](https://github.com/lithic-com/lithic-python/commit/292317d003f007992d8848fbe4a870164bac9d29))
* Enable stainless MCP in config ([a799eec](https://github.com/lithic-com/lithic-python/commit/a799eeca71933e98243cf351caf374b9a59d9ce9))

## 0.114.0 (2026-01-27)

Full Changelog: [v0.113.0...v0.114.0](https://github.com/lithic-com/lithic-python/compare/v0.113.0...v0.114.0)
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ The Lithic Python library provides convenient access to the Lithic REST API from
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

## MCP Server

Use the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D)

> Note: You may need to set environment variables in your MCP client.

## Documentation

The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). The full API of this library can be found in [api.md](api.md).
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lithic"
version = "0.114.0"
version = "0.115.0"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
7 changes: 5 additions & 2 deletions src/lithic/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
APIConnectionError,
APIResponseValidationError,
)
from ._utils._json import openapi_dumps
from ._legacy_response import LegacyAPIResponse

log: logging.Logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -555,8 +556,10 @@ def _build_request(
kwargs["content"] = options.content
elif isinstance(json_data, bytes):
kwargs["content"] = json_data
else:
kwargs["json"] = json_data if is_given(json_data) else None
elif not files:
# Don't set content when JSON is sent as multipart/form-data,
# since httpx's content param overrides other body arguments
kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
Expand Down
6 changes: 3 additions & 3 deletions src/lithic/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def model_dump(
exclude_defaults: bool = False,
warnings: bool = True,
mode: Literal["json", "python"] = "python",
by_alias: bool | None = None,
) -> dict[str, Any]:
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
return model.model_dump(
Expand All @@ -148,13 +149,12 @@ def model_dump(
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
by_alias=by_alias,
)
return cast(
"dict[str, Any]",
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
),
)

Expand Down
35 changes: 35 additions & 0 deletions src/lithic/_utils/_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import json
from typing import Any
from datetime import datetime
from typing_extensions import override

import pydantic

from .._compat import model_dump


def openapi_dumps(obj: Any) -> bytes:
"""
Serialize an object to UTF-8 encoded JSON bytes.
Extends the standard json.dumps with support for additional types
commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
"""
return json.dumps(
obj,
cls=_CustomEncoder,
# Uses the same defaults as httpx's JSON serialization
ensure_ascii=False,
separators=(",", ":"),
allow_nan=False,
).encode()


class _CustomEncoder(json.JSONEncoder):
@override
def default(self, o: Any) -> Any:
if isinstance(o, datetime):
return o.isoformat()
if isinstance(o, pydantic.BaseModel):
return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
return super().default(o)
2 changes: 1 addition & 1 deletion src/lithic/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "lithic"
__version__ = "0.114.0" # x-release-please-version
__version__ = "0.115.0" # x-release-please-version
32 changes: 32 additions & 0 deletions src/lithic/resources/account_holders.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def create(
beneficial_owner_entities: Iterable[account_holder_create_params.KYBBeneficialOwnerEntity] | Omit = omit,
external_id: str | Omit = omit,
kyb_passed_timestamp: str | Omit = omit,
naics_code: str | Omit = omit,
website_url: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -127,6 +128,9 @@ def create(

This field is required only if workflow type is `KYB_BYO`.

naics_code: 6-digit North American Industry Classification System (NAICS) code for the
business.

website_url: Company website URL.

extra_headers: Send extra headers
Expand All @@ -148,6 +152,7 @@ def create(
| Omit = omit,
control_person: account_holder_create_params.KYBDelegatedControlPerson | Omit = omit,
external_id: str | Omit = omit,
naics_code: str | Omit = omit,
nature_of_business: str | Omit = omit,
tos_timestamp: str | Omit = omit,
website_url: str | Omit = omit,
Expand Down Expand Up @@ -191,6 +196,9 @@ def create(
external_id: A user provided id that can be used to link an account holder with an external
system

naics_code: 6-digit North American Industry Classification System (NAICS) code for the
business.

nature_of_business: Short description of the company's line of business (i.e., what does the company
do?).

Expand Down Expand Up @@ -364,6 +372,7 @@ def create(
beneficial_owner_entities: Iterable[account_holder_create_params.KYBBeneficialOwnerEntity] | Omit = omit,
external_id: str | Omit = omit,
kyb_passed_timestamp: str | Omit = omit,
naics_code: str | Omit = omit,
website_url: str | Omit = omit,
individual: account_holder_create_params.KYCIndividual | Omit = omit,
kyc_passed_timestamp: str | Omit = omit,
Expand Down Expand Up @@ -396,6 +405,7 @@ def create(
"beneficial_owner_entities": beneficial_owner_entities,
"external_id": external_id,
"kyb_passed_timestamp": kyb_passed_timestamp,
"naics_code": naics_code,
"website_url": website_url,
"individual": individual,
"kyc_passed_timestamp": kyc_passed_timestamp,
Expand Down Expand Up @@ -463,6 +473,7 @@ def update(
business_entity: account_holder_update_params.KYBPatchRequestBusinessEntity | Omit = omit,
control_person: account_holder_update_params.KYBPatchRequestControlPerson | Omit = omit,
external_id: str | Omit = omit,
naics_code: str | Omit = omit,
nature_of_business: str | Omit = omit,
website_url: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -509,6 +520,9 @@ def update(
external_id: A user provided id that can be used to link an account holder with an external
system

naics_code: 6-digit North American Industry Classification System (NAICS) code for the
business.

nature_of_business: Short description of the company's line of business (i.e., what does the company
do?).

Expand Down Expand Up @@ -639,6 +653,7 @@ def update(
business_entity: account_holder_update_params.KYBPatchRequestBusinessEntity | Omit = omit,
control_person: account_holder_update_params.KYBPatchRequestControlPerson | Omit = omit,
external_id: str | Omit = omit,
naics_code: str | Omit = omit,
nature_of_business: str | Omit = omit,
website_url: str | Omit = omit,
individual: account_holder_update_params.KYCPatchRequestIndividual | Omit = omit,
Expand Down Expand Up @@ -671,6 +686,7 @@ def update(
"business_entity": business_entity,
"control_person": control_person,
"external_id": external_id,
"naics_code": naics_code,
"nature_of_business": nature_of_business,
"website_url": website_url,
"individual": individual,
Expand Down Expand Up @@ -1140,6 +1156,7 @@ async def create(
beneficial_owner_entities: Iterable[account_holder_create_params.KYBBeneficialOwnerEntity] | Omit = omit,
external_id: str | Omit = omit,
kyb_passed_timestamp: str | Omit = omit,
naics_code: str | Omit = omit,
website_url: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -1197,6 +1214,9 @@ async def create(

This field is required only if workflow type is `KYB_BYO`.

naics_code: 6-digit North American Industry Classification System (NAICS) code for the
business.

website_url: Company website URL.

extra_headers: Send extra headers
Expand All @@ -1218,6 +1238,7 @@ async def create(
| Omit = omit,
control_person: account_holder_create_params.KYBDelegatedControlPerson | Omit = omit,
external_id: str | Omit = omit,
naics_code: str | Omit = omit,
nature_of_business: str | Omit = omit,
tos_timestamp: str | Omit = omit,
website_url: str | Omit = omit,
Expand Down Expand Up @@ -1261,6 +1282,9 @@ async def create(
external_id: A user provided id that can be used to link an account holder with an external
system

naics_code: 6-digit North American Industry Classification System (NAICS) code for the
business.

nature_of_business: Short description of the company's line of business (i.e., what does the company
do?).

Expand Down Expand Up @@ -1434,6 +1458,7 @@ async def create(
beneficial_owner_entities: Iterable[account_holder_create_params.KYBBeneficialOwnerEntity] | Omit = omit,
external_id: str | Omit = omit,
kyb_passed_timestamp: str | Omit = omit,
naics_code: str | Omit = omit,
website_url: str | Omit = omit,
individual: account_holder_create_params.KYCIndividual | Omit = omit,
kyc_passed_timestamp: str | Omit = omit,
Expand Down Expand Up @@ -1466,6 +1491,7 @@ async def create(
"beneficial_owner_entities": beneficial_owner_entities,
"external_id": external_id,
"kyb_passed_timestamp": kyb_passed_timestamp,
"naics_code": naics_code,
"website_url": website_url,
"individual": individual,
"kyc_passed_timestamp": kyc_passed_timestamp,
Expand Down Expand Up @@ -1533,6 +1559,7 @@ async def update(
business_entity: account_holder_update_params.KYBPatchRequestBusinessEntity | Omit = omit,
control_person: account_holder_update_params.KYBPatchRequestControlPerson | Omit = omit,
external_id: str | Omit = omit,
naics_code: str | Omit = omit,
nature_of_business: str | Omit = omit,
website_url: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -1579,6 +1606,9 @@ async def update(
external_id: A user provided id that can be used to link an account holder with an external
system

naics_code: 6-digit North American Industry Classification System (NAICS) code for the
business.

nature_of_business: Short description of the company's line of business (i.e., what does the company
do?).

Expand Down Expand Up @@ -1709,6 +1739,7 @@ async def update(
business_entity: account_holder_update_params.KYBPatchRequestBusinessEntity | Omit = omit,
control_person: account_holder_update_params.KYBPatchRequestControlPerson | Omit = omit,
external_id: str | Omit = omit,
naics_code: str | Omit = omit,
nature_of_business: str | Omit = omit,
website_url: str | Omit = omit,
individual: account_holder_update_params.KYCPatchRequestIndividual | Omit = omit,
Expand Down Expand Up @@ -1741,6 +1772,7 @@ async def update(
"business_entity": business_entity,
"control_person": control_person,
"external_id": external_id,
"naics_code": naics_code,
"nature_of_business": nature_of_business,
"website_url": website_url,
"individual": individual,
Expand Down
11 changes: 9 additions & 2 deletions src/lithic/types/account_holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ class AccountHolder(BaseModel):
is being run.
"""

naics_code: Optional[str] = None
"""Only present when user_type == "BUSINESS".

6-digit North American Industry Classification System (NAICS) code for the
business.
"""

nature_of_business: Optional[str] = None
"""Only present when user_type == "BUSINESS".

Expand Down Expand Up @@ -347,8 +354,8 @@ class AccountHolder(BaseModel):

If the type is "INDIVIDUAL", the "individual" attribute will be present. If the
type is "BUSINESS" then the "business_entity", "control_person",
"beneficial_owner_individuals", "nature_of_business", and "website_url"
attributes will be present.
"beneficial_owner_individuals", "naics_code", "nature_of_business", and
"website_url" attributes will be present.
"""

verification_application: Optional[VerificationApplication] = None
Expand Down
12 changes: 12 additions & 0 deletions src/lithic/types/account_holder_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class KYB(TypedDict, total=False):
This field is required only if workflow type is `KYB_BYO`.
"""

naics_code: str
"""
6-digit North American Industry Classification System (NAICS) code for the
business.
"""

website_url: str
"""Company website URL."""

Expand Down Expand Up @@ -270,6 +276,12 @@ class KYBDelegated(TypedDict, total=False):
system
"""

naics_code: str
"""
6-digit North American Industry Classification System (NAICS) code for the
business.
"""

nature_of_business: str
"""
Short description of the company's line of business (i.e., what does the company
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ class AccountHolderSimulateEnrollmentReviewResponse(BaseModel):
is being run.
"""

naics_code: Optional[str] = None
"""Only present when user_type == "BUSINESS".

6-digit North American Industry Classification System (NAICS) code for the
business.
"""

nature_of_business: Optional[str] = None
"""Only present when user_type == "BUSINESS".

Expand Down Expand Up @@ -425,8 +432,8 @@ class AccountHolderSimulateEnrollmentReviewResponse(BaseModel):
If the type is "INDIVIDUAL", the "individual" attribute will be present.

If the type is "BUSINESS" then the "business_entity", "control_person",
"beneficial_owner_individuals", "nature_of_business", and "website_url"
attributes will be present.
"beneficial_owner_individuals", "naics_code", "nature_of_business", and
"website_url" attributes will be present.
"""

verification_application: Optional[VerificationApplication] = None
Expand Down
Loading