Skip to content

Commit 324431e

Browse files
feat(api): new Funding Events and Card Web Provision API's
- Card Web Provisioning API allows your cardholders to directly add payment cards to the device's digital wallet from a browser on the web. Currently only supported for Apple Pay. - new Funding Events API and Webhooks
1 parent 6be2744 commit 324431e

15 files changed

+1067
-4
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: 156
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-9580d7ed7ee603cba3dd0db9bb1ee48094dfe2a90c1ca13a7f10ab8deaa73e2c.yml
3-
openapi_spec_hash: 6f707e3df699aec761f20db720fb3a32
4-
config_hash: dc221a354631e360e545ebb7435ecd35
1+
configured_endpoints: 160
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-025f40c854a9485cf316c9058f9cc5fa37f069add30e409d49ab93f2e166f4fb.yml
3+
openapi_spec_hash: a9391f3a54b8db5d5df40169de8c645c
4+
config_hash: fa3481d1d8505e4157f6cebe93211bd0

api.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ from lithic.types import (
184184
SpendLimitDuration,
185185
CardEmbedResponse,
186186
CardProvisionResponse,
187+
CardWebProvisionResponse,
187188
)
188189
```
189190

@@ -200,6 +201,7 @@ Methods:
200201
- <code title="post /v1/cards/{card_token}/renew">client.cards.<a href="./src/lithic/resources/cards/cards.py">renew</a>(card_token, \*\*<a href="src/lithic/types/card_renew_params.py">params</a>) -> <a href="./src/lithic/types/card.py">Card</a></code>
201202
- <code title="get /v1/cards/{card_token}/spend_limits">client.cards.<a href="./src/lithic/resources/cards/cards.py">retrieve_spend_limits</a>(card_token) -> <a href="./src/lithic/types/card_spend_limits.py">CardSpendLimits</a></code>
202203
- <code title="post /v1/cards/search_by_pan">client.cards.<a href="./src/lithic/resources/cards/cards.py">search_by_pan</a>(\*\*<a href="src/lithic/types/card_search_by_pan_params.py">params</a>) -> <a href="./src/lithic/types/card.py">Card</a></code>
204+
- <code title="post /v1/cards/{card_token}/web_provision">client.cards.<a href="./src/lithic/resources/cards/cards.py">web_provision</a>(card_token, \*\*<a href="src/lithic/types/card_web_provision_params.py">params</a>) -> <a href="./src/lithic/types/card_web_provision_response.py">CardWebProvisionResponse</a></code>
203205
- <code>client.cards.<a href="./src/lithic/resources/cards/cards.py">get_embed_html</a>(\*args) -> str</code>
204206
- <code>client.cards.<a href="./src/lithic/resources/cards/cards.py">get_embed_url</a>(\*args) -> URL</code>
205207

@@ -713,3 +715,21 @@ Methods:
713715
- <code title="get /v1/management_operations/{management_operation_token}">client.management_operations.<a href="./src/lithic/resources/management_operations.py">retrieve</a>(management_operation_token) -> <a href="./src/lithic/types/management_operation_transaction.py">ManagementOperationTransaction</a></code>
714716
- <code title="get /v1/management_operations">client.management_operations.<a href="./src/lithic/resources/management_operations.py">list</a>(\*\*<a href="src/lithic/types/management_operation_list_params.py">params</a>) -> <a href="./src/lithic/types/management_operation_transaction.py">SyncCursorPage[ManagementOperationTransaction]</a></code>
715717
- <code title="post /v1/management_operations/{management_operation_token}/reverse">client.management_operations.<a href="./src/lithic/resources/management_operations.py">reverse</a>(management_operation_token, \*\*<a href="src/lithic/types/management_operation_reverse_params.py">params</a>) -> <a href="./src/lithic/types/management_operation_transaction.py">ManagementOperationTransaction</a></code>
718+
719+
# FundingEvents
720+
721+
Types:
722+
723+
```python
724+
from lithic.types import (
725+
FundingEventRetrieveResponse,
726+
FundingEventListResponse,
727+
FundingEventRetrieveDetailsResponse,
728+
)
729+
```
730+
731+
Methods:
732+
733+
- <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>
734+
- <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>
735+
- <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>

src/lithic/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
card_programs,
5353
tokenizations,
5454
book_transfers,
55+
funding_events,
5556
account_holders,
5657
credit_products,
5758
digital_card_art,
@@ -73,6 +74,7 @@
7374
from .resources.events.events import Events, AsyncEvents
7475
from .resources.tokenizations import Tokenizations, AsyncTokenizations
7576
from .resources.book_transfers import BookTransfers, AsyncBookTransfers
77+
from .resources.funding_events import FundingEvents, AsyncFundingEvents
7678
from .resources.account_holders import AccountHolders, AsyncAccountHolders
7779
from .resources.reports.reports import Reports, AsyncReports
7880
from .resources.digital_card_art import DigitalCardArtResource, AsyncDigitalCardArtResource
@@ -338,6 +340,12 @@ def management_operations(self) -> ManagementOperations:
338340

339341
return ManagementOperations(self)
340342

343+
@cached_property
344+
def funding_events(self) -> FundingEvents:
345+
from .resources.funding_events import FundingEvents
346+
347+
return FundingEvents(self)
348+
341349
@cached_property
342350
def webhooks(self) -> webhooks.Webhooks:
343351
from .resources.webhooks import Webhooks
@@ -712,6 +720,12 @@ def management_operations(self) -> AsyncManagementOperations:
712720

713721
return AsyncManagementOperations(self)
714722

723+
@cached_property
724+
def funding_events(self) -> AsyncFundingEvents:
725+
from .resources.funding_events import AsyncFundingEvents
726+
727+
return AsyncFundingEvents(self)
728+
715729
@cached_property
716730
def webhooks(self) -> webhooks.AsyncWebhooks:
717731
from .resources.webhooks import AsyncWebhooks
@@ -1009,6 +1023,12 @@ def management_operations(self) -> management_operations.ManagementOperationsWit
10091023

10101024
return ManagementOperationsWithRawResponse(self._client.management_operations)
10111025

1026+
@cached_property
1027+
def funding_events(self) -> funding_events.FundingEventsWithRawResponse:
1028+
from .resources.funding_events import FundingEventsWithRawResponse
1029+
1030+
return FundingEventsWithRawResponse(self._client.funding_events)
1031+
10121032

10131033
class AsyncLithicWithRawResponse:
10141034
_client: AsyncLithic
@@ -1164,6 +1184,12 @@ def management_operations(self) -> management_operations.AsyncManagementOperatio
11641184

11651185
return AsyncManagementOperationsWithRawResponse(self._client.management_operations)
11661186

1187+
@cached_property
1188+
def funding_events(self) -> funding_events.AsyncFundingEventsWithRawResponse:
1189+
from .resources.funding_events import AsyncFundingEventsWithRawResponse
1190+
1191+
return AsyncFundingEventsWithRawResponse(self._client.funding_events)
1192+
11671193

11681194
class LithicWithStreamedResponse:
11691195
_client: Lithic
@@ -1319,6 +1345,12 @@ def management_operations(self) -> management_operations.ManagementOperationsWit
13191345

13201346
return ManagementOperationsWithStreamingResponse(self._client.management_operations)
13211347

1348+
@cached_property
1349+
def funding_events(self) -> funding_events.FundingEventsWithStreamingResponse:
1350+
from .resources.funding_events import FundingEventsWithStreamingResponse
1351+
1352+
return FundingEventsWithStreamingResponse(self._client.funding_events)
1353+
13221354

13231355
class AsyncLithicWithStreamedResponse:
13241356
_client: AsyncLithic
@@ -1474,6 +1506,12 @@ def management_operations(self) -> management_operations.AsyncManagementOperatio
14741506

14751507
return AsyncManagementOperationsWithStreamingResponse(self._client.management_operations)
14761508

1509+
@cached_property
1510+
def funding_events(self) -> funding_events.AsyncFundingEventsWithStreamingResponse:
1511+
from .resources.funding_events import AsyncFundingEventsWithStreamingResponse
1512+
1513+
return AsyncFundingEventsWithStreamingResponse(self._client.funding_events)
1514+
14771515

14781516
Client = Lithic
14791517

src/lithic/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@
105105
BookTransfersWithStreamingResponse,
106106
AsyncBookTransfersWithStreamingResponse,
107107
)
108+
from .funding_events import (
109+
FundingEvents,
110+
AsyncFundingEvents,
111+
FundingEventsWithRawResponse,
112+
AsyncFundingEventsWithRawResponse,
113+
FundingEventsWithStreamingResponse,
114+
AsyncFundingEventsWithStreamingResponse,
115+
)
108116
from .account_holders import (
109117
AccountHolders,
110118
AsyncAccountHolders,
@@ -341,4 +349,10 @@
341349
"AsyncManagementOperationsWithRawResponse",
342350
"ManagementOperationsWithStreamingResponse",
343351
"AsyncManagementOperationsWithStreamingResponse",
352+
"FundingEvents",
353+
"AsyncFundingEvents",
354+
"FundingEventsWithRawResponse",
355+
"AsyncFundingEventsWithRawResponse",
356+
"FundingEventsWithStreamingResponse",
357+
"AsyncFundingEventsWithStreamingResponse",
344358
]

src/lithic/resources/cards/cards.py

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
card_provision_params,
2626
card_get_embed_url_params,
2727
card_search_by_pan_params,
28+
card_web_provision_params,
2829
card_convert_physical_params,
2930
)
3031
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, Base64FileInput
@@ -64,6 +65,7 @@
6465
from ...types.spend_limit_duration import SpendLimitDuration
6566
from ...types.shared_params.carrier import Carrier
6667
from ...types.card_provision_response import CardProvisionResponse
68+
from ...types.card_web_provision_response import CardWebProvisionResponse
6769
from ...types.shared_params.shipping_address import ShippingAddress
6870

6971
__all__ = ["Cards", "AsyncCards"]
@@ -1059,6 +1061,48 @@ def search_by_pan(
10591061
cast_to=Card,
10601062
)
10611063

1064+
def web_provision(
1065+
self,
1066+
card_token: str,
1067+
*,
1068+
digital_wallet: Literal["APPLE_PAY"] | NotGiven = NOT_GIVEN,
1069+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1070+
# The extra values given here take precedence over values defined on the client or passed to this method.
1071+
extra_headers: Headers | None = None,
1072+
extra_query: Query | None = None,
1073+
extra_body: Body | None = None,
1074+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1075+
) -> CardWebProvisionResponse:
1076+
"""
1077+
Allow your cardholders to directly add payment cards to the device's digital
1078+
wallet from a browser on the web. Currently only suported for Apple Pay.
1079+
1080+
This requires some additional setup and configuration. Please
1081+
[Contact Us](https://lithic.com/contact) or your Customer Success representative
1082+
for more information.
1083+
1084+
Args:
1085+
digital_wallet: Name of digital wallet provider.
1086+
1087+
extra_headers: Send extra headers
1088+
1089+
extra_query: Add additional query parameters to the request
1090+
1091+
extra_body: Add additional JSON properties to the request
1092+
1093+
timeout: Override the client-level default timeout for this request, in seconds
1094+
"""
1095+
if not card_token:
1096+
raise ValueError(f"Expected a non-empty value for `card_token` but received {card_token!r}")
1097+
return self._post(
1098+
f"/v1/cards/{card_token}/web_provision",
1099+
body=maybe_transform({"digital_wallet": digital_wallet}, card_web_provision_params.CardWebProvisionParams),
1100+
options=make_request_options(
1101+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1102+
),
1103+
cast_to=CardWebProvisionResponse,
1104+
)
1105+
10621106

10631107
class AsyncCards(AsyncAPIResource):
10641108
@cached_property
@@ -2050,6 +2094,50 @@ async def search_by_pan(
20502094
cast_to=Card,
20512095
)
20522096

2097+
async def web_provision(
2098+
self,
2099+
card_token: str,
2100+
*,
2101+
digital_wallet: Literal["APPLE_PAY"] | NotGiven = NOT_GIVEN,
2102+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
2103+
# The extra values given here take precedence over values defined on the client or passed to this method.
2104+
extra_headers: Headers | None = None,
2105+
extra_query: Query | None = None,
2106+
extra_body: Body | None = None,
2107+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2108+
) -> CardWebProvisionResponse:
2109+
"""
2110+
Allow your cardholders to directly add payment cards to the device's digital
2111+
wallet from a browser on the web. Currently only suported for Apple Pay.
2112+
2113+
This requires some additional setup and configuration. Please
2114+
[Contact Us](https://lithic.com/contact) or your Customer Success representative
2115+
for more information.
2116+
2117+
Args:
2118+
digital_wallet: Name of digital wallet provider.
2119+
2120+
extra_headers: Send extra headers
2121+
2122+
extra_query: Add additional query parameters to the request
2123+
2124+
extra_body: Add additional JSON properties to the request
2125+
2126+
timeout: Override the client-level default timeout for this request, in seconds
2127+
"""
2128+
if not card_token:
2129+
raise ValueError(f"Expected a non-empty value for `card_token` but received {card_token!r}")
2130+
return await self._post(
2131+
f"/v1/cards/{card_token}/web_provision",
2132+
body=await async_maybe_transform(
2133+
{"digital_wallet": digital_wallet}, card_web_provision_params.CardWebProvisionParams
2134+
),
2135+
options=make_request_options(
2136+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
2137+
),
2138+
cast_to=CardWebProvisionResponse,
2139+
)
2140+
20532141

20542142
class CardsWithRawResponse:
20552143
def __init__(self, cards: Cards) -> None:
@@ -2088,6 +2176,9 @@ def __init__(self, cards: Cards) -> None:
20882176
self.search_by_pan = _legacy_response.to_raw_response_wrapper(
20892177
cards.search_by_pan,
20902178
)
2179+
self.web_provision = _legacy_response.to_raw_response_wrapper(
2180+
cards.web_provision,
2181+
)
20912182

20922183
@cached_property
20932184
def aggregate_balances(self) -> AggregateBalancesWithRawResponse:
@@ -2139,6 +2230,9 @@ def __init__(self, cards: AsyncCards) -> None:
21392230
self.search_by_pan = _legacy_response.async_to_raw_response_wrapper(
21402231
cards.search_by_pan,
21412232
)
2233+
self.web_provision = _legacy_response.async_to_raw_response_wrapper(
2234+
cards.web_provision,
2235+
)
21422236

21432237
@cached_property
21442238
def aggregate_balances(self) -> AsyncAggregateBalancesWithRawResponse:
@@ -2190,6 +2284,9 @@ def __init__(self, cards: Cards) -> None:
21902284
self.search_by_pan = to_streamed_response_wrapper(
21912285
cards.search_by_pan,
21922286
)
2287+
self.web_provision = to_streamed_response_wrapper(
2288+
cards.web_provision,
2289+
)
21932290

21942291
@cached_property
21952292
def aggregate_balances(self) -> AggregateBalancesWithStreamingResponse:
@@ -2241,6 +2338,9 @@ def __init__(self, cards: AsyncCards) -> None:
22412338
self.search_by_pan = async_to_streamed_response_wrapper(
22422339
cards.search_by_pan,
22432340
)
2341+
self.web_provision = async_to_streamed_response_wrapper(
2342+
cards.web_provision,
2343+
)
22442344

22452345
@cached_property
22462346
def aggregate_balances(self) -> AsyncAggregateBalancesWithStreamingResponse:

0 commit comments

Comments
 (0)