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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/lithic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -35,7 +36,7 @@ jobs:
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/lithic-python'
if: github.repository == 'stainless-sdks/lithic-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
permissions:
Expand All @@ -62,6 +63,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/lithic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -83,7 +85,7 @@ jobs:
timeout-minutes: 10
name: examples
runs-on: ${{ github.repository == 'stainless-sdks/lithic-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.repository == 'lithic-com/lithic-python'
if: github.repository == 'lithic-com/lithic-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)

steps:
- uses: actions/checkout@v4
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.94.0"
".": "0.95.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 161
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-67859c948e3b903a317f4bd14135c7ee44254d2760068117bab34b7c4058be71.yml
openapi_spec_hash: 23a4716c6168e96f040ac8575582d075
config_hash: 227ad54062905d4ae964b24cef0505b0
configured_endpoints: 164
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa684ff2a2af585fe502a6e44520ddd883f5141a1113fc9dbe7830027842aa09.yml
openapi_spec_hash: b58989fdc04768fc1eb758e180c5f128
config_hash: 1a83dceb58f6f525b19a5775018db7e8
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.95.0 (2025-06-29)

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

### Features

* **api:** introduce dedicated model for SpendLimitDuration ([1e1fb23](https://github.com/lithic-com/lithic-python/commit/1e1fb237a754aeb2a3d9cc5b751ef5d4c51d11e9))
* **client:** adds support for on-demand Auth Rule Performance Reports ([81c2860](https://github.com/lithic-com/lithic-python/commit/81c2860a37078364b3f4c1876f407b60bdb88bec))


### Bug Fixes

* **ci:** correct conditional ([9422f2e](https://github.com/lithic-com/lithic-python/commit/9422f2ec8393447429219af34bda88c581984fa3))
* **ci:** release-doctor — report correct token name ([59781eb](https://github.com/lithic-com/lithic-python/commit/59781ebf072b0b0839d0ad4ab27a79bfa045db59))


### Chores

* **ci:** only run for pushes and fork pull requests ([954c7f0](https://github.com/lithic-com/lithic-python/commit/954c7f0f1bea593b30d71d15a8c626ffadf30c6b))
* **internal:** manual updates ([0c5bbdb](https://github.com/lithic-com/lithic-python/commit/0c5bbdb7e2bff6f7588b06b5ef3ed40db06b412b))

## 0.94.0 (2025-06-23)

Full Changelog: [v0.93.0...v0.94.0](https://github.com/lithic-com/lithic-python/compare/v0.93.0...v0.94.0)
Expand Down
18 changes: 18 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ from lithic.types.auth_rules import (
AuthRuleCondition,
ConditionalAttribute,
ConditionalBlockParameters,
RuleStats,
VelocityLimitParams,
VelocityLimitParamsPeriodWindow,
V2CreateResponse,
Expand All @@ -93,6 +94,7 @@ from lithic.types.auth_rules import (
V2DraftResponse,
V2PromoteResponse,
V2ReportResponse,
V2RetrieveReportResponse,
)
```

Expand All @@ -107,6 +109,7 @@ Methods:
- <code title="post /v2/auth_rules/{auth_rule_token}/draft">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">draft</a>(auth_rule_token, \*\*<a href="src/lithic/types/auth_rules/v2_draft_params.py">params</a>) -> <a href="./src/lithic/types/auth_rules/v2_draft_response.py">V2DraftResponse</a></code>
- <code title="post /v2/auth_rules/{auth_rule_token}/promote">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">promote</a>(auth_rule_token) -> <a href="./src/lithic/types/auth_rules/v2_promote_response.py">V2PromoteResponse</a></code>
- <code title="post /v2/auth_rules/{auth_rule_token}/report">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">report</a>(auth_rule_token) -> <a href="./src/lithic/types/auth_rules/v2_report_response.py">V2ReportResponse</a></code>
- <code title="get /v2/auth_rules/{auth_rule_token}/report">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">retrieve_report</a>(auth_rule_token, \*\*<a href="src/lithic/types/auth_rules/v2_retrieve_report_params.py">params</a>) -> <a href="./src/lithic/types/auth_rules/v2_retrieve_report_response.py">V2RetrieveReportResponse</a></code>

### Backtests

Expand Down Expand Up @@ -734,3 +737,18 @@ Methods:
- <code title="get /v1/funding_events/{funding_event_token}">client.funding_events.<a href="./src/lithic/resources/funding_events.py">retrieve</a>(funding_event_token) -> <a href="./src/lithic/types/funding_event_retrieve_response.py">FundingEventRetrieveResponse</a></code>
- <code title="get /v1/funding_events">client.funding_events.<a href="./src/lithic/resources/funding_events.py">list</a>(\*\*<a href="src/lithic/types/funding_event_list_params.py">params</a>) -> <a href="./src/lithic/types/funding_event_list_response.py">SyncCursorPage[FundingEventListResponse]</a></code>
- <code title="get /v1/funding_events/{funding_event_token}/details">client.funding_events.<a href="./src/lithic/resources/funding_events.py">retrieve_details</a>(funding_event_token) -> <a href="./src/lithic/types/funding_event_retrieve_details_response.py">FundingEventRetrieveDetailsResponse</a></code>

# Fraud

## Transactions

Types:

```python
from lithic.types.fraud import TransactionRetrieveResponse, TransactionReportResponse
```

Methods:

- <code title="get /v1/fraud/transactions/{transaction_token}">client.fraud.transactions.<a href="./src/lithic/resources/fraud/transactions.py">retrieve</a>(transaction_token) -> <a href="./src/lithic/types/fraud/transaction_retrieve_response.py">TransactionRetrieveResponse</a></code>
- <code title="post /v1/fraud/transactions/{transaction_token}">client.fraud.transactions.<a href="./src/lithic/resources/fraud/transactions.py">report</a>(transaction_token, \*\*<a href="src/lithic/types/fraud/transaction_report_params.py">params</a>) -> <a href="./src/lithic/types/fraud/transaction_report_response.py">TransactionReportResponse</a></code>
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The LITHIC_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenErrors=${#errors[@]}
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.94.0"
version = "0.95.0"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
38 changes: 38 additions & 0 deletions src/lithic/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
if TYPE_CHECKING:
from .resources import (
cards,
fraud,
events,
reports,
accounts,
Expand Down Expand Up @@ -70,6 +71,7 @@
from .resources.disputes import Disputes, AsyncDisputes
from .resources.payments import Payments, AsyncPayments
from .resources.cards.cards import Cards, AsyncCards
from .resources.fraud.fraud import Fraud, AsyncFraud
from .resources.card_programs import CardPrograms, AsyncCardPrograms
from .resources.events.events import Events, AsyncEvents
from .resources.tokenizations import Tokenizations, AsyncTokenizations
Expand Down Expand Up @@ -352,6 +354,12 @@ def webhooks(self) -> webhooks.Webhooks:

return Webhooks(self)

@cached_property
def fraud(self) -> Fraud:
from .resources.fraud import Fraud

return Fraud(self)

@cached_property
def with_raw_response(self) -> LithicWithRawResponse:
return LithicWithRawResponse(self)
Expand Down Expand Up @@ -726,6 +734,12 @@ def funding_events(self) -> AsyncFundingEvents:

return AsyncFundingEvents(self)

@cached_property
def fraud(self) -> AsyncFraud:
from .resources.fraud import AsyncFraud

return AsyncFraud(self)

@cached_property
def webhooks(self) -> webhooks.AsyncWebhooks:
from .resources.webhooks import AsyncWebhooks
Expand Down Expand Up @@ -1029,6 +1043,12 @@ def funding_events(self) -> funding_events.FundingEventsWithRawResponse:

return FundingEventsWithRawResponse(self._client.funding_events)

@cached_property
def fraud(self) -> fraud.FraudWithRawResponse:
from .resources.fraud import FraudWithRawResponse

return FraudWithRawResponse(self._client.fraud)


class AsyncLithicWithRawResponse:
_client: AsyncLithic
Expand Down Expand Up @@ -1190,6 +1210,12 @@ def funding_events(self) -> funding_events.AsyncFundingEventsWithRawResponse:

return AsyncFundingEventsWithRawResponse(self._client.funding_events)

@cached_property
def fraud(self) -> fraud.AsyncFraudWithRawResponse:
from .resources.fraud import AsyncFraudWithRawResponse

return AsyncFraudWithRawResponse(self._client.fraud)


class LithicWithStreamedResponse:
_client: Lithic
Expand Down Expand Up @@ -1351,6 +1377,12 @@ def funding_events(self) -> funding_events.FundingEventsWithStreamingResponse:

return FundingEventsWithStreamingResponse(self._client.funding_events)

@cached_property
def fraud(self) -> fraud.FraudWithStreamingResponse:
from .resources.fraud import FraudWithStreamingResponse

return FraudWithStreamingResponse(self._client.fraud)


class AsyncLithicWithStreamedResponse:
_client: AsyncLithic
Expand Down Expand Up @@ -1512,6 +1544,12 @@ def funding_events(self) -> funding_events.AsyncFundingEventsWithStreamingRespon

return AsyncFundingEventsWithStreamingResponse(self._client.funding_events)

@cached_property
def fraud(self) -> fraud.AsyncFraudWithStreamingResponse:
from .resources.fraud import AsyncFraudWithStreamingResponse

return AsyncFraudWithStreamingResponse(self._client.fraud)


Client = Lithic

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.94.0" # x-release-please-version
__version__ = "0.95.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/lithic/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
CardsWithStreamingResponse,
AsyncCardsWithStreamingResponse,
)
from .fraud import (
Fraud,
AsyncFraud,
FraudWithRawResponse,
AsyncFraudWithRawResponse,
FraudWithStreamingResponse,
AsyncFraudWithStreamingResponse,
)
from .events import (
Events,
AsyncEvents,
Expand Down Expand Up @@ -355,4 +363,10 @@
"AsyncFundingEventsWithRawResponse",
"FundingEventsWithStreamingResponse",
"AsyncFundingEventsWithStreamingResponse",
"Fraud",
"AsyncFraud",
"FraudWithRawResponse",
"AsyncFraudWithRawResponse",
"FraudWithStreamingResponse",
"AsyncFraudWithStreamingResponse",
]
30 changes: 16 additions & 14 deletions src/lithic/resources/auth_rules/v2/backtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ def create(
`/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}`
endpoint.

Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting
for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e.
where Lithic has pre-calculated the requested velocity metrics for historical
transactions), a backtest may be feasible. However, such cases are uncommon and
customers should not anticipate support for velocity backtests under most
configurations. If a historical transaction does not feature the required inputs
to evaluate the rule, then it will not be included in the final backtest report.
Lithic currently supports backtesting for `CONDITIONAL_BLOCK` /
`CONDITIONAL_3DS_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is
generally not supported. In specific cases (i.e. where Lithic has pre-calculated
the requested velocity metrics for historical transactions), a backtest may be
feasible. However, such cases are uncommon and customers should not anticipate
support for velocity backtests under most configurations. If a historical
transaction does not feature the required inputs to evaluate the rule, then it
will not be included in the final backtest report.

Args:
end: The end time of the backtest.
Expand Down Expand Up @@ -217,13 +218,14 @@ async def create(
`/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}`
endpoint.

Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting
for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e.
where Lithic has pre-calculated the requested velocity metrics for historical
transactions), a backtest may be feasible. However, such cases are uncommon and
customers should not anticipate support for velocity backtests under most
configurations. If a historical transaction does not feature the required inputs
to evaluate the rule, then it will not be included in the final backtest report.
Lithic currently supports backtesting for `CONDITIONAL_BLOCK` /
`CONDITIONAL_3DS_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is
generally not supported. In specific cases (i.e. where Lithic has pre-calculated
the requested velocity metrics for historical transactions), a backtest may be
feasible. However, such cases are uncommon and customers should not anticipate
support for velocity backtests under most configurations. If a historical
transaction does not feature the required inputs to evaluate the rule, then it
will not be included in the final backtest report.

Args:
end: The end time of the backtest.
Expand Down
Loading