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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
Expand Down
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.99.0"
".": "0.100.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 166
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-54e6f7955e86265bc870eaae7f4a9cd716292457a83e032567f22bbb9ce6ad0d.yml
openapi_spec_hash: 6adbff5e5aeda88504047fc2c87e3fa0
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa089e65735b8884f8cb391b39b9a0b295819e438bf976c98cc6150628ca5488.yml
openapi_spec_hash: 719876533d1496e9192c7a734a78c736
config_hash: e9a46eb8acb9dc2c236f3e1958a1c4dd
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.100.0 (2025-07-28)

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

### Features

* **api:** updates Transaction retrieve response to match API ([f659cd3](https://github.com/lithic-com/lithic-python/commit/f659cd3179c6ee214ab01d5dbc176931b1b503be))


### Chores

* **project:** add settings file for vscode ([5dc0933](https://github.com/lithic-com/lithic-python/commit/5dc09332b73ffe63937ca60a419e9e0c5ca533d9))

## 0.99.0 (2025-07-23)

Full Changelog: [v0.98.2...v0.99.0](https://github.com/lithic-com/lithic-python/compare/v0.98.2...v0.99.0)
Expand Down
3 changes: 1 addition & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,14 @@ Types:
```python
from lithic.types import (
Tokenization,
TokenizationRetrieveResponse,
TokenizationSimulateResponse,
TokenizationUpdateDigitalCardArtResponse,
)
```

Methods:

- <code title="get /v1/tokenizations/{tokenization_token}">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">retrieve</a>(tokenization_token) -> <a href="./src/lithic/types/tokenization_retrieve_response.py">TokenizationRetrieveResponse</a></code>
- <code title="get /v1/tokenizations/{tokenization_token}">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">retrieve</a>(tokenization_token) -> <a href="./src/lithic/types/tokenization.py">Tokenization</a></code>
- <code title="get /v1/tokenizations">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">list</a>(\*\*<a href="src/lithic/types/tokenization_list_params.py">params</a>) -> <a href="./src/lithic/types/tokenization.py">SyncCursorPage[Tokenization]</a></code>
- <code title="post /v1/tokenizations/{tokenization_token}/activate">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">activate</a>(tokenization_token) -> None</code>
- <code title="post /v1/tokenizations/{tokenization_token}/deactivate">client.tokenizations.<a href="./src/lithic/resources/tokenizations.py">deactivate</a>(tokenization_token) -> None</code>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lithic"
version = "0.99.0"
version = "0.100.0"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/lithic/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "lithic"
__version__ = "0.99.0" # x-release-please-version
__version__ = "0.100.0" # x-release-please-version
9 changes: 4 additions & 5 deletions src/lithic/resources/tokenizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from ..pagination import SyncCursorPage, AsyncCursorPage
from .._base_client import AsyncPaginator, make_request_options
from ..types.tokenization import Tokenization
from ..types.tokenization_retrieve_response import TokenizationRetrieveResponse
from ..types.tokenization_simulate_response import TokenizationSimulateResponse
from ..types.tokenization_update_digital_card_art_response import TokenizationUpdateDigitalCardArtResponse

Expand Down Expand Up @@ -60,7 +59,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TokenizationRetrieveResponse:
) -> Tokenization:
"""
Get tokenization

Expand All @@ -80,7 +79,7 @@ def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TokenizationRetrieveResponse,
cast_to=Tokenization,
)

def list(
Expand Down Expand Up @@ -526,7 +525,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TokenizationRetrieveResponse:
) -> Tokenization:
"""
Get tokenization

Expand All @@ -546,7 +545,7 @@ async def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TokenizationRetrieveResponse,
cast_to=Tokenization,
)

def list(
Expand Down
1 change: 0 additions & 1 deletion src/lithic/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
from .external_payment_settle_params import ExternalPaymentSettleParams as ExternalPaymentSettleParams
from .payment_simulate_action_params import PaymentSimulateActionParams as PaymentSimulateActionParams
from .payment_simulate_return_params import PaymentSimulateReturnParams as PaymentSimulateReturnParams
from .tokenization_retrieve_response import TokenizationRetrieveResponse as TokenizationRetrieveResponse
from .tokenization_simulate_response import TokenizationSimulateResponse as TokenizationSimulateResponse
from .external_payment_release_params import ExternalPaymentReleaseParams as ExternalPaymentReleaseParams
from .external_payment_reverse_params import ExternalPaymentReverseParams as ExternalPaymentReverseParams
Expand Down
28 changes: 17 additions & 11 deletions src/lithic/types/external_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,33 @@ class Event(BaseModel):

class ExternalPayment(BaseModel):
token: str

category: Literal["EXTERNAL_WIRE", "EXTERNAL_ACH", "EXTERNAL_CHECK", "EXTERNAL_TRANSFER"]
"""Unique identifier for the transaction"""

created: datetime
"""ISO 8601 timestamp of when the transaction was created"""

currency: str
family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"]

events: List[Event]
status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
"""The status of the transaction"""

financial_account_token: str
updated: datetime
"""ISO 8601 timestamp of when the transaction was last updated"""

payment_type: Literal["DEPOSIT", "WITHDRAWAL"]
category: Optional[Literal["EXTERNAL_WIRE", "EXTERNAL_ACH", "EXTERNAL_CHECK", "EXTERNAL_TRANSFER"]] = None

pending_amount: int
currency: Optional[str] = None

result: Literal["APPROVED", "DECLINED"]
events: Optional[List[Event]] = None

settled_amount: int
financial_account_token: Optional[str] = None

status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
payment_type: Optional[Literal["DEPOSIT", "WITHDRAWAL"]] = None

updated: datetime
pending_amount: Optional[int] = None

result: Optional[Literal["APPROVED", "DECLINED"]] = None

settled_amount: Optional[int] = None

user_defined_id: Optional[str] = None
44 changes: 28 additions & 16 deletions src/lithic/types/management_operation_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,46 @@ class TransactionSeries(BaseModel):

class ManagementOperationTransaction(BaseModel):
token: str

category: Literal[
"MANAGEMENT_FEE", "MANAGEMENT_DISPUTE", "MANAGEMENT_REWARD", "MANAGEMENT_ADJUSTMENT", "MANAGEMENT_DISBURSEMENT"
]
"""Unique identifier for the transaction"""

created: datetime
"""ISO 8601 timestamp of when the transaction was created"""

currency: str
family: Literal["CARD", "PAYMENT", "TRANSFER", "INTERNAL", "EXTERNAL_PAYMENT", "MANAGEMENT_OPERATION"]

direction: Literal["CREDIT", "DEBIT"]
status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
"""The status of the transaction"""

events: List[Event]
updated: datetime
"""ISO 8601 timestamp of when the transaction was last updated"""

financial_account_token: str
category: Optional[
Literal[
"MANAGEMENT_FEE",
"MANAGEMENT_DISPUTE",
"MANAGEMENT_REWARD",
"MANAGEMENT_ADJUSTMENT",
"MANAGEMENT_DISBURSEMENT",
]
] = None

pending_amount: int
currency: Optional[str] = None

result: Literal["APPROVED", "DECLINED"]
direction: Optional[Literal["CREDIT", "DEBIT"]] = None

settled_amount: int
events: Optional[List[Event]] = None

status: Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED"]
external_resource: Optional[ExternalResource] = None
"""External resource associated with the management operation"""

transaction_series: Optional[TransactionSeries] = None
financial_account_token: Optional[str] = None

updated: datetime
pending_amount: Optional[int] = None

external_resource: Optional[ExternalResource] = None
"""External resource associated with the management operation"""
result: Optional[Literal["APPROVED", "DECLINED"]] = None

settled_amount: Optional[int] = None

transaction_series: Optional[TransactionSeries] = None

user_defined_id: Optional[str] = None
12 changes: 0 additions & 12 deletions src/lithic/types/tokenization_retrieve_response.py

This file was deleted.

16 changes: 8 additions & 8 deletions tests/api_resources/test_management_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TestManagementOperations:
@parametrize
def test_method_create(self, client: Lithic) -> None:
management_operation = client.management_operations.create(
amount=0,
amount=1,
category="MANAGEMENT_FEE",
direction="CREDIT",
effective_date=parse_date("2019-12-27"),
Expand All @@ -36,7 +36,7 @@ def test_method_create(self, client: Lithic) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Lithic) -> None:
management_operation = client.management_operations.create(
amount=0,
amount=1,
category="MANAGEMENT_FEE",
direction="CREDIT",
effective_date=parse_date("2019-12-27"),
Expand All @@ -53,7 +53,7 @@ def test_method_create_with_all_params(self, client: Lithic) -> None:
@parametrize
def test_raw_response_create(self, client: Lithic) -> None:
response = client.management_operations.with_raw_response.create(
amount=0,
amount=1,
category="MANAGEMENT_FEE",
direction="CREDIT",
effective_date=parse_date("2019-12-27"),
Expand All @@ -69,7 +69,7 @@ def test_raw_response_create(self, client: Lithic) -> None:
@parametrize
def test_streaming_response_create(self, client: Lithic) -> None:
with client.management_operations.with_streaming_response.create(
amount=0,
amount=1,
category="MANAGEMENT_FEE",
direction="CREDIT",
effective_date=parse_date("2019-12-27"),
Expand Down Expand Up @@ -226,7 +226,7 @@ class TestAsyncManagementOperations:
@parametrize
async def test_method_create(self, async_client: AsyncLithic) -> None:
management_operation = await async_client.management_operations.create(
amount=0,
amount=1,
category="MANAGEMENT_FEE",
direction="CREDIT",
effective_date=parse_date("2019-12-27"),
Expand All @@ -238,7 +238,7 @@ async def test_method_create(self, async_client: AsyncLithic) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncLithic) -> None:
management_operation = await async_client.management_operations.create(
amount=0,
amount=1,
category="MANAGEMENT_FEE",
direction="CREDIT",
effective_date=parse_date("2019-12-27"),
Expand All @@ -255,7 +255,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLithic) ->
@parametrize
async def test_raw_response_create(self, async_client: AsyncLithic) -> None:
response = await async_client.management_operations.with_raw_response.create(
amount=0,
amount=1,
category="MANAGEMENT_FEE",
direction="CREDIT",
effective_date=parse_date("2019-12-27"),
Expand All @@ -271,7 +271,7 @@ async def test_raw_response_create(self, async_client: AsyncLithic) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncLithic) -> None:
async with async_client.management_operations.with_streaming_response.create(
amount=0,
amount=1,
category="MANAGEMENT_FEE",
direction="CREDIT",
effective_date=parse_date("2019-12-27"),
Expand Down
13 changes: 6 additions & 7 deletions tests/api_resources/test_tokenizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from tests.utils import assert_matches_type
from lithic.types import (
Tokenization,
TokenizationRetrieveResponse,
TokenizationSimulateResponse,
TokenizationUpdateDigitalCardArtResponse,
)
Expand All @@ -29,7 +28,7 @@ def test_method_retrieve(self, client: Lithic) -> None:
tokenization = client.tokenizations.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
assert_matches_type(Tokenization, tokenization, path=["response"])

@parametrize
def test_raw_response_retrieve(self, client: Lithic) -> None:
Expand All @@ -40,7 +39,7 @@ def test_raw_response_retrieve(self, client: Lithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tokenization = response.parse()
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
assert_matches_type(Tokenization, tokenization, path=["response"])

@parametrize
def test_streaming_response_retrieve(self, client: Lithic) -> None:
Expand All @@ -51,7 +50,7 @@ def test_streaming_response_retrieve(self, client: Lithic) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

tokenization = response.parse()
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
assert_matches_type(Tokenization, tokenization, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -410,7 +409,7 @@ async def test_method_retrieve(self, async_client: AsyncLithic) -> None:
tokenization = await async_client.tokenizations.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
assert_matches_type(Tokenization, tokenization, path=["response"])

@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
Expand All @@ -421,7 +420,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncLithic) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
tokenization = response.parse()
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
assert_matches_type(Tokenization, tokenization, path=["response"])

@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> None:
Expand All @@ -432,7 +431,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncLithic) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

tokenization = await response.parse()
assert_matches_type(TokenizationRetrieveResponse, tokenization, path=["response"])
assert_matches_type(Tokenization, tokenization, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down