checkout-intents 0.8.0__py3-none-any.whl → 0.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checkout_intents/_client.py +38 -1
- checkout_intents/_version.py +1 -1
- checkout_intents/resources/__init__.py +14 -0
- checkout_intents/resources/betas/__init__.py +33 -0
- checkout_intents/resources/betas/betas.py +102 -0
- checkout_intents/resources/betas/checkout_sessions.py +208 -0
- checkout_intents/types/__init__.py +1 -0
- checkout_intents/types/betas/__init__.py +5 -0
- checkout_intents/types/betas/checkout_session_create_params.py +62 -0
- checkout_intents/types/checkout_session.py +16 -0
- {checkout_intents-0.8.0.dist-info → checkout_intents-0.10.0.dist-info}/METADATA +21 -5
- {checkout_intents-0.8.0.dist-info → checkout_intents-0.10.0.dist-info}/RECORD +14 -8
- {checkout_intents-0.8.0.dist-info → checkout_intents-0.10.0.dist-info}/licenses/LICENSE +1 -1
- {checkout_intents-0.8.0.dist-info → checkout_intents-0.10.0.dist-info}/WHEEL +0 -0
checkout_intents/_client.py
CHANGED
|
@@ -31,8 +31,9 @@ from ._base_client import (
|
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
if TYPE_CHECKING:
|
|
34
|
-
from .resources import brands, checkout_intents
|
|
34
|
+
from .resources import betas, brands, checkout_intents
|
|
35
35
|
from .resources.brands import BrandsResource, AsyncBrandsResource
|
|
36
|
+
from .resources.betas.betas import BetasResource, AsyncBetasResource
|
|
36
37
|
from .resources.checkout_intents import CheckoutIntentsResource, AsyncCheckoutIntentsResource
|
|
37
38
|
|
|
38
39
|
__all__ = [
|
|
@@ -172,6 +173,12 @@ class CheckoutIntents(SyncAPIClient):
|
|
|
172
173
|
|
|
173
174
|
return CheckoutIntentsResource(self)
|
|
174
175
|
|
|
176
|
+
@cached_property
|
|
177
|
+
def betas(self) -> BetasResource:
|
|
178
|
+
from .resources.betas import BetasResource
|
|
179
|
+
|
|
180
|
+
return BetasResource(self)
|
|
181
|
+
|
|
175
182
|
@cached_property
|
|
176
183
|
def brands(self) -> BrandsResource:
|
|
177
184
|
from .resources.brands import BrandsResource
|
|
@@ -395,6 +402,12 @@ class AsyncCheckoutIntents(AsyncAPIClient):
|
|
|
395
402
|
|
|
396
403
|
return AsyncCheckoutIntentsResource(self)
|
|
397
404
|
|
|
405
|
+
@cached_property
|
|
406
|
+
def betas(self) -> AsyncBetasResource:
|
|
407
|
+
from .resources.betas import AsyncBetasResource
|
|
408
|
+
|
|
409
|
+
return AsyncBetasResource(self)
|
|
410
|
+
|
|
398
411
|
@cached_property
|
|
399
412
|
def brands(self) -> AsyncBrandsResource:
|
|
400
413
|
from .resources.brands import AsyncBrandsResource
|
|
@@ -528,6 +541,12 @@ class CheckoutIntentsWithRawResponse:
|
|
|
528
541
|
|
|
529
542
|
return CheckoutIntentsResourceWithRawResponse(self._client.checkout_intents)
|
|
530
543
|
|
|
544
|
+
@cached_property
|
|
545
|
+
def betas(self) -> betas.BetasResourceWithRawResponse:
|
|
546
|
+
from .resources.betas import BetasResourceWithRawResponse
|
|
547
|
+
|
|
548
|
+
return BetasResourceWithRawResponse(self._client.betas)
|
|
549
|
+
|
|
531
550
|
@cached_property
|
|
532
551
|
def brands(self) -> brands.BrandsResourceWithRawResponse:
|
|
533
552
|
from .resources.brands import BrandsResourceWithRawResponse
|
|
@@ -547,6 +566,12 @@ class AsyncCheckoutIntentsWithRawResponse:
|
|
|
547
566
|
|
|
548
567
|
return AsyncCheckoutIntentsResourceWithRawResponse(self._client.checkout_intents)
|
|
549
568
|
|
|
569
|
+
@cached_property
|
|
570
|
+
def betas(self) -> betas.AsyncBetasResourceWithRawResponse:
|
|
571
|
+
from .resources.betas import AsyncBetasResourceWithRawResponse
|
|
572
|
+
|
|
573
|
+
return AsyncBetasResourceWithRawResponse(self._client.betas)
|
|
574
|
+
|
|
550
575
|
@cached_property
|
|
551
576
|
def brands(self) -> brands.AsyncBrandsResourceWithRawResponse:
|
|
552
577
|
from .resources.brands import AsyncBrandsResourceWithRawResponse
|
|
@@ -566,6 +591,12 @@ class CheckoutIntentsWithStreamedResponse:
|
|
|
566
591
|
|
|
567
592
|
return CheckoutIntentsResourceWithStreamingResponse(self._client.checkout_intents)
|
|
568
593
|
|
|
594
|
+
@cached_property
|
|
595
|
+
def betas(self) -> betas.BetasResourceWithStreamingResponse:
|
|
596
|
+
from .resources.betas import BetasResourceWithStreamingResponse
|
|
597
|
+
|
|
598
|
+
return BetasResourceWithStreamingResponse(self._client.betas)
|
|
599
|
+
|
|
569
600
|
@cached_property
|
|
570
601
|
def brands(self) -> brands.BrandsResourceWithStreamingResponse:
|
|
571
602
|
from .resources.brands import BrandsResourceWithStreamingResponse
|
|
@@ -585,6 +616,12 @@ class AsyncCheckoutIntentsWithStreamedResponse:
|
|
|
585
616
|
|
|
586
617
|
return AsyncCheckoutIntentsResourceWithStreamingResponse(self._client.checkout_intents)
|
|
587
618
|
|
|
619
|
+
@cached_property
|
|
620
|
+
def betas(self) -> betas.AsyncBetasResourceWithStreamingResponse:
|
|
621
|
+
from .resources.betas import AsyncBetasResourceWithStreamingResponse
|
|
622
|
+
|
|
623
|
+
return AsyncBetasResourceWithStreamingResponse(self._client.betas)
|
|
624
|
+
|
|
588
625
|
@cached_property
|
|
589
626
|
def brands(self) -> brands.AsyncBrandsResourceWithStreamingResponse:
|
|
590
627
|
from .resources.brands import AsyncBrandsResourceWithStreamingResponse
|
checkout_intents/_version.py
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from .betas import (
|
|
4
|
+
BetasResource,
|
|
5
|
+
AsyncBetasResource,
|
|
6
|
+
BetasResourceWithRawResponse,
|
|
7
|
+
AsyncBetasResourceWithRawResponse,
|
|
8
|
+
BetasResourceWithStreamingResponse,
|
|
9
|
+
AsyncBetasResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
3
11
|
from .brands import (
|
|
4
12
|
BrandsResource,
|
|
5
13
|
AsyncBrandsResource,
|
|
@@ -24,6 +32,12 @@ __all__ = [
|
|
|
24
32
|
"AsyncCheckoutIntentsResourceWithRawResponse",
|
|
25
33
|
"CheckoutIntentsResourceWithStreamingResponse",
|
|
26
34
|
"AsyncCheckoutIntentsResourceWithStreamingResponse",
|
|
35
|
+
"BetasResource",
|
|
36
|
+
"AsyncBetasResource",
|
|
37
|
+
"BetasResourceWithRawResponse",
|
|
38
|
+
"AsyncBetasResourceWithRawResponse",
|
|
39
|
+
"BetasResourceWithStreamingResponse",
|
|
40
|
+
"AsyncBetasResourceWithStreamingResponse",
|
|
27
41
|
"BrandsResource",
|
|
28
42
|
"AsyncBrandsResource",
|
|
29
43
|
"BrandsResourceWithRawResponse",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .betas import (
|
|
4
|
+
BetasResource,
|
|
5
|
+
AsyncBetasResource,
|
|
6
|
+
BetasResourceWithRawResponse,
|
|
7
|
+
AsyncBetasResourceWithRawResponse,
|
|
8
|
+
BetasResourceWithStreamingResponse,
|
|
9
|
+
AsyncBetasResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .checkout_sessions import (
|
|
12
|
+
CheckoutSessionsResource,
|
|
13
|
+
AsyncCheckoutSessionsResource,
|
|
14
|
+
CheckoutSessionsResourceWithRawResponse,
|
|
15
|
+
AsyncCheckoutSessionsResourceWithRawResponse,
|
|
16
|
+
CheckoutSessionsResourceWithStreamingResponse,
|
|
17
|
+
AsyncCheckoutSessionsResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"CheckoutSessionsResource",
|
|
22
|
+
"AsyncCheckoutSessionsResource",
|
|
23
|
+
"CheckoutSessionsResourceWithRawResponse",
|
|
24
|
+
"AsyncCheckoutSessionsResourceWithRawResponse",
|
|
25
|
+
"CheckoutSessionsResourceWithStreamingResponse",
|
|
26
|
+
"AsyncCheckoutSessionsResourceWithStreamingResponse",
|
|
27
|
+
"BetasResource",
|
|
28
|
+
"AsyncBetasResource",
|
|
29
|
+
"BetasResourceWithRawResponse",
|
|
30
|
+
"AsyncBetasResourceWithRawResponse",
|
|
31
|
+
"BetasResourceWithStreamingResponse",
|
|
32
|
+
"AsyncBetasResourceWithStreamingResponse",
|
|
33
|
+
]
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from ..._compat import cached_property
|
|
6
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
7
|
+
from .checkout_sessions import (
|
|
8
|
+
CheckoutSessionsResource,
|
|
9
|
+
AsyncCheckoutSessionsResource,
|
|
10
|
+
CheckoutSessionsResourceWithRawResponse,
|
|
11
|
+
AsyncCheckoutSessionsResourceWithRawResponse,
|
|
12
|
+
CheckoutSessionsResourceWithStreamingResponse,
|
|
13
|
+
AsyncCheckoutSessionsResourceWithStreamingResponse,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__all__ = ["BetasResource", "AsyncBetasResource"]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class BetasResource(SyncAPIResource):
|
|
20
|
+
@cached_property
|
|
21
|
+
def checkout_sessions(self) -> CheckoutSessionsResource:
|
|
22
|
+
return CheckoutSessionsResource(self._client)
|
|
23
|
+
|
|
24
|
+
@cached_property
|
|
25
|
+
def with_raw_response(self) -> BetasResourceWithRawResponse:
|
|
26
|
+
"""
|
|
27
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
28
|
+
the raw response object instead of the parsed content.
|
|
29
|
+
|
|
30
|
+
For more information, see https://www.github.com/rye-com/checkout-intents-python#accessing-raw-response-data-eg-headers
|
|
31
|
+
"""
|
|
32
|
+
return BetasResourceWithRawResponse(self)
|
|
33
|
+
|
|
34
|
+
@cached_property
|
|
35
|
+
def with_streaming_response(self) -> BetasResourceWithStreamingResponse:
|
|
36
|
+
"""
|
|
37
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
38
|
+
|
|
39
|
+
For more information, see https://www.github.com/rye-com/checkout-intents-python#with_streaming_response
|
|
40
|
+
"""
|
|
41
|
+
return BetasResourceWithStreamingResponse(self)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AsyncBetasResource(AsyncAPIResource):
|
|
45
|
+
@cached_property
|
|
46
|
+
def checkout_sessions(self) -> AsyncCheckoutSessionsResource:
|
|
47
|
+
return AsyncCheckoutSessionsResource(self._client)
|
|
48
|
+
|
|
49
|
+
@cached_property
|
|
50
|
+
def with_raw_response(self) -> AsyncBetasResourceWithRawResponse:
|
|
51
|
+
"""
|
|
52
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
53
|
+
the raw response object instead of the parsed content.
|
|
54
|
+
|
|
55
|
+
For more information, see https://www.github.com/rye-com/checkout-intents-python#accessing-raw-response-data-eg-headers
|
|
56
|
+
"""
|
|
57
|
+
return AsyncBetasResourceWithRawResponse(self)
|
|
58
|
+
|
|
59
|
+
@cached_property
|
|
60
|
+
def with_streaming_response(self) -> AsyncBetasResourceWithStreamingResponse:
|
|
61
|
+
"""
|
|
62
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
63
|
+
|
|
64
|
+
For more information, see https://www.github.com/rye-com/checkout-intents-python#with_streaming_response
|
|
65
|
+
"""
|
|
66
|
+
return AsyncBetasResourceWithStreamingResponse(self)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class BetasResourceWithRawResponse:
|
|
70
|
+
def __init__(self, betas: BetasResource) -> None:
|
|
71
|
+
self._betas = betas
|
|
72
|
+
|
|
73
|
+
@cached_property
|
|
74
|
+
def checkout_sessions(self) -> CheckoutSessionsResourceWithRawResponse:
|
|
75
|
+
return CheckoutSessionsResourceWithRawResponse(self._betas.checkout_sessions)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class AsyncBetasResourceWithRawResponse:
|
|
79
|
+
def __init__(self, betas: AsyncBetasResource) -> None:
|
|
80
|
+
self._betas = betas
|
|
81
|
+
|
|
82
|
+
@cached_property
|
|
83
|
+
def checkout_sessions(self) -> AsyncCheckoutSessionsResourceWithRawResponse:
|
|
84
|
+
return AsyncCheckoutSessionsResourceWithRawResponse(self._betas.checkout_sessions)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class BetasResourceWithStreamingResponse:
|
|
88
|
+
def __init__(self, betas: BetasResource) -> None:
|
|
89
|
+
self._betas = betas
|
|
90
|
+
|
|
91
|
+
@cached_property
|
|
92
|
+
def checkout_sessions(self) -> CheckoutSessionsResourceWithStreamingResponse:
|
|
93
|
+
return CheckoutSessionsResourceWithStreamingResponse(self._betas.checkout_sessions)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class AsyncBetasResourceWithStreamingResponse:
|
|
97
|
+
def __init__(self, betas: AsyncBetasResource) -> None:
|
|
98
|
+
self._betas = betas
|
|
99
|
+
|
|
100
|
+
@cached_property
|
|
101
|
+
def checkout_sessions(self) -> AsyncCheckoutSessionsResourceWithStreamingResponse:
|
|
102
|
+
return AsyncCheckoutSessionsResourceWithStreamingResponse(self._betas.checkout_sessions)
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterable
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ..._compat import cached_property
|
|
12
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
13
|
+
from ..._response import (
|
|
14
|
+
to_raw_response_wrapper,
|
|
15
|
+
to_streamed_response_wrapper,
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
19
|
+
from ...types.betas import checkout_session_create_params
|
|
20
|
+
from ..._base_client import make_request_options
|
|
21
|
+
from ...types.checkout_session import CheckoutSession
|
|
22
|
+
from ...types.variant_selection_param import VariantSelectionParam
|
|
23
|
+
|
|
24
|
+
__all__ = ["CheckoutSessionsResource", "AsyncCheckoutSessionsResource"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CheckoutSessionsResource(SyncAPIResource):
|
|
28
|
+
@cached_property
|
|
29
|
+
def with_raw_response(self) -> CheckoutSessionsResourceWithRawResponse:
|
|
30
|
+
"""
|
|
31
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
32
|
+
the raw response object instead of the parsed content.
|
|
33
|
+
|
|
34
|
+
For more information, see https://www.github.com/rye-com/checkout-intents-python#accessing-raw-response-data-eg-headers
|
|
35
|
+
"""
|
|
36
|
+
return CheckoutSessionsResourceWithRawResponse(self)
|
|
37
|
+
|
|
38
|
+
@cached_property
|
|
39
|
+
def with_streaming_response(self) -> CheckoutSessionsResourceWithStreamingResponse:
|
|
40
|
+
"""
|
|
41
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
42
|
+
|
|
43
|
+
For more information, see https://www.github.com/rye-com/checkout-intents-python#with_streaming_response
|
|
44
|
+
"""
|
|
45
|
+
return CheckoutSessionsResourceWithStreamingResponse(self)
|
|
46
|
+
|
|
47
|
+
def create(
|
|
48
|
+
self,
|
|
49
|
+
*,
|
|
50
|
+
product_url: str,
|
|
51
|
+
quantity: float,
|
|
52
|
+
buyer: checkout_session_create_params.Buyer | Omit = omit,
|
|
53
|
+
constraints: checkout_session_create_params.Constraints | Omit = omit,
|
|
54
|
+
promo_codes: SequenceNotStr[str] | Omit = omit,
|
|
55
|
+
variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
|
|
56
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
57
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
58
|
+
extra_headers: Headers | None = None,
|
|
59
|
+
extra_query: Query | None = None,
|
|
60
|
+
extra_body: Body | None = None,
|
|
61
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
62
|
+
) -> CheckoutSession:
|
|
63
|
+
"""
|
|
64
|
+
Create a new checkout session.
|
|
65
|
+
|
|
66
|
+
Checkout sessions are hosted checkout forms your shoppers can use to complete
|
|
67
|
+
their purchases.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
buyer: Optional buyer information, used to pre-fill the checkout form with the buyer's
|
|
71
|
+
information.
|
|
72
|
+
|
|
73
|
+
extra_headers: Send extra headers
|
|
74
|
+
|
|
75
|
+
extra_query: Add additional query parameters to the request
|
|
76
|
+
|
|
77
|
+
extra_body: Add additional JSON properties to the request
|
|
78
|
+
|
|
79
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
80
|
+
"""
|
|
81
|
+
return self._post(
|
|
82
|
+
"/api/v1/betas/checkout-sessions",
|
|
83
|
+
body=maybe_transform(
|
|
84
|
+
{
|
|
85
|
+
"product_url": product_url,
|
|
86
|
+
"quantity": quantity,
|
|
87
|
+
"buyer": buyer,
|
|
88
|
+
"constraints": constraints,
|
|
89
|
+
"promo_codes": promo_codes,
|
|
90
|
+
"variant_selections": variant_selections,
|
|
91
|
+
},
|
|
92
|
+
checkout_session_create_params.CheckoutSessionCreateParams,
|
|
93
|
+
),
|
|
94
|
+
options=make_request_options(
|
|
95
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
96
|
+
),
|
|
97
|
+
cast_to=CheckoutSession,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class AsyncCheckoutSessionsResource(AsyncAPIResource):
|
|
102
|
+
@cached_property
|
|
103
|
+
def with_raw_response(self) -> AsyncCheckoutSessionsResourceWithRawResponse:
|
|
104
|
+
"""
|
|
105
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
106
|
+
the raw response object instead of the parsed content.
|
|
107
|
+
|
|
108
|
+
For more information, see https://www.github.com/rye-com/checkout-intents-python#accessing-raw-response-data-eg-headers
|
|
109
|
+
"""
|
|
110
|
+
return AsyncCheckoutSessionsResourceWithRawResponse(self)
|
|
111
|
+
|
|
112
|
+
@cached_property
|
|
113
|
+
def with_streaming_response(self) -> AsyncCheckoutSessionsResourceWithStreamingResponse:
|
|
114
|
+
"""
|
|
115
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
116
|
+
|
|
117
|
+
For more information, see https://www.github.com/rye-com/checkout-intents-python#with_streaming_response
|
|
118
|
+
"""
|
|
119
|
+
return AsyncCheckoutSessionsResourceWithStreamingResponse(self)
|
|
120
|
+
|
|
121
|
+
async def create(
|
|
122
|
+
self,
|
|
123
|
+
*,
|
|
124
|
+
product_url: str,
|
|
125
|
+
quantity: float,
|
|
126
|
+
buyer: checkout_session_create_params.Buyer | Omit = omit,
|
|
127
|
+
constraints: checkout_session_create_params.Constraints | Omit = omit,
|
|
128
|
+
promo_codes: SequenceNotStr[str] | Omit = omit,
|
|
129
|
+
variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
|
|
130
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
131
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
132
|
+
extra_headers: Headers | None = None,
|
|
133
|
+
extra_query: Query | None = None,
|
|
134
|
+
extra_body: Body | None = None,
|
|
135
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
136
|
+
) -> CheckoutSession:
|
|
137
|
+
"""
|
|
138
|
+
Create a new checkout session.
|
|
139
|
+
|
|
140
|
+
Checkout sessions are hosted checkout forms your shoppers can use to complete
|
|
141
|
+
their purchases.
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
buyer: Optional buyer information, used to pre-fill the checkout form with the buyer's
|
|
145
|
+
information.
|
|
146
|
+
|
|
147
|
+
extra_headers: Send extra headers
|
|
148
|
+
|
|
149
|
+
extra_query: Add additional query parameters to the request
|
|
150
|
+
|
|
151
|
+
extra_body: Add additional JSON properties to the request
|
|
152
|
+
|
|
153
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
154
|
+
"""
|
|
155
|
+
return await self._post(
|
|
156
|
+
"/api/v1/betas/checkout-sessions",
|
|
157
|
+
body=await async_maybe_transform(
|
|
158
|
+
{
|
|
159
|
+
"product_url": product_url,
|
|
160
|
+
"quantity": quantity,
|
|
161
|
+
"buyer": buyer,
|
|
162
|
+
"constraints": constraints,
|
|
163
|
+
"promo_codes": promo_codes,
|
|
164
|
+
"variant_selections": variant_selections,
|
|
165
|
+
},
|
|
166
|
+
checkout_session_create_params.CheckoutSessionCreateParams,
|
|
167
|
+
),
|
|
168
|
+
options=make_request_options(
|
|
169
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
170
|
+
),
|
|
171
|
+
cast_to=CheckoutSession,
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class CheckoutSessionsResourceWithRawResponse:
|
|
176
|
+
def __init__(self, checkout_sessions: CheckoutSessionsResource) -> None:
|
|
177
|
+
self._checkout_sessions = checkout_sessions
|
|
178
|
+
|
|
179
|
+
self.create = to_raw_response_wrapper(
|
|
180
|
+
checkout_sessions.create,
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class AsyncCheckoutSessionsResourceWithRawResponse:
|
|
185
|
+
def __init__(self, checkout_sessions: AsyncCheckoutSessionsResource) -> None:
|
|
186
|
+
self._checkout_sessions = checkout_sessions
|
|
187
|
+
|
|
188
|
+
self.create = async_to_raw_response_wrapper(
|
|
189
|
+
checkout_sessions.create,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class CheckoutSessionsResourceWithStreamingResponse:
|
|
194
|
+
def __init__(self, checkout_sessions: CheckoutSessionsResource) -> None:
|
|
195
|
+
self._checkout_sessions = checkout_sessions
|
|
196
|
+
|
|
197
|
+
self.create = to_streamed_response_wrapper(
|
|
198
|
+
checkout_sessions.create,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class AsyncCheckoutSessionsResourceWithStreamingResponse:
|
|
203
|
+
def __init__(self, checkout_sessions: AsyncCheckoutSessionsResource) -> None:
|
|
204
|
+
self._checkout_sessions = checkout_sessions
|
|
205
|
+
|
|
206
|
+
self.create = async_to_streamed_response_wrapper(
|
|
207
|
+
checkout_sessions.create,
|
|
208
|
+
)
|
|
@@ -8,6 +8,7 @@ from .offer import Offer as Offer
|
|
|
8
8
|
from .buyer_param import BuyerParam as BuyerParam
|
|
9
9
|
from .payment_method import PaymentMethod as PaymentMethod
|
|
10
10
|
from .checkout_intent import CheckoutIntent as CheckoutIntent
|
|
11
|
+
from .checkout_session import CheckoutSession as CheckoutSession
|
|
11
12
|
from .variant_selection import VariantSelection as VariantSelection
|
|
12
13
|
from .base_checkout_intent import BaseCheckoutIntent as BaseCheckoutIntent
|
|
13
14
|
from .payment_method_param import PaymentMethodParam as PaymentMethodParam
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterable
|
|
6
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from ..._types import SequenceNotStr
|
|
9
|
+
from ..._utils import PropertyInfo
|
|
10
|
+
from ..variant_selection_param import VariantSelectionParam
|
|
11
|
+
|
|
12
|
+
__all__ = ["CheckoutSessionCreateParams", "Buyer", "Constraints"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class CheckoutSessionCreateParams(TypedDict, total=False):
|
|
16
|
+
product_url: Required[Annotated[str, PropertyInfo(alias="productUrl")]]
|
|
17
|
+
|
|
18
|
+
quantity: Required[float]
|
|
19
|
+
|
|
20
|
+
buyer: Buyer
|
|
21
|
+
"""
|
|
22
|
+
Optional buyer information, used to pre-fill the checkout form with the buyer's
|
|
23
|
+
information.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
constraints: Constraints
|
|
27
|
+
|
|
28
|
+
promo_codes: Annotated[SequenceNotStr[str], PropertyInfo(alias="promoCodes")]
|
|
29
|
+
|
|
30
|
+
variant_selections: Annotated[Iterable[VariantSelectionParam], PropertyInfo(alias="variantSelections")]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Buyer(TypedDict, total=False):
|
|
34
|
+
"""
|
|
35
|
+
Optional buyer information, used to pre-fill the checkout form with the buyer's information.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
address1: str
|
|
39
|
+
|
|
40
|
+
address2: str
|
|
41
|
+
|
|
42
|
+
city: str
|
|
43
|
+
|
|
44
|
+
country: str
|
|
45
|
+
|
|
46
|
+
email: str
|
|
47
|
+
|
|
48
|
+
first_name: Annotated[str, PropertyInfo(alias="firstName")]
|
|
49
|
+
|
|
50
|
+
last_name: Annotated[str, PropertyInfo(alias="lastName")]
|
|
51
|
+
|
|
52
|
+
phone: str
|
|
53
|
+
|
|
54
|
+
postal_code: Annotated[str, PropertyInfo(alias="postalCode")]
|
|
55
|
+
|
|
56
|
+
province: str
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class Constraints(TypedDict, total=False):
|
|
60
|
+
max_shipping_price: Annotated[int, PropertyInfo(alias="maxShippingPrice")]
|
|
61
|
+
|
|
62
|
+
max_total_price: Annotated[int, PropertyInfo(alias="maxTotalPrice")]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["CheckoutSession"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CheckoutSession(BaseModel):
|
|
9
|
+
"""
|
|
10
|
+
A checkout session represents a hosted checkout form that shoppers can use to complete their purchases.
|
|
11
|
+
|
|
12
|
+
Checkout sessions provide a pre-built UI for collecting payment and shipping information, allowing you to quickly integrate checkout functionality without building your own forms.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
url: str
|
|
16
|
+
"""URL to send your user to for checkout. This URL is valid for 4 hours."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: checkout-intents
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
4
|
Summary: The official Python library for the Checkout Intents API
|
|
5
5
|
Project-URL: Homepage, https://github.com/rye-com/checkout-intents-python
|
|
6
6
|
Project-URL: Repository, https://github.com/rye-com/checkout-intents-python
|
|
@@ -69,7 +69,7 @@ client = CheckoutIntents(
|
|
|
69
69
|
environment="production",
|
|
70
70
|
)
|
|
71
71
|
|
|
72
|
-
checkout_intent = client.checkout_intents.
|
|
72
|
+
checkout_intent = client.checkout_intents.purchase(
|
|
73
73
|
buyer={
|
|
74
74
|
"address1": "123 Main St",
|
|
75
75
|
"city": "New York",
|
|
@@ -81,6 +81,10 @@ checkout_intent = client.checkout_intents.create(
|
|
|
81
81
|
"postal_code": "10001",
|
|
82
82
|
"province": "NY",
|
|
83
83
|
},
|
|
84
|
+
payment_method={
|
|
85
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
86
|
+
"type": "stripe_token",
|
|
87
|
+
},
|
|
84
88
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
85
89
|
quantity=1,
|
|
86
90
|
)
|
|
@@ -200,7 +204,7 @@ client = AsyncCheckoutIntents(
|
|
|
200
204
|
|
|
201
205
|
|
|
202
206
|
async def main() -> None:
|
|
203
|
-
checkout_intent = await client.checkout_intents.
|
|
207
|
+
checkout_intent = await client.checkout_intents.purchase(
|
|
204
208
|
buyer={
|
|
205
209
|
"address1": "123 Main St",
|
|
206
210
|
"city": "New York",
|
|
@@ -212,6 +216,10 @@ async def main() -> None:
|
|
|
212
216
|
"postal_code": "10001",
|
|
213
217
|
"province": "NY",
|
|
214
218
|
},
|
|
219
|
+
payment_method={
|
|
220
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
221
|
+
"type": "stripe_token",
|
|
222
|
+
},
|
|
215
223
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
216
224
|
quantity=1,
|
|
217
225
|
)
|
|
@@ -249,7 +257,7 @@ async def main() -> None:
|
|
|
249
257
|
), # This is the default and can be omitted
|
|
250
258
|
http_client=DefaultAioHttpClient(),
|
|
251
259
|
) as client:
|
|
252
|
-
checkout_intent = await client.checkout_intents.
|
|
260
|
+
checkout_intent = await client.checkout_intents.purchase(
|
|
253
261
|
buyer={
|
|
254
262
|
"address1": "123 Main St",
|
|
255
263
|
"city": "New York",
|
|
@@ -261,6 +269,10 @@ async def main() -> None:
|
|
|
261
269
|
"postal_code": "10001",
|
|
262
270
|
"province": "NY",
|
|
263
271
|
},
|
|
272
|
+
payment_method={
|
|
273
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
274
|
+
"type": "stripe_token",
|
|
275
|
+
},
|
|
264
276
|
product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
|
|
265
277
|
quantity=1,
|
|
266
278
|
)
|
|
@@ -358,7 +370,7 @@ from checkout_intents import CheckoutIntents
|
|
|
358
370
|
|
|
359
371
|
client = CheckoutIntents()
|
|
360
372
|
|
|
361
|
-
checkout_intent = client.checkout_intents.
|
|
373
|
+
checkout_intent = client.checkout_intents.purchase(
|
|
362
374
|
buyer={
|
|
363
375
|
"address1": "123 Main St",
|
|
364
376
|
"city": "New York",
|
|
@@ -370,6 +382,10 @@ checkout_intent = client.checkout_intents.create(
|
|
|
370
382
|
"postal_code": "10001",
|
|
371
383
|
"province": "NY",
|
|
372
384
|
},
|
|
385
|
+
payment_method={
|
|
386
|
+
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
|
|
387
|
+
"type": "stripe_token",
|
|
388
|
+
},
|
|
373
389
|
product_url="productUrl",
|
|
374
390
|
quantity=1,
|
|
375
391
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
checkout_intents/__init__.py,sha256=5m0_Ktnyya4CJ0vdWZbAv7qZMeR1VnXqN_MJtH3RJTM,2833
|
|
2
2
|
checkout_intents/_base_client.py,sha256=ve_gIFHs2dgQ-FduM6A7GxMihxAowCXVcsBYzf_k5_4,67257
|
|
3
|
-
checkout_intents/_client.py,sha256=
|
|
3
|
+
checkout_intents/_client.py,sha256=tClhspFXBkudspX5xGUhIy8MnG2caIt_5svkHi0qhCk,25244
|
|
4
4
|
checkout_intents/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
|
|
5
5
|
checkout_intents/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
|
6
6
|
checkout_intents/_exceptions.py,sha256=oQn7Y6LzccgRDOtdg20l68bXtgf2tgVNKIrufJPDsuk,4252
|
|
@@ -11,7 +11,7 @@ checkout_intents/_resource.py,sha256=X-eWffEBAgzTZvakLqNUjwgidMKfBFRmCeeOiuko4lg
|
|
|
11
11
|
checkout_intents/_response.py,sha256=sLqxWBxzmVqPsdr2x5z6d87h8jb1U-Huvh2YFg-U6nE,28876
|
|
12
12
|
checkout_intents/_streaming.py,sha256=y8SjBVAw2SDdVczQsP1T3dufnx4040C5fQqz-jGSvmg,10257
|
|
13
13
|
checkout_intents/_types.py,sha256=PTRxqWPBW57h6JvfwcVuR42gIMpY4nwSZbqAtv85Ado,7305
|
|
14
|
-
checkout_intents/_version.py,sha256=
|
|
14
|
+
checkout_intents/_version.py,sha256=EdjvKcJ2eo9mIthyWvXKFUUvodLh3mBBrjEMnj2ZhnU,169
|
|
15
15
|
checkout_intents/pagination.py,sha256=VMe3ftq-qqAku2ERRTOz7iZOoMQ_KKp2HIUl_I8oAXE,2908
|
|
16
16
|
checkout_intents/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
checkout_intents/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
@@ -27,10 +27,13 @@ checkout_intents/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3u
|
|
|
27
27
|
checkout_intents/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
|
|
28
28
|
checkout_intents/_utils/_utils.py,sha256=g9ftElB09kVT6EVfCIlD_nUfANhDX5_vZO61FDWoIQI,12334
|
|
29
29
|
checkout_intents/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
30
|
-
checkout_intents/resources/__init__.py,sha256=
|
|
30
|
+
checkout_intents/resources/__init__.py,sha256=zjz0ozirEslXBkOUq4FwPABJaLruYwIXS7HZ-0am5S4,1557
|
|
31
31
|
checkout_intents/resources/brands.py,sha256=jJ5Jn2GG3MPkdKSg6_OG89dSQTaSGM9e7lBtovn-ABE,6389
|
|
32
32
|
checkout_intents/resources/checkout_intents.py,sha256=CY1YZYBBdntsMmShiQxHN4oMI10Q_dES6IGHw7uBEJ0,60280
|
|
33
|
-
checkout_intents/
|
|
33
|
+
checkout_intents/resources/betas/__init__.py,sha256=DQKAlEq_xKd67cDJhihmsFJowbKXwPwZVi6zbGUykfQ,1120
|
|
34
|
+
checkout_intents/resources/betas/betas.py,sha256=48PbcJQb3RFRJ2pbvr7aAR1KYi64bWBQgfxg6KtcqeU,3892
|
|
35
|
+
checkout_intents/resources/betas/checkout_sessions.py,sha256=2TPHJLaYEnnmPDChC17UlEDOYaKjFK6ixtP_MbuIlqs,8223
|
|
36
|
+
checkout_intents/types/__init__.py,sha256=VlReDJoTw4Sps0a4Q5Bfm_ePZnfk61wVBNSgDR-rGVc,1363
|
|
34
37
|
checkout_intents/types/base_checkout_intent.py,sha256=0lS_qyJd8xz-DIukZEPKkEUl52wPs4CiXMOV7Aulc8M,997
|
|
35
38
|
checkout_intents/types/brand_retrieve_response.py,sha256=c8DCAJvHFHcrIOW6onHj5Y51Yba7zyOrRXZuGfqYkBc,561
|
|
36
39
|
checkout_intents/types/buyer.py,sha256=Ov6mVD-Hjm9A-i9p2dWCXtniLhYpG_6jvy9DReC54YQ,530
|
|
@@ -41,13 +44,16 @@ checkout_intents/types/checkout_intent_confirm_params.py,sha256=v_fcmuH5GoEwUJLb
|
|
|
41
44
|
checkout_intents/types/checkout_intent_create_params.py,sha256=J5jIPp7PkRxv2-IQdb_-UMd8U1OF-Ub6cOQ5cZLPwSM,1055
|
|
42
45
|
checkout_intents/types/checkout_intent_list_params.py,sha256=zc8_xwBHChOcl7bTMSjU7ZbHKIyQGYeUy5UrxeloJj0,521
|
|
43
46
|
checkout_intents/types/checkout_intent_purchase_params.py,sha256=GSb1wJVAq0RiJmTNcvhqhIT0gpd7uU2FfhkWgin_QpE,1210
|
|
47
|
+
checkout_intents/types/checkout_session.py,sha256=e1Ay_2GYO9Ybmz53S0Z0o3R4Et5Gm2kiS5wn1y1Ey3g,589
|
|
44
48
|
checkout_intents/types/money.py,sha256=-AfFFrfnUy6cAaFykF_gWZQxDGlzA1r_dJzJZRxhUto,328
|
|
45
49
|
checkout_intents/types/offer.py,sha256=9nGYAlA3tEiRU9lvsktnVl6EWj5dLNr6K9LB8WprckI,985
|
|
46
50
|
checkout_intents/types/payment_method.py,sha256=-v5-L5RPojm8IDrdAhIMGmhVb89vwqT1jhgb-ZWOG7Q,1069
|
|
47
51
|
checkout_intents/types/payment_method_param.py,sha256=_yzwZ5nw7bStK4U2-1ybtpjdJz5funCOMN7MALtF0xk,1225
|
|
48
52
|
checkout_intents/types/variant_selection.py,sha256=y6mlU-qGwDfE77mU-x1GTXkDsmn6vuPpy5lBYXqXCBw,259
|
|
49
53
|
checkout_intents/types/variant_selection_param.py,sha256=ahwTmDVIUMV8jvpggEo2jDUTIm9xvXbntDxmIZqT2_k,355
|
|
50
|
-
checkout_intents
|
|
51
|
-
checkout_intents
|
|
52
|
-
checkout_intents-0.
|
|
53
|
-
checkout_intents-0.
|
|
54
|
+
checkout_intents/types/betas/__init__.py,sha256=ZeKE1oI6DbXReHgxvn2kIS3G3_k8MH8a-o22ONpi5dc,226
|
|
55
|
+
checkout_intents/types/betas/checkout_session_create_params.py,sha256=SejFE3EyRfjOKL5Wm2U5juvZyAKLry4yuNaUNkBF1y8,1604
|
|
56
|
+
checkout_intents-0.10.0.dist-info/METADATA,sha256=O_DF25hyjyf2zxb2gfq560Kk_g7V5BJr5UBHror4b0o,24302
|
|
57
|
+
checkout_intents-0.10.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
58
|
+
checkout_intents-0.10.0.dist-info/licenses/LICENSE,sha256=BnK3I8R5OpT_XsQObbpssF9h8-B0aZaerlZjRgSPNpU,1056
|
|
59
|
+
checkout_intents-0.10.0.dist-info/RECORD,,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2026 Checkout Intents
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
|
File without changes
|