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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.105.0"
".": "0.106.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 168
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1d44bb7fad99487af1161eb24dfd5369440eda7e80ed237cbc1acc6802a7d212.yml
openapi_spec_hash: 1b6b6215b60094b76b91c56b925a251a
config_hash: ac676e77c8ca051c7aad978c26e96345
config_hash: e68a052fd109c0885732114753abc739
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.106.0 (2025-09-10)

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

### Features

* **api:** rename endpoint ([ee65354](https://github.com/lithic-com/lithic-python/commit/ee6535445d9d8d0cc0b54fc6e18e1a7d24157e4d))

## 0.105.0 (2025-09-09)

Full Changelog: [v0.104.0...v0.105.0](https://github.com/lithic-com/lithic-python/compare/v0.104.0...v0.105.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ from lithic.types import (
TransactionSimulateAuthorizationAdviceResponse,
TransactionSimulateClearingResponse,
TransactionSimulateCreditAuthorizationResponse,
TransactionSimulateCreditAuthorizationAdviceResponse,
TransactionSimulateReturnResponse,
TransactionSimulateReturnReversalResponse,
TransactionSimulateVoidResponse,
Expand All @@ -441,6 +442,7 @@ Methods:
- <code title="post /v1/simulate/authorization_advice">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_authorization_advice</a>(\*\*<a href="src/lithic/types/transaction_simulate_authorization_advice_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_authorization_advice_response.py">TransactionSimulateAuthorizationAdviceResponse</a></code>
- <code title="post /v1/simulate/clearing">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_clearing</a>(\*\*<a href="src/lithic/types/transaction_simulate_clearing_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_clearing_response.py">TransactionSimulateClearingResponse</a></code>
- <code title="post /v1/simulate/credit_authorization_advice">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_credit_authorization</a>(\*\*<a href="src/lithic/types/transaction_simulate_credit_authorization_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_credit_authorization_response.py">TransactionSimulateCreditAuthorizationResponse</a></code>
- <code title="post /v1/simulate/credit_authorization_advice">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_credit_authorization_advice</a>(\*\*<a href="src/lithic/types/transaction_simulate_credit_authorization_advice_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_credit_authorization_advice_response.py">TransactionSimulateCreditAuthorizationAdviceResponse</a></code>
- <code title="post /v1/simulate/return">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_return</a>(\*\*<a href="src/lithic/types/transaction_simulate_return_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_return_response.py">TransactionSimulateReturnResponse</a></code>
- <code title="post /v1/simulate/return_reversal">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_return_reversal</a>(\*\*<a href="src/lithic/types/transaction_simulate_return_reversal_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_return_reversal_response.py">TransactionSimulateReturnReversalResponse</a></code>
- <code title="post /v1/simulate/void">client.transactions.<a href="./src/lithic/resources/transactions/transactions.py">simulate_void</a>(\*\*<a href="src/lithic/types/transaction_simulate_void_params.py">params</a>) -> <a href="./src/lithic/types/transaction_simulate_void_response.py">TransactionSimulateVoidResponse</a></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.105.0"
version = "0.106.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.105.0" # x-release-please-version
__version__ = "0.106.0" # x-release-please-version
165 changes: 157 additions & 8 deletions src/lithic/resources/transactions/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import typing_extensions
from typing import Union
from datetime import datetime
from typing_extensions import Literal
Expand All @@ -18,6 +19,7 @@
transaction_simulate_return_reversal_params,
transaction_simulate_authorization_advice_params,
transaction_simulate_credit_authorization_params,
transaction_simulate_credit_authorization_advice_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
from ..._utils import maybe_transform, async_maybe_transform
Expand Down Expand Up @@ -50,6 +52,9 @@
from ...types.transaction_simulate_return_reversal_response import TransactionSimulateReturnReversalResponse
from ...types.transaction_simulate_authorization_advice_response import TransactionSimulateAuthorizationAdviceResponse
from ...types.transaction_simulate_credit_authorization_response import TransactionSimulateCreditAuthorizationResponse
from ...types.transaction_simulate_credit_authorization_advice_response import (
TransactionSimulateCreditAuthorizationAdviceResponse,
)

__all__ = ["Transactions", "AsyncTransactions"]

Expand Down Expand Up @@ -449,6 +454,7 @@ def simulate_clearing(
cast_to=TransactionSimulateClearingResponse,
)

@typing_extensions.deprecated("use `simulate_credit_authorization_advice` instead")
def simulate_credit_authorization(
self,
*,
Expand Down Expand Up @@ -510,6 +516,67 @@ def simulate_credit_authorization(
cast_to=TransactionSimulateCreditAuthorizationResponse,
)

def simulate_credit_authorization_advice(
self,
*,
amount: int,
descriptor: str,
pan: str,
mcc: str | NotGiven = NOT_GIVEN,
merchant_acceptor_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.
# 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,
) -> TransactionSimulateCreditAuthorizationAdviceResponse:
"""Simulates a credit authorization advice from the card network.

This message
indicates that the network approved a credit authorization on your behalf.

Args:
amount: Amount (in cents). Any value entered will be converted into a negative amount in
the simulated transaction. For example, entering 100 in this field will appear
as a -100 amount in the transaction.

descriptor: Merchant descriptor.

pan: Sixteen digit card number.

mcc: Merchant category code for the transaction to be simulated. A four-digit number
listed in ISO 18245. Supported merchant category codes can be found
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).

merchant_acceptor_id: Unique identifier to identify the payment card acceptor.

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._post(
"/v1/simulate/credit_authorization_advice",
body=maybe_transform(
{
"amount": amount,
"descriptor": descriptor,
"pan": pan,
"mcc": mcc,
"merchant_acceptor_id": merchant_acceptor_id,
},
transaction_simulate_credit_authorization_advice_params.TransactionSimulateCreditAuthorizationAdviceParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TransactionSimulateCreditAuthorizationAdviceResponse,
)

def simulate_return(
self,
*,
Expand Down Expand Up @@ -1051,6 +1118,7 @@ async def simulate_clearing(
cast_to=TransactionSimulateClearingResponse,
)

@typing_extensions.deprecated("use `simulate_credit_authorization_advice` instead")
async def simulate_credit_authorization(
self,
*,
Expand Down Expand Up @@ -1112,6 +1180,67 @@ async def simulate_credit_authorization(
cast_to=TransactionSimulateCreditAuthorizationResponse,
)

async def simulate_credit_authorization_advice(
self,
*,
amount: int,
descriptor: str,
pan: str,
mcc: str | NotGiven = NOT_GIVEN,
merchant_acceptor_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.
# 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,
) -> TransactionSimulateCreditAuthorizationAdviceResponse:
"""Simulates a credit authorization advice from the card network.

This message
indicates that the network approved a credit authorization on your behalf.

Args:
amount: Amount (in cents). Any value entered will be converted into a negative amount in
the simulated transaction. For example, entering 100 in this field will appear
as a -100 amount in the transaction.

descriptor: Merchant descriptor.

pan: Sixteen digit card number.

mcc: Merchant category code for the transaction to be simulated. A four-digit number
listed in ISO 18245. Supported merchant category codes can be found
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).

merchant_acceptor_id: Unique identifier to identify the payment card acceptor.

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 await self._post(
"/v1/simulate/credit_authorization_advice",
body=await async_maybe_transform(
{
"amount": amount,
"descriptor": descriptor,
"pan": pan,
"mcc": mcc,
"merchant_acceptor_id": merchant_acceptor_id,
},
transaction_simulate_credit_authorization_advice_params.TransactionSimulateCreditAuthorizationAdviceParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=TransactionSimulateCreditAuthorizationAdviceResponse,
)

async def simulate_return(
self,
*,
Expand Down Expand Up @@ -1280,8 +1409,13 @@ def __init__(self, transactions: Transactions) -> None:
self.simulate_clearing = _legacy_response.to_raw_response_wrapper(
transactions.simulate_clearing,
)
self.simulate_credit_authorization = _legacy_response.to_raw_response_wrapper(
transactions.simulate_credit_authorization,
self.simulate_credit_authorization = ( # pyright: ignore[reportDeprecated]
_legacy_response.to_raw_response_wrapper(
transactions.simulate_credit_authorization, # pyright: ignore[reportDeprecated],
)
)
self.simulate_credit_authorization_advice = _legacy_response.to_raw_response_wrapper(
transactions.simulate_credit_authorization_advice,
)
self.simulate_return = _legacy_response.to_raw_response_wrapper(
transactions.simulate_return,
Expand Down Expand Up @@ -1324,8 +1458,13 @@ def __init__(self, transactions: AsyncTransactions) -> None:
self.simulate_clearing = _legacy_response.async_to_raw_response_wrapper(
transactions.simulate_clearing,
)
self.simulate_credit_authorization = _legacy_response.async_to_raw_response_wrapper(
transactions.simulate_credit_authorization,
self.simulate_credit_authorization = ( # pyright: ignore[reportDeprecated]
_legacy_response.async_to_raw_response_wrapper(
transactions.simulate_credit_authorization, # pyright: ignore[reportDeprecated],
)
)
self.simulate_credit_authorization_advice = _legacy_response.async_to_raw_response_wrapper(
transactions.simulate_credit_authorization_advice,
)
self.simulate_return = _legacy_response.async_to_raw_response_wrapper(
transactions.simulate_return,
Expand Down Expand Up @@ -1368,8 +1507,13 @@ def __init__(self, transactions: Transactions) -> None:
self.simulate_clearing = to_streamed_response_wrapper(
transactions.simulate_clearing,
)
self.simulate_credit_authorization = to_streamed_response_wrapper(
transactions.simulate_credit_authorization,
self.simulate_credit_authorization = ( # pyright: ignore[reportDeprecated]
to_streamed_response_wrapper(
transactions.simulate_credit_authorization, # pyright: ignore[reportDeprecated],
)
)
self.simulate_credit_authorization_advice = to_streamed_response_wrapper(
transactions.simulate_credit_authorization_advice,
)
self.simulate_return = to_streamed_response_wrapper(
transactions.simulate_return,
Expand Down Expand Up @@ -1412,8 +1556,13 @@ def __init__(self, transactions: AsyncTransactions) -> None:
self.simulate_clearing = async_to_streamed_response_wrapper(
transactions.simulate_clearing,
)
self.simulate_credit_authorization = async_to_streamed_response_wrapper(
transactions.simulate_credit_authorization,
self.simulate_credit_authorization = ( # pyright: ignore[reportDeprecated]
async_to_streamed_response_wrapper(
transactions.simulate_credit_authorization, # pyright: ignore[reportDeprecated],
)
)
self.simulate_credit_authorization_advice = async_to_streamed_response_wrapper(
transactions.simulate_credit_authorization_advice,
)
self.simulate_return = async_to_streamed_response_wrapper(
transactions.simulate_return,
Expand Down
6 changes: 6 additions & 0 deletions src/lithic/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@
from .external_bank_account_retry_micro_deposits_response import (
ExternalBankAccountRetryMicroDepositsResponse as ExternalBankAccountRetryMicroDepositsResponse,
)
from .transaction_simulate_credit_authorization_advice_params import (
TransactionSimulateCreditAuthorizationAdviceParams as TransactionSimulateCreditAuthorizationAdviceParams,
)
from .account_holder_simulate_enrollment_document_review_params import (
AccountHolderSimulateEnrollmentDocumentReviewParams as AccountHolderSimulateEnrollmentDocumentReviewParams,
)
from .transaction_simulate_credit_authorization_advice_response import (
TransactionSimulateCreditAuthorizationAdviceResponse as TransactionSimulateCreditAuthorizationAdviceResponse,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, TypedDict

__all__ = ["TransactionSimulateCreditAuthorizationAdviceParams"]


class TransactionSimulateCreditAuthorizationAdviceParams(TypedDict, total=False):
amount: Required[int]
"""Amount (in cents).

Any value entered will be converted into a negative amount in the simulated
transaction. For example, entering 100 in this field will appear as a -100
amount in the transaction.
"""

descriptor: Required[str]
"""Merchant descriptor."""

pan: Required[str]
"""Sixteen digit card number."""

mcc: str
"""Merchant category code for the transaction to be simulated.

A four-digit number listed in ISO 18245. Supported merchant category codes can
be found
[here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
"""

merchant_acceptor_id: str
"""Unique identifier to identify the payment card acceptor."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from .._models import BaseModel

__all__ = ["TransactionSimulateCreditAuthorizationAdviceResponse"]


class TransactionSimulateCreditAuthorizationAdviceResponse(BaseModel):
token: Optional[str] = None
"""A unique token to reference this transaction."""

debugging_request_id: Optional[str] = None
"""Debugging request ID to share with Lithic Support team."""
Loading