Skip to content

Commit 5a634bb

Browse files
feat(api): updates to Auth Rules and Card provisioning
- removes Auth Performance reports from the API - adds additional response type to Card provisioning - adds new field to 3DS and ASA webhooks
1 parent 1f43f1d commit 5a634bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+344
-1484
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 169
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-b1839661d8405911184d5cb7230f16e626a616e5b744634bd7f0bb4e730bf899.yml
3-
openapi_spec_hash: c1c2c5a5c2a4067a714b35f873e3846f
4-
config_hash: 98214f2eab6804b5c0048331e32c08e3
1+
configured_endpoints: 168
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-6432801dcf017d9234739b9f6153a8cfecd91255af4765f24ba5209f3e320b5c.yml
3+
openapi_spec_hash: c2cfee2f044ba15d15b5bfdbd37280c0
4+
config_hash: 8ac73ccdb428816c89c84802c794a3f8

api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ from lithic.types.auth_rules import (
9595
V2ApplyResponse,
9696
V2DraftResponse,
9797
V2PromoteResponse,
98-
V2ReportResponse,
9998
V2RetrieveFeaturesResponse,
10099
V2RetrieveReportResponse,
101100
)
@@ -111,7 +110,6 @@ Methods:
111110
- <code title="post /v2/auth_rules/{auth_rule_token}/apply">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">apply</a>(auth_rule_token, \*\*<a href="src/lithic/types/auth_rules/v2_apply_params.py">params</a>) -> <a href="./src/lithic/types/auth_rules/v2_apply_response.py">V2ApplyResponse</a></code>
112111
- <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>
113112
- <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>
114-
- <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>
115113
- <code title="get /v2/auth_rules/{auth_rule_token}/features">client.auth_rules.v2.<a href="./src/lithic/resources/auth_rules/v2/v2.py">retrieve_features</a>(auth_rule_token, \*\*<a href="src/lithic/types/auth_rules/v2_retrieve_features_params.py">params</a>) -> <a href="./src/lithic/types/auth_rules/v2_retrieve_features_response.py">V2RetrieveFeaturesResponse</a></code>
116114
- <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>
117115

@@ -187,6 +185,7 @@ from lithic.types import (
187185
Card,
188186
CardSpendLimits,
189187
NonPCICard,
188+
ProvisionResponse,
190189
SpendLimitDuration,
191190
CardEmbedResponse,
192191
CardProvisionResponse,

src/lithic/resources/auth_rules/v2/v2.py

Lines changed: 0 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from ....types.auth_rules.v2_apply_response import V2ApplyResponse
3939
from ....types.auth_rules.v2_draft_response import V2DraftResponse
4040
from ....types.auth_rules.v2_create_response import V2CreateResponse
41-
from ....types.auth_rules.v2_report_response import V2ReportResponse
4241
from ....types.auth_rules.v2_update_response import V2UpdateResponse
4342
from ....types.auth_rules.v2_promote_response import V2PromoteResponse
4443
from ....types.auth_rules.v2_retrieve_response import V2RetrieveResponse
@@ -796,91 +795,6 @@ def promote(
796795
cast_to=V2PromoteResponse,
797796
)
798797

799-
@typing_extensions.deprecated("deprecated")
800-
def report(
801-
self,
802-
auth_rule_token: str,
803-
*,
804-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
805-
# The extra values given here take precedence over values defined on the client or passed to this method.
806-
extra_headers: Headers | None = None,
807-
extra_query: Query | None = None,
808-
extra_body: Body | None = None,
809-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
810-
) -> V2ReportResponse:
811-
"""This endpoint is deprecated and will be removed in the future.
812-
813-
Requests a
814-
performance report of an Auth rule to be asynchronously generated. Reports can
815-
only be run on rules in draft or active mode and will included approved and
816-
declined statistics as well as examples. The generated report will be delivered
817-
asynchronously through a webhook with `event_type` =
818-
`auth_rules.performance_report.created`. See the docs on setting up
819-
[webhook subscriptions](https://docs.lithic.com/docs/events-api).
820-
821-
Reports are generated based on data collected by Lithic's processing system in
822-
the trailing week. The performance of the auth rule will be assessed on the
823-
configuration of the auth rule at the time the report is requested. This implies
824-
that if a performance report is requested, right after updating an auth rule,
825-
depending on the number of events processed for a card program, it may be the
826-
case that no data is available for the report. Therefore Lithic recommends to
827-
decouple making updates to an Auth Rule, and requesting performance reports.
828-
829-
To make this concrete, consider the following example:
830-
831-
1. At time `t`, a new Auth Rule is created, and applies to all auth events on a
832-
card program. The Auth Rule has not yet been promoted, causing the draft
833-
version of the rule to be applied in shadow mode.
834-
2. At time `t + 1 hour` a performance report is requested for the Auth Rule.
835-
This performance report will _only_ contain data for the Auth Rule being
836-
executed in the window between `t` and `t + 1 hour`. This is because Lithic's
837-
transaction processing system will only start capturing data for the Auth
838-
Rule at the time it is created.
839-
3. At time `t + 2 hours` the draft version of the Auth Rule is promoted to the
840-
active version of the Auth Rule by calling the
841-
`/v2/auth_rules/{auth_rule_token}/promote` endpoint. If a performance report
842-
is requested at this moment it will still only contain data for this version
843-
of the rule, but the window of available data will now span from `t` to
844-
`t + 2 hours`.
845-
4. At time `t + 3 hours` a new version of the rule is drafted by calling the
846-
`/v2/auth_rules/{auth_rule_token}/draft` endpoint. If a performance report is
847-
requested right at this moment, it will only contain data for events to which
848-
both the active version and the draft version is applied. Lithic does this to
849-
ensure that performance reports represent a fair comparison between rules.
850-
Because there may be no events in this window, and because there may be some
851-
lag before data is available in a performance report, the requested
852-
performance report could contain no to little data.
853-
5. At time `t + 4 hours` another performance report is requested: this time the
854-
performance report will contain data from the window between `t + 3 hours`
855-
and `t + 4 hours`, for any events to which both the current version of the
856-
Auth rule (in enforcing mode) and the draft version of the Auth rule (in
857-
shadow mode) applied.
858-
859-
Note that generating a report may take up to 15 minutes and that delivery is not
860-
guaranteed. Customers are required to have created an event subscription to
861-
receive the webhook. Additionally, there is a delay of approximately 15 minutes
862-
between when Lithic's transaction processing systems have processed the
863-
transaction, and when a transaction will be included in the report.
864-
865-
Args:
866-
extra_headers: Send extra headers
867-
868-
extra_query: Add additional query parameters to the request
869-
870-
extra_body: Add additional JSON properties to the request
871-
872-
timeout: Override the client-level default timeout for this request, in seconds
873-
"""
874-
if not auth_rule_token:
875-
raise ValueError(f"Expected a non-empty value for `auth_rule_token` but received {auth_rule_token!r}")
876-
return self._post(
877-
f"/v2/auth_rules/{auth_rule_token}/report",
878-
options=make_request_options(
879-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
880-
),
881-
cast_to=V2ReportResponse,
882-
)
883-
884798
def retrieve_features(
885799
self,
886800
auth_rule_token: str,
@@ -1744,91 +1658,6 @@ async def promote(
17441658
cast_to=V2PromoteResponse,
17451659
)
17461660

1747-
@typing_extensions.deprecated("deprecated")
1748-
async def report(
1749-
self,
1750-
auth_rule_token: str,
1751-
*,
1752-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1753-
# The extra values given here take precedence over values defined on the client or passed to this method.
1754-
extra_headers: Headers | None = None,
1755-
extra_query: Query | None = None,
1756-
extra_body: Body | None = None,
1757-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1758-
) -> V2ReportResponse:
1759-
"""This endpoint is deprecated and will be removed in the future.
1760-
1761-
Requests a
1762-
performance report of an Auth rule to be asynchronously generated. Reports can
1763-
only be run on rules in draft or active mode and will included approved and
1764-
declined statistics as well as examples. The generated report will be delivered
1765-
asynchronously through a webhook with `event_type` =
1766-
`auth_rules.performance_report.created`. See the docs on setting up
1767-
[webhook subscriptions](https://docs.lithic.com/docs/events-api).
1768-
1769-
Reports are generated based on data collected by Lithic's processing system in
1770-
the trailing week. The performance of the auth rule will be assessed on the
1771-
configuration of the auth rule at the time the report is requested. This implies
1772-
that if a performance report is requested, right after updating an auth rule,
1773-
depending on the number of events processed for a card program, it may be the
1774-
case that no data is available for the report. Therefore Lithic recommends to
1775-
decouple making updates to an Auth Rule, and requesting performance reports.
1776-
1777-
To make this concrete, consider the following example:
1778-
1779-
1. At time `t`, a new Auth Rule is created, and applies to all auth events on a
1780-
card program. The Auth Rule has not yet been promoted, causing the draft
1781-
version of the rule to be applied in shadow mode.
1782-
2. At time `t + 1 hour` a performance report is requested for the Auth Rule.
1783-
This performance report will _only_ contain data for the Auth Rule being
1784-
executed in the window between `t` and `t + 1 hour`. This is because Lithic's
1785-
transaction processing system will only start capturing data for the Auth
1786-
Rule at the time it is created.
1787-
3. At time `t + 2 hours` the draft version of the Auth Rule is promoted to the
1788-
active version of the Auth Rule by calling the
1789-
`/v2/auth_rules/{auth_rule_token}/promote` endpoint. If a performance report
1790-
is requested at this moment it will still only contain data for this version
1791-
of the rule, but the window of available data will now span from `t` to
1792-
`t + 2 hours`.
1793-
4. At time `t + 3 hours` a new version of the rule is drafted by calling the
1794-
`/v2/auth_rules/{auth_rule_token}/draft` endpoint. If a performance report is
1795-
requested right at this moment, it will only contain data for events to which
1796-
both the active version and the draft version is applied. Lithic does this to
1797-
ensure that performance reports represent a fair comparison between rules.
1798-
Because there may be no events in this window, and because there may be some
1799-
lag before data is available in a performance report, the requested
1800-
performance report could contain no to little data.
1801-
5. At time `t + 4 hours` another performance report is requested: this time the
1802-
performance report will contain data from the window between `t + 3 hours`
1803-
and `t + 4 hours`, for any events to which both the current version of the
1804-
Auth rule (in enforcing mode) and the draft version of the Auth rule (in
1805-
shadow mode) applied.
1806-
1807-
Note that generating a report may take up to 15 minutes and that delivery is not
1808-
guaranteed. Customers are required to have created an event subscription to
1809-
receive the webhook. Additionally, there is a delay of approximately 15 minutes
1810-
between when Lithic's transaction processing systems have processed the
1811-
transaction, and when a transaction will be included in the report.
1812-
1813-
Args:
1814-
extra_headers: Send extra headers
1815-
1816-
extra_query: Add additional query parameters to the request
1817-
1818-
extra_body: Add additional JSON properties to the request
1819-
1820-
timeout: Override the client-level default timeout for this request, in seconds
1821-
"""
1822-
if not auth_rule_token:
1823-
raise ValueError(f"Expected a non-empty value for `auth_rule_token` but received {auth_rule_token!r}")
1824-
return await self._post(
1825-
f"/v2/auth_rules/{auth_rule_token}/report",
1826-
options=make_request_options(
1827-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1828-
),
1829-
cast_to=V2ReportResponse,
1830-
)
1831-
18321661
async def retrieve_features(
18331662
self,
18341663
auth_rule_token: str,
@@ -1974,11 +1803,6 @@ def __init__(self, v2: V2) -> None:
19741803
self.promote = _legacy_response.to_raw_response_wrapper(
19751804
v2.promote,
19761805
)
1977-
self.report = ( # pyright: ignore[reportDeprecated]
1978-
_legacy_response.to_raw_response_wrapper(
1979-
v2.report, # pyright: ignore[reportDeprecated],
1980-
)
1981-
)
19821806
self.retrieve_features = _legacy_response.to_raw_response_wrapper(
19831807
v2.retrieve_features,
19841808
)
@@ -2021,11 +1845,6 @@ def __init__(self, v2: AsyncV2) -> None:
20211845
self.promote = _legacy_response.async_to_raw_response_wrapper(
20221846
v2.promote,
20231847
)
2024-
self.report = ( # pyright: ignore[reportDeprecated]
2025-
_legacy_response.async_to_raw_response_wrapper(
2026-
v2.report, # pyright: ignore[reportDeprecated],
2027-
)
2028-
)
20291848
self.retrieve_features = _legacy_response.async_to_raw_response_wrapper(
20301849
v2.retrieve_features,
20311850
)
@@ -2068,11 +1887,6 @@ def __init__(self, v2: V2) -> None:
20681887
self.promote = to_streamed_response_wrapper(
20691888
v2.promote,
20701889
)
2071-
self.report = ( # pyright: ignore[reportDeprecated]
2072-
to_streamed_response_wrapper(
2073-
v2.report, # pyright: ignore[reportDeprecated],
2074-
)
2075-
)
20761890
self.retrieve_features = to_streamed_response_wrapper(
20771891
v2.retrieve_features,
20781892
)
@@ -2115,11 +1929,6 @@ def __init__(self, v2: AsyncV2) -> None:
21151929
self.promote = async_to_streamed_response_wrapper(
21161930
v2.promote,
21171931
)
2118-
self.report = ( # pyright: ignore[reportDeprecated]
2119-
async_to_streamed_response_wrapper(
2120-
v2.report, # pyright: ignore[reportDeprecated],
2121-
)
2122-
)
21231932
self.retrieve_features = async_to_streamed_response_wrapper(
21241933
v2.retrieve_features,
21251934
)

src/lithic/resources/events/events.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def list(
111111
"account_holder.created",
112112
"account_holder.updated",
113113
"account_holder.verification",
114-
"auth_rules.performance_report.created",
115114
"balance.updated",
116115
"book_transfer_transaction.created",
117116
"card.created",
@@ -380,7 +379,6 @@ def list(
380379
"account_holder.created",
381380
"account_holder.updated",
382381
"account_holder.verification",
383-
"auth_rules.performance_report.created",
384382
"balance.updated",
385383
"book_transfer_transaction.created",
386384
"card.created",

src/lithic/resources/events/subscriptions.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def create(
6363
"account_holder.created",
6464
"account_holder.updated",
6565
"account_holder.verification",
66-
"auth_rules.performance_report.created",
6766
"balance.updated",
6867
"book_transfer_transaction.created",
6968
"card.created",
@@ -202,7 +201,6 @@ def update(
202201
"account_holder.created",
203202
"account_holder.updated",
204203
"account_holder.verification",
205-
"auth_rules.performance_report.created",
206204
"balance.updated",
207205
"book_transfer_transaction.created",
208206
"card.created",
@@ -647,7 +645,6 @@ def send_simulated_example(
647645
"account_holder.created",
648646
"account_holder.updated",
649647
"account_holder.verification",
650-
"auth_rules.performance_report.created",
651648
"balance.updated",
652649
"book_transfer_transaction.created",
653650
"card.created",
@@ -762,7 +759,6 @@ async def create(
762759
"account_holder.created",
763760
"account_holder.updated",
764761
"account_holder.verification",
765-
"auth_rules.performance_report.created",
766762
"balance.updated",
767763
"book_transfer_transaction.created",
768764
"card.created",
@@ -901,7 +897,6 @@ async def update(
901897
"account_holder.created",
902898
"account_holder.updated",
903899
"account_holder.verification",
904-
"auth_rules.performance_report.created",
905900
"balance.updated",
906901
"book_transfer_transaction.created",
907902
"card.created",
@@ -1346,7 +1341,6 @@ async def send_simulated_example(
13461341
"account_holder.created",
13471342
"account_holder.updated",
13481343
"account_holder.verification",
1349-
"auth_rules.performance_report.created",
13501344
"balance.updated",
13511345
"book_transfer_transaction.created",
13521346
"card.created",

0 commit comments

Comments
 (0)