From e424839de5a127d48086c9dd1ed5ec7146cdfd6a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:11:29 +0000 Subject: [PATCH 01/15] fix(types): make substatus/funding optional, add exemption_type enum value --- .stats.yml | 4 +- src/lithic/resources/accounts.py | 42 ++++++++++--------- ...der_simulate_enrollment_review_response.py | 2 +- .../types/account_holder_update_response.py | 2 +- src/lithic/types/account_update_params.py | 21 ++++++---- src/lithic/types/non_pci_card.py | 6 +-- 6 files changed, 42 insertions(+), 35 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4645bd0f..6d39a89c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d29b68bb85936070878d8badaa8a7c5991313285e70a990bc812c838eba85373.yml -openapi_spec_hash: 54b44da68df22eb0ea99f2bc564667a2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-dc8aacc11d74a1e25c95ba549dd0f4a4e735cbf7562fc6b17b0c81d62fd5475c.yml +openapi_spec_hash: 1906583f260a3e9ace5ae38fd2254763 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/src/lithic/resources/accounts.py b/src/lithic/resources/accounts.py index 703f3b47..073f1320 100644 --- a/src/lithic/resources/accounts.py +++ b/src/lithic/resources/accounts.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import Union, Optional from datetime import datetime from typing_extensions import Literal @@ -85,15 +85,17 @@ def update( lifetime_spend_limit: int | Omit = omit, monthly_spend_limit: int | Omit = omit, state: Literal["ACTIVE", "PAUSED", "CLOSED"] | Omit = omit, - substatus: Literal[ - "FRAUD_IDENTIFIED", - "SUSPICIOUS_ACTIVITY", - "RISK_VIOLATION", - "END_USER_REQUEST", - "ISSUER_REQUEST", - "NOT_ACTIVE", - "INTERNAL_REVIEW", - "OTHER", + substatus: Optional[ + Literal[ + "FRAUD_IDENTIFIED", + "SUSPICIOUS_ACTIVITY", + "RISK_VIOLATION", + "END_USER_REQUEST", + "ISSUER_REQUEST", + "NOT_ACTIVE", + "INTERNAL_REVIEW", + "OTHER", + ] ] | Omit = omit, verification_address: account_update_params.VerificationAddress | Omit = omit, @@ -357,15 +359,17 @@ async def update( lifetime_spend_limit: int | Omit = omit, monthly_spend_limit: int | Omit = omit, state: Literal["ACTIVE", "PAUSED", "CLOSED"] | Omit = omit, - substatus: Literal[ - "FRAUD_IDENTIFIED", - "SUSPICIOUS_ACTIVITY", - "RISK_VIOLATION", - "END_USER_REQUEST", - "ISSUER_REQUEST", - "NOT_ACTIVE", - "INTERNAL_REVIEW", - "OTHER", + substatus: Optional[ + Literal[ + "FRAUD_IDENTIFIED", + "SUSPICIOUS_ACTIVITY", + "RISK_VIOLATION", + "END_USER_REQUEST", + "ISSUER_REQUEST", + "NOT_ACTIVE", + "INTERNAL_REVIEW", + "OTHER", + ] ] | Omit = omit, verification_address: account_update_params.VerificationAddress | Omit = omit, diff --git a/src/lithic/types/account_holder_simulate_enrollment_review_response.py b/src/lithic/types/account_holder_simulate_enrollment_review_response.py index 7a8e9b73..067cff10 100644 --- a/src/lithic/types/account_holder_simulate_enrollment_review_response.py +++ b/src/lithic/types/account_holder_simulate_enrollment_review_response.py @@ -336,7 +336,7 @@ class AccountHolderSimulateEnrollmentReviewResponse(BaseModel): exemption_type: Optional[Literal["AUTHORIZED_USER", "PREPAID_CARD_USER"]] = None """The type of KYC exemption for a KYC-Exempt Account Holder. - "None" if the account holder is not KYC-Exempt. + `null` if the account holder is not KYC-Exempt. """ external_id: Optional[str] = None diff --git a/src/lithic/types/account_holder_update_response.py b/src/lithic/types/account_holder_update_response.py index e8d3e882..b46b39c2 100644 --- a/src/lithic/types/account_holder_update_response.py +++ b/src/lithic/types/account_holder_update_response.py @@ -339,7 +339,7 @@ class KYBKYCPatchResponse(BaseModel): exemption_type: Optional[Literal["AUTHORIZED_USER", "PREPAID_CARD_USER"]] = None """The type of KYC exemption for a KYC-Exempt Account Holder. - "None" if the account holder is not KYC-Exempt. + `null` if the account holder is not KYC-Exempt. """ external_id: Optional[str] = None diff --git a/src/lithic/types/account_update_params.py b/src/lithic/types/account_update_params.py index 954590e8..b8a12e19 100644 --- a/src/lithic/types/account_update_params.py +++ b/src/lithic/types/account_update_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Literal, TypedDict __all__ = ["AccountUpdateParams", "VerificationAddress"] @@ -39,15 +40,17 @@ 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", + substatus: Optional[ + Literal[ + "FRAUD_IDENTIFIED", + "SUSPICIOUS_ACTIVITY", + "RISK_VIOLATION", + "END_USER_REQUEST", + "ISSUER_REQUEST", + "NOT_ACTIVE", + "INTERNAL_REVIEW", + "OTHER", + ] ] """Account state substatus values: diff --git a/src/lithic/types/non_pci_card.py b/src/lithic/types/non_pci_card.py index 9c1897f5..25345315 100644 --- a/src/lithic/types/non_pci_card.py +++ b/src/lithic/types/non_pci_card.py @@ -11,7 +11,7 @@ class Funding(BaseModel): - """Deprecated: Funding account for the card.""" + """Funding account for a card""" token: str """A globally unique identifier for this FundingAccount.""" @@ -65,8 +65,8 @@ class NonPCICard(BaseModel): created: datetime """An RFC 3339 timestamp for when the card was created. UTC time zone.""" - funding: Funding - """Deprecated: Funding account for the card.""" + funding: Optional[Funding] = None + """Funding account for a card""" last_four: str """Last four digits of the card number.""" From a309c98244ec118cd88eeb7de32d2f79e85d6bbb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:35:15 +0000 Subject: [PATCH 02/15] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6d39a89c..ba0cfe28 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-dc8aacc11d74a1e25c95ba549dd0f4a4e735cbf7562fc6b17b0c81d62fd5475c.yml -openapi_spec_hash: 1906583f260a3e9ace5ae38fd2254763 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-599dd2ac665b09566a84c4871ffb3b7313f6b40d0808b8ab4df63bec608b4f9f.yml +openapi_spec_hash: 429e0ad5e3aae4f63935859c2ac64fdc config_hash: ac8326134e692f3f3bdec82396bbec80 From 0df0d6cf2e2691b4979e5727dd88781229b7e831 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 13:58:08 +0000 Subject: [PATCH 03/15] chore(internal): more robust bootstrap script --- scripts/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index b430fee3..fe8451e4 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response From a429a2e6c8915f857d692f567951b03b392791ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:46:34 +0000 Subject: [PATCH 04/15] feat(api): add AMEX to network enum in settlement reports --- .stats.yml | 4 ++-- src/lithic/resources/reports/settlement/network_totals.py | 4 ++-- .../types/reports/settlement/network_total_list_params.py | 2 +- src/lithic/types/settlement_detail.py | 2 +- src/lithic/types/settlement_summary_details.py | 2 +- tests/api_resources/reports/settlement/test_network_totals.py | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index ba0cfe28..90f4d4f1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-599dd2ac665b09566a84c4871ffb3b7313f6b40d0808b8ab4df63bec608b4f9f.yml -openapi_spec_hash: 429e0ad5e3aae4f63935859c2ac64fdc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml +openapi_spec_hash: f6ae1bbed371a5d45927cd63797a9908 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/src/lithic/resources/reports/settlement/network_totals.py b/src/lithic/resources/reports/settlement/network_totals.py index 46781eb9..d1491668 100644 --- a/src/lithic/resources/reports/settlement/network_totals.py +++ b/src/lithic/resources/reports/settlement/network_totals.py @@ -83,7 +83,7 @@ def list( end: Union[str, datetime] | Omit = omit, ending_before: str | Omit = omit, institution_id: str | Omit = omit, - network: Literal["VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] | Omit = omit, + network: Literal["AMEX", "VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] | Omit = omit, page_size: int | Omit = omit, report_date: Union[str, date] | Omit = omit, report_date_begin: Union[str, date] | Omit = omit, @@ -227,7 +227,7 @@ def list( end: Union[str, datetime] | Omit = omit, ending_before: str | Omit = omit, institution_id: str | Omit = omit, - network: Literal["VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] | Omit = omit, + network: Literal["AMEX", "VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] | Omit = omit, page_size: int | Omit = omit, report_date: Union[str, date] | Omit = omit, report_date_begin: Union[str, date] | Omit = omit, diff --git a/src/lithic/types/reports/settlement/network_total_list_params.py b/src/lithic/types/reports/settlement/network_total_list_params.py index 82a82c55..cf8234bf 100644 --- a/src/lithic/types/reports/settlement/network_total_list_params.py +++ b/src/lithic/types/reports/settlement/network_total_list_params.py @@ -33,7 +33,7 @@ class NetworkTotalListParams(TypedDict, total=False): institution_id: str """Institution ID to filter on.""" - network: Literal["VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] + network: Literal["AMEX", "VISA", "MASTERCARD", "MAESTRO", "INTERLINK"] """Network to filter on.""" page_size: int diff --git a/src/lithic/types/settlement_detail.py b/src/lithic/types/settlement_detail.py index a8cd5fa3..ea9b2ade 100644 --- a/src/lithic/types/settlement_detail.py +++ b/src/lithic/types/settlement_detail.py @@ -65,7 +65,7 @@ class SettlementDetail(BaseModel): interchange_gross_amount: int """The total amount of interchange.""" - network: Literal["INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"] + network: Literal["AMEX", "INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"] """Card network where the transaction took place.""" other_fees_details: OtherFeesDetails diff --git a/src/lithic/types/settlement_summary_details.py b/src/lithic/types/settlement_summary_details.py index 1b04c769..86406db4 100644 --- a/src/lithic/types/settlement_summary_details.py +++ b/src/lithic/types/settlement_summary_details.py @@ -24,7 +24,7 @@ class SettlementSummaryDetails(BaseModel): interchange_gross_amount: Optional[int] = None """The total amount of interchange.""" - network: Optional[Literal["INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"]] = None + network: Optional[Literal["AMEX", "INTERLINK", "MAESTRO", "MASTERCARD", "UNKNOWN", "VISA"]] = None """Card network where the transaction took place""" other_fees_gross_amount: Optional[int] = None diff --git a/tests/api_resources/reports/settlement/test_network_totals.py b/tests/api_resources/reports/settlement/test_network_totals.py index 256915ae..4b4da6c1 100644 --- a/tests/api_resources/reports/settlement/test_network_totals.py +++ b/tests/api_resources/reports/settlement/test_network_totals.py @@ -69,7 +69,7 @@ def test_method_list_with_all_params(self, client: Lithic) -> None: end=parse_datetime("2019-12-27T18:11:19.117Z"), ending_before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", institution_id="institution_id", - network="VISA", + network="AMEX", page_size=1, report_date=parse_date("2019-12-27"), report_date_begin=parse_date("2019-12-27"), @@ -155,7 +155,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> N end=parse_datetime("2019-12-27T18:11:19.117Z"), ending_before="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", institution_id="institution_id", - network="VISA", + network="AMEX", page_size=1, report_date=parse_date("2019-12-27"), report_date_begin=parse_date("2019-12-27"), From 66cbc65975b11d4914b4f3c57b4b7b581cef04d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 15:04:37 +0000 Subject: [PATCH 05/15] fix: use correct field name format for multipart file arrays --- src/lithic/_qs.py | 8 ++----- src/lithic/_types.py | 3 +++ src/lithic/_utils/_utils.py | 42 ++++++++++++++++++++++++++++++------- tests/test_extract_files.py | 28 ++++++++++++++++++++----- tests/test_files.py | 2 +- 5 files changed, 63 insertions(+), 20 deletions(-) diff --git a/src/lithic/_qs.py b/src/lithic/_qs.py index de8c99bc..4127c19c 100644 --- a/src/lithic/_qs.py +++ b/src/lithic/_qs.py @@ -2,17 +2,13 @@ from typing import Any, List, Tuple, Union, Mapping, TypeVar from urllib.parse import parse_qs, urlencode -from typing_extensions import Literal, get_args +from typing_extensions import get_args -from ._types import NotGiven, not_given +from ._types import NotGiven, ArrayFormat, NestedFormat, not_given from ._utils import flatten _T = TypeVar("_T") - -ArrayFormat = Literal["comma", "repeat", "indices", "brackets"] -NestedFormat = Literal["dots", "brackets"] - PrimitiveData = Union[str, int, float, bool, None] # this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"] # https://github.com/microsoft/pyright/issues/3555 diff --git a/src/lithic/_types.py b/src/lithic/_types.py index cb48fd28..eb66b5a1 100644 --- a/src/lithic/_types.py +++ b/src/lithic/_types.py @@ -48,6 +48,9 @@ ModelT = TypeVar("ModelT", bound=pydantic.BaseModel) _T = TypeVar("_T") +ArrayFormat = Literal["comma", "repeat", "indices", "brackets"] +NestedFormat = Literal["dots", "brackets"] + # Approximates httpx internal ProxiesTypes and RequestFiles types # while adding support for `PathLike` instances diff --git a/src/lithic/_utils/_utils.py b/src/lithic/_utils/_utils.py index 771859f5..199cd231 100644 --- a/src/lithic/_utils/_utils.py +++ b/src/lithic/_utils/_utils.py @@ -17,11 +17,11 @@ ) from pathlib import Path from datetime import date, datetime -from typing_extensions import TypeGuard +from typing_extensions import TypeGuard, get_args import sniffio -from .._types import Omit, NotGiven, FileTypes, HeadersLike +from .._types import Omit, NotGiven, FileTypes, ArrayFormat, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -40,25 +40,45 @@ def extract_files( query: Mapping[str, object], *, paths: Sequence[Sequence[str]], + array_format: ArrayFormat = "brackets", ) -> list[tuple[str, FileTypes]]: """Recursively extract files from the given dictionary based on specified paths. A path may look like this ['foo', 'files', '', 'data']. + ``array_format`` controls how ```` segments contribute to the emitted + field name. Supported values: ``"brackets"`` (``foo[]``), ``"repeat"`` and + ``"comma"`` (``foo``), ``"indices"`` (``foo[0]``, ``foo[1]``). + Note: this mutates the given dictionary. """ files: list[tuple[str, FileTypes]] = [] for path in paths: - files.extend(_extract_items(query, path, index=0, flattened_key=None)) + files.extend(_extract_items(query, path, index=0, flattened_key=None, array_format=array_format)) return files +def _array_suffix(array_format: ArrayFormat, array_index: int) -> str: + if array_format == "brackets": + return "[]" + if array_format == "indices": + return f"[{array_index}]" + if array_format == "repeat" or array_format == "comma": + # Both repeat the bare field name for each file part; there is no + # meaningful way to comma-join binary parts. + return "" + raise NotImplementedError( + f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}" + ) + + def _extract_items( obj: object, path: Sequence[str], *, index: int, flattened_key: str | None, + array_format: ArrayFormat, ) -> list[tuple[str, FileTypes]]: try: key = path[index] @@ -75,9 +95,11 @@ def _extract_items( if is_list(obj): files: list[tuple[str, FileTypes]] = [] - for entry in obj: - assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "") - files.append((flattened_key + "[]", cast(FileTypes, entry))) + for array_index, entry in enumerate(obj): + suffix = _array_suffix(array_format, array_index) + emitted_key = (flattened_key + suffix) if flattened_key else suffix + assert_is_file_content(entry, key=emitted_key) + files.append((emitted_key, cast(FileTypes, entry))) return files assert_is_file_content(obj, key=flattened_key) @@ -106,6 +128,7 @@ def _extract_items( path, index=index, flattened_key=flattened_key, + array_format=array_format, ) elif is_list(obj): if key != "": @@ -117,9 +140,12 @@ def _extract_items( item, path, index=index, - flattened_key=flattened_key + "[]" if flattened_key is not None else "[]", + flattened_key=( + (flattened_key if flattened_key is not None else "") + _array_suffix(array_format, array_index) + ), + array_format=array_format, ) - for item in obj + for array_index, item in enumerate(obj) ] ) diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index 83bcdade..2d959bd6 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -4,7 +4,7 @@ import pytest -from lithic._types import FileTypes +from lithic._types import FileTypes, ArrayFormat from lithic._utils import extract_files @@ -37,10 +37,7 @@ def test_multiple_files() -> None: def test_top_level_file_array() -> None: query = {"files": [b"file one", b"file two"], "title": "hello"} - assert extract_files(query, paths=[["files", ""]]) == [ - ("files[]", b"file one"), - ("files[]", b"file two"), - ] + assert extract_files(query, paths=[["files", ""]]) == [("files[]", b"file one"), ("files[]", b"file two")] assert query == {"title": "hello"} @@ -71,3 +68,24 @@ def test_ignores_incorrect_paths( expected: list[tuple[str, FileTypes]], ) -> None: assert extract_files(query, paths=paths) == expected + + +@pytest.mark.parametrize( + "array_format,expected_top_level,expected_nested", + [ + ("brackets", [("files[]", b"a"), ("files[]", b"b")], [("items[][file]", b"a"), ("items[][file]", b"b")]), + ("repeat", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]), + ("comma", [("files", b"a"), ("files", b"b")], [("items[file]", b"a"), ("items[file]", b"b")]), + ("indices", [("files[0]", b"a"), ("files[1]", b"b")], [("items[0][file]", b"a"), ("items[1][file]", b"b")]), + ], +) +def test_array_format_controls_file_field_names( + array_format: ArrayFormat, + expected_top_level: list[tuple[str, FileTypes]], + expected_nested: list[tuple[str, FileTypes]], +) -> None: + top_level = {"files": [b"a", b"b"]} + assert extract_files(top_level, paths=[["files", ""]], array_format=array_format) == expected_top_level + + nested = {"items": [{"file": b"a"}, {"file": b"b"}]} + assert extract_files(nested, paths=[["items", "", "file"]], array_format=array_format) == expected_nested diff --git a/tests/test_files.py b/tests/test_files.py index 9f7be408..3ab02042 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -131,7 +131,7 @@ def test_extract_files_does_not_mutate_original_nested_array_path(self) -> None: copied = deepcopy_with_paths(original, [["items", "", "file"]]) extracted = extract_files(copied, paths=[["items", "", "file"]]) - assert extracted == [("items[][file]", file1), ("items[][file]", file2)] + assert [entry for _, entry in extracted] == [file1, file2] assert original == { "items": [ {"file": file1, "extra": 1}, From 8e94d661759140b25e202afb48fd00ac63bf68d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 20:36:34 +0000 Subject: [PATCH 06/15] docs(api): clarify exp_month/exp_year generation in cards create/renew methods --- .stats.yml | 2 +- src/lithic/resources/cards/cards.py | 24 ++++++++++++++++-------- src/lithic/types/card_create_params.py | 8 ++++---- src/lithic/types/card_renew_params.py | 8 ++++---- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index 90f4d4f1..d8f17f16 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml -openapi_spec_hash: f6ae1bbed371a5d45927cd63797a9908 +openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/src/lithic/resources/cards/cards.py b/src/lithic/resources/cards/cards.py index 8b4e7959..3bd8eccd 100644 --- a/src/lithic/resources/cards/cards.py +++ b/src/lithic/resources/cards/cards.py @@ -183,10 +183,12 @@ def create( [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). exp_month: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - an expiration date will be generated. + an expiration date five years in the future will be generated. Five years is the + maximum expiration date. exp_year: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - provided, an expiration date will be generated. + provided, an expiration date five years in the future will be generated. Five + years is the maximum expiration date. memo: Friendly name to identify the card. @@ -1051,10 +1053,12 @@ def renew( carrier: If omitted, the previous carrier will be used. exp_month: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - an expiration date six years in the future will be generated. + an expiration date five years in the future will be generated. Five years is the + maximum expiration date. exp_year: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - provided, an expiration date six years in the future will be generated. + provided, an expiration date five years in the future will be generated. Five + years is the maximum expiration date. product_id: Specifies the configuration (e.g. physical card art) that the card should be manufactured with, and only applies to cards of type `PHYSICAL`. This must be @@ -1369,10 +1373,12 @@ async def create( [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). exp_month: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - an expiration date will be generated. + an expiration date five years in the future will be generated. Five years is the + maximum expiration date. exp_year: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - provided, an expiration date will be generated. + provided, an expiration date five years in the future will be generated. Five + years is the maximum expiration date. memo: Friendly name to identify the card. @@ -2237,10 +2243,12 @@ async def renew( carrier: If omitted, the previous carrier will be used. exp_month: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - an expiration date six years in the future will be generated. + an expiration date five years in the future will be generated. Five years is the + maximum expiration date. exp_year: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - provided, an expiration date six years in the future will be generated. + provided, an expiration date five years in the future will be generated. Five + years is the maximum expiration date. product_id: Specifies the configuration (e.g. physical card art) that the card should be manufactured with, and only applies to cards of type `PHYSICAL`. This must be diff --git a/src/lithic/types/card_create_params.py b/src/lithic/types/card_create_params.py index bb1c737f..f55c870b 100644 --- a/src/lithic/types/card_create_params.py +++ b/src/lithic/types/card_create_params.py @@ -70,15 +70,15 @@ class CardCreateParams(TypedDict, total=False): exp_month: str """Two digit (MM) expiry month. - If neither `exp_month` nor `exp_year` is provided, an expiration date will be - generated. + If neither `exp_month` nor `exp_year` is provided, an expiration date five years + in the future will be generated. Five years is the maximum expiration date. """ exp_year: str """Four digit (yyyy) expiry year. - If neither `exp_month` nor `exp_year` is provided, an expiration date will be - generated. + If neither `exp_month` nor `exp_year` is provided, an expiration date five years + in the future will be generated. Five years is the maximum expiration date. """ memo: str diff --git a/src/lithic/types/card_renew_params.py b/src/lithic/types/card_renew_params.py index 7f5ac0d8..0e9573cd 100644 --- a/src/lithic/types/card_renew_params.py +++ b/src/lithic/types/card_renew_params.py @@ -20,15 +20,15 @@ class CardRenewParams(TypedDict, total=False): exp_month: str """Two digit (MM) expiry month. - If neither `exp_month` nor `exp_year` is provided, an expiration date six years - in the future will be generated. + If neither `exp_month` nor `exp_year` is provided, an expiration date five years + in the future will be generated. Five years is the maximum expiration date. """ exp_year: str """Four digit (yyyy) expiry year. - If neither `exp_month` nor `exp_year` is provided, an expiration date six years - in the future will be generated. + If neither `exp_month` nor `exp_year` is provided, an expiration date five years + in the future will be generated. Five years is the maximum expiration date. """ product_id: str From 759b6e2ea428bfea52d518cd9dadadac4d4bc393 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 22:32:53 +0000 Subject: [PATCH 07/15] feat: support setting headers via env --- src/lithic/_client.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/lithic/_client.py b/src/lithic/_client.py index 4a7a8a88..a9abdb8e 100644 --- a/src/lithic/_client.py +++ b/src/lithic/_client.py @@ -22,7 +22,11 @@ RequestOptions, not_given, ) -from ._utils import is_given, get_async_library +from ._utils import ( + is_given, + is_mapping_t, + get_async_library, +) from ._compat import cached_property from ._version import __version__ from ._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper @@ -197,6 +201,15 @@ def __init__( except KeyError as exc: raise ValueError(f"Unknown environment: {environment}") from exc + custom_headers_env = os.environ.get("LITHIC_CUSTOM_HEADERS") + if custom_headers_env is not None: + parsed: dict[str, str] = {} + for line in custom_headers_env.split("\n"): + colon = line.find(":") + if colon >= 0: + parsed[line[:colon].strip()] = line[colon + 1 :].strip() + default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} + super().__init__( version=__version__, base_url=base_url, @@ -612,6 +625,15 @@ def __init__( except KeyError as exc: raise ValueError(f"Unknown environment: {environment}") from exc + custom_headers_env = os.environ.get("LITHIC_CUSTOM_HEADERS") + if custom_headers_env is not None: + parsed: dict[str, str] = {} + for line in custom_headers_env.split("\n"): + colon = line.find(":") + if colon >= 0: + parsed[line[:colon].strip()] = line[colon + 1 :].strip() + default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})} + super().__init__( version=__version__, base_url=base_url, From 02d196f14c68b906af8ede540b61736b679d68e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 19:04:32 +0000 Subject: [PATCH 08/15] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8f17f16..30879c52 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ab626b78e088455e814b80debc85d420839bc11f95416491fef6a0460f2d95ed.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 From edb6d98750c0bde0f263b19cf4249b2790447cc0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 18:20:46 +0000 Subject: [PATCH 09/15] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30879c52..c954bb3f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 From 62f006673be590623e12f35dfd8c0728b095dcd1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:27:13 +0000 Subject: [PATCH 10/15] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c954bb3f..2b3d7bbb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-d6101c64c957742cde9cfdc5d9213ce4e36aa43d045030fa142e27a46b60884a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0572da655d188e23459f2115b03b27040b4c4d3b47e4a86510803892d0d1b0aa.yml openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 config_hash: ac8326134e692f3f3bdec82396bbec80 From 7d4254692e5456f270de6173ba45180b3adfcb66 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 21:02:06 +0000 Subject: [PATCH 11/15] chore(internal): reformat pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d67ac65f..6b6968b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -170,7 +170,7 @@ show_error_codes = true # # We also exclude our `tests` as mypy doesn't always infer # types correctly and Pyright will still catch any type errors. -exclude = ['src/lithic/_files.py', '_dev/.*.py', 'tests/.*'] +exclude = ["src/lithic/_files.py", "_dev/.*.py", "tests/.*"] strict_equality = true implicit_reexport = true From 77ee72643eebfa74b7a97d8e4104e3fd5be21041 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 18:46:00 +0000 Subject: [PATCH 12/15] docs(types): improve settlement_detail field descriptions --- .stats.yml | 4 ++-- src/lithic/types/settlement_detail.py | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b3d7bbb..3b395aab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0572da655d188e23459f2115b03b27040b4c4d3b47e4a86510803892d0d1b0aa.yml -openapi_spec_hash: b615a0eb16502b4de874f9ae28491894 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-a46ebb10f6bb217a591206f0574450c324f108dbd32a2d62727cd8186d85e94f.yml +openapi_spec_hash: f320c173152f74b0799166b6ef5b82cd config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/src/lithic/types/settlement_detail.py b/src/lithic/types/settlement_detail.py index ea9b2ade..9762b2ec 100644 --- a/src/lithic/types/settlement_detail.py +++ b/src/lithic/types/settlement_detail.py @@ -50,7 +50,8 @@ class SettlementDetail(BaseModel): event_tokens: List[str] """ - Globally unique identifiers denoting the Events associated with this settlement. + Array of globally unique identifiers for the financial events that comprise this + settlement. Use these tokens to access detailed event-level information. """ institution: str @@ -85,7 +86,14 @@ class SettlementDetail(BaseModel): """ transaction_token: str - """Globally unique identifier denoting the associated Transaction object.""" + """Globally unique identifier denoting the associated transaction. + + For settlement records with type `CLEARING`, `FINANCIAL`, or `NON-FINANCIAL`, + this references a card transaction token. For settlement records with type + `CHARGEBACK`, `REPRESENTMENT`, `PREARBITRATION`, `ARBITRATION`, or + `COLLABORATION`, this references the dispute transaction token. May be null for + certain settlement types. + """ transactions_gross_amount: int """ From 7bdb5aa9c3370da6f1a2eafa268ae235c7b036a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 20:11:39 +0000 Subject: [PATCH 13/15] feat(api): add IS_NEW_MERCHANT to auth_rules conditional authorization conditions --- .stats.yml | 4 ++-- .../conditional_authorization_action_parameters.py | 5 +++++ .../conditional_authorization_action_parameters_param.py | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3b395aab..9e978b61 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-a46ebb10f6bb217a591206f0574450c324f108dbd32a2d62727cd8186d85e94f.yml -openapi_spec_hash: f320c173152f74b0799166b6ef5b82cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-92d7ce0702a494edb7beb0ad484c4f24aca65777197d40b2108d05c13c3fa505.yml +openapi_spec_hash: 35e4b9edb38ef23f528fcfbfeaabac02 config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/src/lithic/types/auth_rules/conditional_authorization_action_parameters.py b/src/lithic/types/auth_rules/conditional_authorization_action_parameters.py index 4f8d73e6..3c747d40 100644 --- a/src/lithic/types/auth_rules/conditional_authorization_action_parameters.py +++ b/src/lithic/types/auth_rules/conditional_authorization_action_parameters.py @@ -68,6 +68,7 @@ class Condition(BaseModel): "CONSECUTIVE_DECLINES", "TIME_SINCE_LAST_TRANSACTION", "DISTINCT_COUNTRY_COUNT", + "IS_NEW_MERCHANT", "THREE_DS_SUCCESS_RATE", ] """The attribute to target. @@ -166,6 +167,10 @@ class Condition(BaseModel): transaction for the entity. Requires `parameters.scope`. - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in the entity's transaction history. Requires `parameters.scope`. + - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + card's approved transaction history (capped at the 1000 most recently seen + merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + `parameters` required. - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. """ diff --git a/src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py index 0a9373f7..a70a27bd 100644 --- a/src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py +++ b/src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py @@ -71,6 +71,7 @@ class Condition(TypedDict, total=False): "CONSECUTIVE_DECLINES", "TIME_SINCE_LAST_TRANSACTION", "DISTINCT_COUNTRY_COUNT", + "IS_NEW_MERCHANT", "THREE_DS_SUCCESS_RATE", ] ] @@ -170,6 +171,10 @@ class Condition(TypedDict, total=False): transaction for the entity. Requires `parameters.scope`. - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in the entity's transaction history. Requires `parameters.scope`. + - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + card's approved transaction history (capped at the 1000 most recently seen + merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + `parameters` required. - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. """ From 0f09b0181efbb024fd9559995b166865e5eb1cc8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 10:38:48 +0000 Subject: [PATCH 14/15] feat(api): add CARD_TRANSACTION_UPDATE event stream and action params to auth_rules v2 --- .stats.yml | 6 +- api.md | 3 + src/lithic/resources/auth_rules/v2/v2.py | 18 ++- src/lithic/types/auth_rules/__init__.py | 10 ++ src/lithic/types/auth_rules/auth_rule.py | 6 +- .../types/auth_rules/auth_rule_version.py | 2 + .../card_transaction_update_action.py | 33 +++++ .../card_transaction_update_action_param.py | 33 +++++ ...rd_transaction_update_action_parameters.py | 123 +++++++++++++++++ ...nsaction_update_action_parameters_param.py | 127 ++++++++++++++++++ src/lithic/types/auth_rules/event_stream.py | 7 +- .../auth_rules/spend_velocity_filters.py | 23 ++++ .../spend_velocity_filters_param.py | 25 ++++ .../types/auth_rules/v2_create_params.py | 15 ++- .../types/auth_rules/v2_draft_params.py | 4 + 15 files changed, 421 insertions(+), 14 deletions(-) create mode 100644 src/lithic/types/auth_rules/card_transaction_update_action.py create mode 100644 src/lithic/types/auth_rules/card_transaction_update_action_param.py create mode 100644 src/lithic/types/auth_rules/conditional_card_transaction_update_action_parameters.py create mode 100644 src/lithic/types/auth_rules/conditional_card_transaction_update_action_parameters_param.py create mode 100644 src/lithic/types/auth_rules/spend_velocity_filters.py create mode 100644 src/lithic/types/auth_rules/spend_velocity_filters_param.py diff --git a/.stats.yml b/.stats.yml index 9e978b61..47b8d19d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-92d7ce0702a494edb7beb0ad484c4f24aca65777197d40b2108d05c13c3fa505.yml -openapi_spec_hash: 35e4b9edb38ef23f528fcfbfeaabac02 -config_hash: ac8326134e692f3f3bdec82396bbec80 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0f374e78a0212145a2f55a55dfc39a612de19094d5152ae26b1bc74b01b9e343.yml +openapi_spec_hash: ec888cdaebea979a2cd6231ca04c346c +config_hash: 01dfc901bb6d54b0f582155d779bcbe0 diff --git a/api.md b/api.md index d1c47871..460379dd 100644 --- a/api.md +++ b/api.md @@ -98,11 +98,13 @@ from lithic.types.auth_rules import ( AuthRuleCondition, AuthRuleVersion, BacktestStats, + CardTransactionUpdateAction, Conditional3DSActionParameters, ConditionalACHActionParameters, ConditionalAttribute, ConditionalAuthorizationActionParameters, ConditionalBlockParameters, + ConditionalCardTransactionUpdateActionParameters, ConditionalOperation, ConditionalTokenizationActionParameters, ConditionalValue, @@ -110,6 +112,7 @@ from lithic.types.auth_rules import ( MerchantLockParameters, ReportStats, RuleFeature, + SpendVelocityFilters, TypescriptCodeParameters, VelocityLimitFilters, VelocityLimitParams, diff --git a/src/lithic/resources/auth_rules/v2/v2.py b/src/lithic/resources/auth_rules/v2/v2.py index 2a050870..d65eeb42 100644 --- a/src/lithic/resources/auth_rules/v2/v2.py +++ b/src/lithic/resources/auth_rules/v2/v2.py @@ -101,7 +101,8 @@ def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. @@ -157,7 +158,8 @@ def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. @@ -212,7 +214,8 @@ def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. @@ -979,7 +982,8 @@ async def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. @@ -1035,7 +1039,8 @@ async def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. @@ -1090,7 +1095,8 @@ async def create( - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. diff --git a/src/lithic/types/auth_rules/__init__.py b/src/lithic/types/auth_rules/__init__.py index ccc86c5a..a70bd610 100644 --- a/src/lithic/types/auth_rules/__init__.py +++ b/src/lithic/types/auth_rules/__init__.py @@ -19,6 +19,7 @@ from .conditional_operation import ConditionalOperation as ConditionalOperation from .velocity_limit_params import VelocityLimitParams as VelocityLimitParams from .velocity_limit_period import VelocityLimitPeriod as VelocityLimitPeriod +from .spend_velocity_filters import SpendVelocityFilters as SpendVelocityFilters from .v2_list_results_params import V2ListResultsParams as V2ListResultsParams from .velocity_limit_filters import VelocityLimitFilters as VelocityLimitFilters from .conditional_value_param import ConditionalValueParam as ConditionalValueParam @@ -33,13 +34,16 @@ from .velocity_limit_params_param import VelocityLimitParamsParam as VelocityLimitParamsParam from .velocity_limit_period_param import VelocityLimitPeriodParam as VelocityLimitPeriodParam from .conditional_block_parameters import ConditionalBlockParameters as ConditionalBlockParameters +from .spend_velocity_filters_param import SpendVelocityFiltersParam as SpendVelocityFiltersParam from .velocity_limit_filters_param import VelocityLimitFiltersParam as VelocityLimitFiltersParam from .v2_retrieve_features_response import V2RetrieveFeaturesResponse as V2RetrieveFeaturesResponse +from .card_transaction_update_action import CardTransactionUpdateAction as CardTransactionUpdateAction from .merchant_lock_parameters_param import MerchantLockParametersParam as MerchantLockParametersParam from .typescript_code_parameters_param import TypescriptCodeParametersParam as TypescriptCodeParametersParam from .conditional_3ds_action_parameters import Conditional3DSActionParameters as Conditional3DSActionParameters from .conditional_ach_action_parameters import ConditionalACHActionParameters as ConditionalACHActionParameters from .conditional_block_parameters_param import ConditionalBlockParametersParam as ConditionalBlockParametersParam +from .card_transaction_update_action_param import CardTransactionUpdateActionParam as CardTransactionUpdateActionParam from .conditional_3ds_action_parameters_param import ( Conditional3DSActionParametersParam as Conditional3DSActionParametersParam, ) @@ -58,3 +62,9 @@ from .conditional_authorization_action_parameters_param import ( ConditionalAuthorizationActionParametersParam as ConditionalAuthorizationActionParametersParam, ) +from .conditional_card_transaction_update_action_parameters import ( + ConditionalCardTransactionUpdateActionParameters as ConditionalCardTransactionUpdateActionParameters, +) +from .conditional_card_transaction_update_action_parameters_param import ( + ConditionalCardTransactionUpdateActionParametersParam as ConditionalCardTransactionUpdateActionParametersParam, +) diff --git a/src/lithic/types/auth_rules/auth_rule.py b/src/lithic/types/auth_rules/auth_rule.py index 74cabb08..d01447db 100644 --- a/src/lithic/types/auth_rules/auth_rule.py +++ b/src/lithic/types/auth_rules/auth_rule.py @@ -13,6 +13,7 @@ from .conditional_ach_action_parameters import ConditionalACHActionParameters from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters +from .conditional_card_transaction_update_action_parameters import ConditionalCardTransactionUpdateActionParameters __all__ = ["AuthRule", "CurrentVersion", "CurrentVersionParameters", "DraftVersion", "DraftVersionParameters"] @@ -24,6 +25,7 @@ ConditionalAuthorizationActionParameters, ConditionalACHActionParameters, ConditionalTokenizationActionParameters, + ConditionalCardTransactionUpdateActionParameters, TypescriptCodeParameters, ] @@ -47,6 +49,7 @@ class CurrentVersion(BaseModel): ConditionalAuthorizationActionParameters, ConditionalACHActionParameters, ConditionalTokenizationActionParameters, + ConditionalCardTransactionUpdateActionParameters, TypescriptCodeParameters, ] @@ -129,7 +132,8 @@ class AuthRule(BaseModel): - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. """ diff --git a/src/lithic/types/auth_rules/auth_rule_version.py b/src/lithic/types/auth_rules/auth_rule_version.py index 4dcbc321..15dfed2b 100644 --- a/src/lithic/types/auth_rules/auth_rule_version.py +++ b/src/lithic/types/auth_rules/auth_rule_version.py @@ -13,6 +13,7 @@ from .conditional_ach_action_parameters import ConditionalACHActionParameters from .conditional_tokenization_action_parameters import ConditionalTokenizationActionParameters from .conditional_authorization_action_parameters import ConditionalAuthorizationActionParameters +from .conditional_card_transaction_update_action_parameters import ConditionalCardTransactionUpdateActionParameters __all__ = ["AuthRuleVersion", "Parameters"] @@ -24,6 +25,7 @@ ConditionalAuthorizationActionParameters, ConditionalACHActionParameters, ConditionalTokenizationActionParameters, + ConditionalCardTransactionUpdateActionParameters, TypescriptCodeParameters, ] diff --git a/src/lithic/types/auth_rules/card_transaction_update_action.py b/src/lithic/types/auth_rules/card_transaction_update_action.py new file mode 100644 index 00000000..902af1fc --- /dev/null +++ b/src/lithic/types/auth_rules/card_transaction_update_action.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel + +__all__ = ["CardTransactionUpdateAction", "TagAction", "CreateCaseAction"] + + +class TagAction(BaseModel): + key: str + """The key of the tag to apply to the transaction""" + + type: Literal["TAG"] + """Tag the transaction with key-value metadata""" + + value: str + """The value of the tag to apply to the transaction""" + + +class CreateCaseAction(BaseModel): + queue_token: str + """The token of the queue to create the case in""" + + scope: Literal["CARD", "ACCOUNT"] + """The scope of the case to create""" + + type: Literal["CREATE_CASE"] + """Create a case for the transaction""" + + +CardTransactionUpdateAction: TypeAlias = Union[TagAction, CreateCaseAction] diff --git a/src/lithic/types/auth_rules/card_transaction_update_action_param.py b/src/lithic/types/auth_rules/card_transaction_update_action_param.py new file mode 100644 index 00000000..9eb27dea --- /dev/null +++ b/src/lithic/types/auth_rules/card_transaction_update_action_param.py @@ -0,0 +1,33 @@ +# 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, Required, TypeAlias, TypedDict + +__all__ = ["CardTransactionUpdateActionParam", "TagAction", "CreateCaseAction"] + + +class TagAction(TypedDict, total=False): + key: Required[str] + """The key of the tag to apply to the transaction""" + + type: Required[Literal["TAG"]] + """Tag the transaction with key-value metadata""" + + value: Required[str] + """The value of the tag to apply to the transaction""" + + +class CreateCaseAction(TypedDict, total=False): + queue_token: Required[str] + """The token of the queue to create the case in""" + + scope: Required[Literal["CARD", "ACCOUNT"]] + """The scope of the case to create""" + + type: Required[Literal["CREATE_CASE"]] + """Create a case for the transaction""" + + +CardTransactionUpdateActionParam: TypeAlias = Union[TagAction, CreateCaseAction] diff --git a/src/lithic/types/auth_rules/conditional_card_transaction_update_action_parameters.py b/src/lithic/types/auth_rules/conditional_card_transaction_update_action_parameters.py new file mode 100644 index 00000000..007cbf75 --- /dev/null +++ b/src/lithic/types/auth_rules/conditional_card_transaction_update_action_parameters.py @@ -0,0 +1,123 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .conditional_value import ConditionalValue +from .conditional_operation import ConditionalOperation +from .velocity_limit_period import VelocityLimitPeriod +from .spend_velocity_filters import SpendVelocityFilters +from .card_transaction_update_action import CardTransactionUpdateAction + +__all__ = ["ConditionalCardTransactionUpdateActionParameters", "Condition", "ConditionParameters"] + + +class ConditionParameters(BaseModel): + """Additional parameters for spend velocity attributes. + + Required when `attribute` is + `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. Not used for other attributes. + """ + + filters: Optional[SpendVelocityFilters] = None + + period: Optional[VelocityLimitPeriod] = None + """The time period over which to calculate the spend velocity.""" + + scope: Optional[Literal["CARD", "ACCOUNT", "GLOBAL"]] = None + """The entity scope to evaluate the attribute against.""" + + +class Condition(BaseModel): + attribute: Literal[ + "MCC", + "COUNTRY", + "CURRENCY", + "MERCHANT_ID", + "DESCRIPTOR", + "TRANSACTION_AMOUNT", + "RISK_SCORE", + "TRANSACTION_STATUS", + "LAST_EVENT_TYPE", + "LIABILITY_SHIFT", + "PAN_ENTRY_MODE", + "WALLET_TYPE", + "CARD_AGE", + "ACCOUNT_AGE", + "SPEND_VELOCITY_COUNT", + "SPEND_VELOCITY_AMOUNT", + ] + """The attribute to target. + + The following attributes may be targeted: + + - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + business by the types of goods or services it provides. + - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + Netherlands Antilles. + - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + the transaction. + - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + (merchant). + - `DESCRIPTOR`: Short description of card acceptor. + - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + 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 authorization. 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. + - `TRANSACTION_STATUS`: The status of the transaction. Valid values are + `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, + `EXPIRED`. + - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + `RETURN_REVERSAL`. + - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + `TOKEN_AUTHENTICATED`. + - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + - `CARD_AGE`: The age of the card in seconds at the time of the transaction. + - `ACCOUNT_AGE`: The age of the account in seconds at the time of the + transaction. + - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified + filters within the given period. Requires `parameters` with `scope`, `period`, + and optional `filters`. + - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions + matching the specified filters within the given period. Requires `parameters` + with `scope`, `period`, and optional `filters`. + """ + + operation: ConditionalOperation + """The operation to apply to the attribute""" + + value: ConditionalValue + """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" + + parameters: Optional[ConditionParameters] = None + """Additional parameters for spend velocity attributes. + + Required when `attribute` is `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. + Not used for other attributes. + """ + + +class ConditionalCardTransactionUpdateActionParameters(BaseModel): + action: CardTransactionUpdateAction + """The action to take if the conditions are met.""" + + conditions: List[Condition] diff --git a/src/lithic/types/auth_rules/conditional_card_transaction_update_action_parameters_param.py b/src/lithic/types/auth_rules/conditional_card_transaction_update_action_parameters_param.py new file mode 100644 index 00000000..f35e09e0 --- /dev/null +++ b/src/lithic/types/auth_rules/conditional_card_transaction_update_action_parameters_param.py @@ -0,0 +1,127 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .conditional_operation import ConditionalOperation +from .conditional_value_param import ConditionalValueParam +from .velocity_limit_period_param import VelocityLimitPeriodParam +from .spend_velocity_filters_param import SpendVelocityFiltersParam +from .card_transaction_update_action_param import CardTransactionUpdateActionParam + +__all__ = ["ConditionalCardTransactionUpdateActionParametersParam", "Condition", "ConditionParameters"] + + +class ConditionParameters(TypedDict, total=False): + """Additional parameters for spend velocity attributes. + + Required when `attribute` is + `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. Not used for other attributes. + """ + + filters: SpendVelocityFiltersParam + + period: VelocityLimitPeriodParam + """The time period over which to calculate the spend velocity.""" + + scope: Literal["CARD", "ACCOUNT", "GLOBAL"] + """The entity scope to evaluate the attribute against.""" + + +class Condition(TypedDict, total=False): + attribute: Required[ + Literal[ + "MCC", + "COUNTRY", + "CURRENCY", + "MERCHANT_ID", + "DESCRIPTOR", + "TRANSACTION_AMOUNT", + "RISK_SCORE", + "TRANSACTION_STATUS", + "LAST_EVENT_TYPE", + "LIABILITY_SHIFT", + "PAN_ENTRY_MODE", + "WALLET_TYPE", + "CARD_AGE", + "ACCOUNT_AGE", + "SPEND_VELOCITY_COUNT", + "SPEND_VELOCITY_AMOUNT", + ] + ] + """The attribute to target. + + The following attributes may be targeted: + + - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + business by the types of goods or services it provides. + - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + Netherlands Antilles. + - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + the transaction. + - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + (merchant). + - `DESCRIPTOR`: Short description of card acceptor. + - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + 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 authorization. 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. + - `TRANSACTION_STATUS`: The status of the transaction. Valid values are + `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, + `EXPIRED`. + - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + `RETURN_REVERSAL`. + - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + `TOKEN_AUTHENTICATED`. + - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + - `CARD_AGE`: The age of the card in seconds at the time of the transaction. + - `ACCOUNT_AGE`: The age of the account in seconds at the time of the + transaction. + - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified + filters within the given period. Requires `parameters` with `scope`, `period`, + and optional `filters`. + - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions + matching the specified filters within the given period. Requires `parameters` + with `scope`, `period`, and optional `filters`. + """ + + operation: Required[ConditionalOperation] + """The operation to apply to the attribute""" + + value: Required[Annotated[ConditionalValueParam, PropertyInfo(format="iso8601")]] + """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" + + parameters: ConditionParameters + """Additional parameters for spend velocity attributes. + + Required when `attribute` is `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. + Not used for other attributes. + """ + + +class ConditionalCardTransactionUpdateActionParametersParam(TypedDict, total=False): + action: Required[CardTransactionUpdateActionParam] + """The action to take if the conditions are met.""" + + conditions: Required[Iterable[Condition]] diff --git a/src/lithic/types/auth_rules/event_stream.py b/src/lithic/types/auth_rules/event_stream.py index bd270b0f..6a91de00 100644 --- a/src/lithic/types/auth_rules/event_stream.py +++ b/src/lithic/types/auth_rules/event_stream.py @@ -5,5 +5,10 @@ __all__ = ["EventStream"] EventStream: TypeAlias = Literal[ - "AUTHORIZATION", "THREE_DS_AUTHENTICATION", "TOKENIZATION", "ACH_CREDIT_RECEIPT", "ACH_DEBIT_RECEIPT" + "AUTHORIZATION", + "THREE_DS_AUTHENTICATION", + "TOKENIZATION", + "ACH_CREDIT_RECEIPT", + "ACH_DEBIT_RECEIPT", + "CARD_TRANSACTION_UPDATE", ] diff --git a/src/lithic/types/auth_rules/spend_velocity_filters.py b/src/lithic/types/auth_rules/spend_velocity_filters.py new file mode 100644 index 00000000..6964b1c8 --- /dev/null +++ b/src/lithic/types/auth_rules/spend_velocity_filters.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from .velocity_limit_filters import VelocityLimitFilters + +__all__ = ["SpendVelocityFilters"] + + +class SpendVelocityFilters(VelocityLimitFilters): + exclude_tags: Optional[Dict[str, str]] = None + """Tag key-value pairs to exclude from the velocity calculation. + + Transactions matching all specified tag key-value pairs will be excluded from + the calculated velocity. + """ + + include_tags: Optional[Dict[str, str]] = None + """Tag key-value pairs to include in the velocity calculation. + + Only transactions matching all specified tag key-value pairs will be included in + the calculated velocity. + """ diff --git a/src/lithic/types/auth_rules/spend_velocity_filters_param.py b/src/lithic/types/auth_rules/spend_velocity_filters_param.py new file mode 100644 index 00000000..55b568a7 --- /dev/null +++ b/src/lithic/types/auth_rules/spend_velocity_filters_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional + +from .velocity_limit_filters_param import VelocityLimitFiltersParam + +__all__ = ["SpendVelocityFiltersParam"] + + +class SpendVelocityFiltersParam(VelocityLimitFiltersParam, total=False): + exclude_tags: Optional[Dict[str, str]] + """Tag key-value pairs to exclude from the velocity calculation. + + Transactions matching all specified tag key-value pairs will be excluded from + the calculated velocity. + """ + + include_tags: Optional[Dict[str, str]] + """Tag key-value pairs to include in the velocity calculation. + + Only transactions matching all specified tag key-value pairs will be included in + the calculated velocity. + """ diff --git a/src/lithic/types/auth_rules/v2_create_params.py b/src/lithic/types/auth_rules/v2_create_params.py index 6c8c7fd8..640eb6ac 100644 --- a/src/lithic/types/auth_rules/v2_create_params.py +++ b/src/lithic/types/auth_rules/v2_create_params.py @@ -15,6 +15,9 @@ from .conditional_ach_action_parameters_param import ConditionalACHActionParametersParam from .conditional_tokenization_action_parameters_param import ConditionalTokenizationActionParametersParam from .conditional_authorization_action_parameters_param import ConditionalAuthorizationActionParametersParam +from .conditional_card_transaction_update_action_parameters_param import ( + ConditionalCardTransactionUpdateActionParametersParam, +) __all__ = [ "V2CreateParams", @@ -45,7 +48,8 @@ class AccountLevelRule(TypedDict, total=False): - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. """ @@ -71,6 +75,7 @@ class AccountLevelRule(TypedDict, total=False): ConditionalAuthorizationActionParametersParam, ConditionalACHActionParametersParam, ConditionalTokenizationActionParametersParam, + ConditionalCardTransactionUpdateActionParametersParam, TypescriptCodeParametersParam, ] @@ -96,7 +101,8 @@ class CardLevelRule(TypedDict, total=False): - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. """ @@ -116,6 +122,7 @@ class CardLevelRule(TypedDict, total=False): ConditionalAuthorizationActionParametersParam, ConditionalACHActionParametersParam, ConditionalTokenizationActionParametersParam, + ConditionalCardTransactionUpdateActionParametersParam, TypescriptCodeParametersParam, ] @@ -141,7 +148,8 @@ class ProgramLevelRule(TypedDict, total=False): - `VELOCITY_LIMIT`: AUTHORIZATION event stream. - `MERCHANT_LOCK`: AUTHORIZATION event stream. - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, - ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. + ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + stream. - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream. """ @@ -170,6 +178,7 @@ class ProgramLevelRule(TypedDict, total=False): ConditionalAuthorizationActionParametersParam, ConditionalACHActionParametersParam, ConditionalTokenizationActionParametersParam, + ConditionalCardTransactionUpdateActionParametersParam, TypescriptCodeParametersParam, ] diff --git a/src/lithic/types/auth_rules/v2_draft_params.py b/src/lithic/types/auth_rules/v2_draft_params.py index 2b0d4363..92cc266a 100644 --- a/src/lithic/types/auth_rules/v2_draft_params.py +++ b/src/lithic/types/auth_rules/v2_draft_params.py @@ -13,6 +13,9 @@ from .conditional_ach_action_parameters_param import ConditionalACHActionParametersParam from .conditional_tokenization_action_parameters_param import ConditionalTokenizationActionParametersParam from .conditional_authorization_action_parameters_param import ConditionalAuthorizationActionParametersParam +from .conditional_card_transaction_update_action_parameters_param import ( + ConditionalCardTransactionUpdateActionParametersParam, +) __all__ = ["V2DraftParams", "Parameters"] @@ -30,5 +33,6 @@ class V2DraftParams(TypedDict, total=False): ConditionalAuthorizationActionParametersParam, ConditionalACHActionParametersParam, ConditionalTokenizationActionParametersParam, + ConditionalCardTransactionUpdateActionParametersParam, TypescriptCodeParametersParam, ] From 408d849c9291204f3a28be42100afdd9a4836f52 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 10:39:27 +0000 Subject: [PATCH 15/15] release: 0.123.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ pyproject.toml | 2 +- src/lithic/_version.py | 2 +- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bd115b20..58ebf7f2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.122.0" + ".": "0.123.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3760e200..376aab01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## 0.123.0 (2026-05-06) + +Full Changelog: [v0.122.0...v0.123.0](https://github.com/lithic-com/lithic-python/compare/v0.122.0...v0.123.0) + +### Features + +* **api:** add AMEX to network enum in settlement reports ([a429a2e](https://github.com/lithic-com/lithic-python/commit/a429a2e6c8915f857d692f567951b03b392791ba)) +* **api:** add CARD_TRANSACTION_UPDATE event stream and action params to auth_rules v2 ([0f09b01](https://github.com/lithic-com/lithic-python/commit/0f09b0181efbb024fd9559995b166865e5eb1cc8)) +* **api:** add IS_NEW_MERCHANT to auth_rules conditional authorization conditions ([7bdb5aa](https://github.com/lithic-com/lithic-python/commit/7bdb5aa9c3370da6f1a2eafa268ae235c7b036a1)) +* support setting headers via env ([759b6e2](https://github.com/lithic-com/lithic-python/commit/759b6e2ea428bfea52d518cd9dadadac4d4bc393)) + + +### Bug Fixes + +* **types:** make substatus/funding optional, add exemption_type enum value ([e424839](https://github.com/lithic-com/lithic-python/commit/e424839de5a127d48086c9dd1ed5ec7146cdfd6a)) +* use correct field name format for multipart file arrays ([66cbc65](https://github.com/lithic-com/lithic-python/commit/66cbc65975b11d4914b4f3c57b4b7b581cef04d7)) + + +### Chores + +* **internal:** more robust bootstrap script ([0df0d6c](https://github.com/lithic-com/lithic-python/commit/0df0d6cf2e2691b4979e5727dd88781229b7e831)) +* **internal:** reformat pyproject.toml ([7d42546](https://github.com/lithic-com/lithic-python/commit/7d4254692e5456f270de6173ba45180b3adfcb66)) + + +### Documentation + +* **api:** clarify exp_month/exp_year generation in cards create/renew methods ([8e94d66](https://github.com/lithic-com/lithic-python/commit/8e94d661759140b25e202afb48fd00ac63bf68d4)) +* **types:** improve settlement_detail field descriptions ([77ee726](https://github.com/lithic-com/lithic-python/commit/77ee72643eebfa74b7a97d8e4104e3fd5be21041)) + ## 0.122.0 (2026-04-20) Full Changelog: [v0.121.0...v0.122.0](https://github.com/lithic-com/lithic-python/compare/v0.121.0...v0.122.0) diff --git a/pyproject.toml b/pyproject.toml index 6b6968b3..b9fd106b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.122.0" +version = "0.123.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/lithic/_version.py b/src/lithic/_version.py index d7da7751..2236ca43 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.122.0" # x-release-please-version +__version__ = "0.123.0" # x-release-please-version