checkout-intents 0.7.0__py3-none-any.whl → 0.9.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.
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "checkout_intents"
4
- __version__ = "0.7.0" # x-release-please-version
4
+ __version__ = "0.9.0" # x-release-please-version
@@ -71,6 +71,7 @@ class CheckoutIntentsResource(SyncAPIResource):
71
71
  buyer: BuyerParam,
72
72
  product_url: str,
73
73
  quantity: float,
74
+ constraints: checkout_intent_create_params.Constraints | Omit = omit,
74
75
  promo_codes: SequenceNotStr[str] | Omit = omit,
75
76
  variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
76
77
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -101,6 +102,7 @@ class CheckoutIntentsResource(SyncAPIResource):
101
102
  "buyer": buyer,
102
103
  "product_url": product_url,
103
104
  "quantity": quantity,
105
+ "constraints": constraints,
104
106
  "promo_codes": promo_codes,
105
107
  "variant_selections": variant_selections,
106
108
  },
@@ -294,6 +296,7 @@ class CheckoutIntentsResource(SyncAPIResource):
294
296
  buyer: BuyerParam,
295
297
  product_url: str,
296
298
  quantity: float,
299
+ constraints: checkout_intent_purchase_params.Constraints | Omit = omit,
297
300
  promo_codes: SequenceNotStr[str] | Omit = omit,
298
301
  variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
299
302
  payment_method: PaymentMethodParam,
@@ -330,6 +333,7 @@ class CheckoutIntentsResource(SyncAPIResource):
330
333
  "payment_method": payment_method,
331
334
  "product_url": product_url,
332
335
  "quantity": quantity,
336
+ "constraints": constraints,
333
337
  "promo_codes": promo_codes,
334
338
  "variant_selections": variant_selections,
335
339
  },
@@ -728,6 +732,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
728
732
  buyer: BuyerParam,
729
733
  product_url: str,
730
734
  quantity: float,
735
+ constraints: checkout_intent_create_params.Constraints | Omit = omit,
731
736
  promo_codes: SequenceNotStr[str] | Omit = omit,
732
737
  variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
733
738
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -758,6 +763,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
758
763
  "buyer": buyer,
759
764
  "product_url": product_url,
760
765
  "quantity": quantity,
766
+ "constraints": constraints,
761
767
  "promo_codes": promo_codes,
762
768
  "variant_selections": variant_selections,
763
769
  },
@@ -951,6 +957,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
951
957
  buyer: BuyerParam,
952
958
  product_url: str,
953
959
  quantity: float,
960
+ constraints: checkout_intent_purchase_params.Constraints | Omit = omit,
954
961
  promo_codes: SequenceNotStr[str] | Omit = omit,
955
962
  variant_selections: Iterable[VariantSelectionParam] | Omit = omit,
956
963
  payment_method: PaymentMethodParam,
@@ -987,6 +994,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
987
994
  "payment_method": payment_method,
988
995
  "product_url": product_url,
989
996
  "quantity": quantity,
997
+ "constraints": constraints,
990
998
  "promo_codes": promo_codes,
991
999
  "variant_selections": variant_selections,
992
1000
  },
@@ -9,7 +9,13 @@ from .buyer import Buyer
9
9
  from .._models import BaseModel
10
10
  from .variant_selection import VariantSelection
11
11
 
12
- __all__ = ["BaseCheckoutIntent"]
12
+ __all__ = ["BaseCheckoutIntent", "Constraints"]
13
+
14
+
15
+ class Constraints(BaseModel):
16
+ max_shipping_price: Optional[int] = FieldInfo(alias="maxShippingPrice", default=None)
17
+
18
+ max_total_price: Optional[int] = FieldInfo(alias="maxTotalPrice", default=None)
13
19
 
14
20
 
15
21
  class BaseCheckoutIntent(BaseModel):
@@ -23,6 +29,8 @@ class BaseCheckoutIntent(BaseModel):
23
29
 
24
30
  quantity: float
25
31
 
32
+ constraints: Optional[Constraints] = None
33
+
26
34
  promo_codes: Optional[List[str]] = FieldInfo(alias="promoCodes", default=None)
27
35
 
28
36
  variant_selections: Optional[List[VariantSelection]] = FieldInfo(alias="variantSelections", default=None)
@@ -71,6 +71,8 @@ class FailedCheckoutIntentFailureReason(BaseModel):
71
71
  "form_validation_error",
72
72
  "captcha_blocked",
73
73
  "bot_protection_blocked",
74
+ "constraint_total_price_exceeded",
75
+ "constraint_shipping_cost_exceeded",
74
76
  "unknown",
75
77
  ]
76
78
  """Type derived from runtime array - always in sync"""
@@ -10,7 +10,7 @@ from .._utils import PropertyInfo
10
10
  from .buyer_param import BuyerParam
11
11
  from .variant_selection_param import VariantSelectionParam
12
12
 
13
- __all__ = ["CheckoutIntentCreateParams"]
13
+ __all__ = ["CheckoutIntentCreateParams", "Constraints"]
14
14
 
15
15
 
16
16
  class CheckoutIntentCreateParams(TypedDict, total=False):
@@ -20,6 +20,14 @@ class CheckoutIntentCreateParams(TypedDict, total=False):
20
20
 
21
21
  quantity: Required[float]
22
22
 
23
+ constraints: Constraints
24
+
23
25
  promo_codes: Annotated[SequenceNotStr[str], PropertyInfo(alias="promoCodes")]
24
26
 
25
27
  variant_selections: Annotated[Iterable[VariantSelectionParam], PropertyInfo(alias="variantSelections")]
28
+
29
+
30
+ class Constraints(TypedDict, total=False):
31
+ max_shipping_price: Annotated[int, PropertyInfo(alias="maxShippingPrice")]
32
+
33
+ max_total_price: Annotated[int, PropertyInfo(alias="maxTotalPrice")]
@@ -11,7 +11,7 @@ from .buyer_param import BuyerParam
11
11
  from .payment_method_param import PaymentMethodParam
12
12
  from .variant_selection_param import VariantSelectionParam
13
13
 
14
- __all__ = ["CheckoutIntentPurchaseParams"]
14
+ __all__ = ["CheckoutIntentPurchaseParams", "Constraints"]
15
15
 
16
16
 
17
17
  class CheckoutIntentPurchaseParams(TypedDict, total=False):
@@ -23,6 +23,14 @@ class CheckoutIntentPurchaseParams(TypedDict, total=False):
23
23
 
24
24
  quantity: Required[float]
25
25
 
26
+ constraints: Constraints
27
+
26
28
  promo_codes: Annotated[SequenceNotStr[str], PropertyInfo(alias="promoCodes")]
27
29
 
28
30
  variant_selections: Annotated[Iterable[VariantSelectionParam], PropertyInfo(alias="variantSelections")]
31
+
32
+
33
+ class Constraints(TypedDict, total=False):
34
+ max_shipping_price: Annotated[int, PropertyInfo(alias="maxShippingPrice")]
35
+
36
+ max_total_price: Annotated[int, PropertyInfo(alias="maxTotalPrice")]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: checkout-intents
3
- Version: 0.7.0
3
+ Version: 0.9.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.create(
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_visa",
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.create(
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_visa",
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.create(
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_visa",
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.create(
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
  )
@@ -392,7 +408,7 @@ from checkout_intents import CheckoutIntents
392
408
  client = CheckoutIntents()
393
409
 
394
410
  try:
395
- client.checkout_intents.create(
411
+ client.checkout_intents.purchase(
396
412
  buyer={
397
413
  "address1": "123 Main St",
398
414
  "city": "New York",
@@ -404,6 +420,10 @@ try:
404
420
  "postal_code": "10001",
405
421
  "province": "NY",
406
422
  },
423
+ payment_method={
424
+ "stripe_token": "tok_visa",
425
+ "type": "stripe_token",
426
+ },
407
427
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
408
428
  quantity=1,
409
429
  )
@@ -469,7 +489,7 @@ client = CheckoutIntents(
469
489
  )
470
490
 
471
491
  # Or, configure per-request:
472
- client.with_options(max_retries=5).checkout_intents.create(
492
+ client.with_options(max_retries=5).checkout_intents.purchase(
473
493
  buyer={
474
494
  "address1": "123 Main St",
475
495
  "city": "New York",
@@ -481,6 +501,10 @@ client.with_options(max_retries=5).checkout_intents.create(
481
501
  "postal_code": "10001",
482
502
  "province": "NY",
483
503
  },
504
+ payment_method={
505
+ "stripe_token": "tok_visa",
506
+ "type": "stripe_token",
507
+ },
484
508
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
485
509
  quantity=1,
486
510
  )
@@ -506,7 +530,7 @@ client = CheckoutIntents(
506
530
  )
507
531
 
508
532
  # Override per-request:
509
- client.with_options(timeout=5.0).checkout_intents.create(
533
+ client.with_options(timeout=5.0).checkout_intents.purchase(
510
534
  buyer={
511
535
  "address1": "123 Main St",
512
536
  "city": "New York",
@@ -518,6 +542,10 @@ client.with_options(timeout=5.0).checkout_intents.create(
518
542
  "postal_code": "10001",
519
543
  "province": "NY",
520
544
  },
545
+ payment_method={
546
+ "stripe_token": "tok_visa",
547
+ "type": "stripe_token",
548
+ },
521
549
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
522
550
  quantity=1,
523
551
  )
@@ -561,7 +589,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
561
589
  from checkout_intents import CheckoutIntents
562
590
 
563
591
  client = CheckoutIntents()
564
- response = client.checkout_intents.with_raw_response.create(
592
+ response = client.checkout_intents.with_raw_response.purchase(
565
593
  buyer={
566
594
  "address1": "123 Main St",
567
595
  "city": "New York",
@@ -573,12 +601,16 @@ response = client.checkout_intents.with_raw_response.create(
573
601
  "postal_code": "10001",
574
602
  "province": "NY",
575
603
  },
604
+ payment_method={
605
+ "stripe_token": "tok_visa",
606
+ "type": "stripe_token",
607
+ },
576
608
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
577
609
  quantity=1,
578
610
  )
579
611
  print(response.headers.get('X-My-Header'))
580
612
 
581
- checkout_intent = response.parse() # get the object that `checkout_intents.create()` would have returned
613
+ checkout_intent = response.parse() # get the object that `checkout_intents.purchase()` would have returned
582
614
  print(checkout_intent)
583
615
  ```
584
616
 
@@ -593,7 +625,7 @@ The above interface eagerly reads the full response body when you make the reque
593
625
  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
594
626
 
595
627
  ```python
596
- with client.checkout_intents.with_streaming_response.create(
628
+ with client.checkout_intents.with_streaming_response.purchase(
597
629
  buyer={
598
630
  "address1": "123 Main St",
599
631
  "city": "New York",
@@ -605,6 +637,10 @@ with client.checkout_intents.with_streaming_response.create(
605
637
  "postal_code": "10001",
606
638
  "province": "NY",
607
639
  },
640
+ payment_method={
641
+ "stripe_token": "tok_visa",
642
+ "type": "stripe_token",
643
+ },
608
644
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
609
645
  quantity=1,
610
646
  ) as response:
@@ -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=5VUKZFNomyYEg-QEVbUYW_VqH4_Uo6ZBsPyAuMjG_4c,168
14
+ checkout_intents/_version.py,sha256=PprqsKyOgvzP25SDKE6EvLaOv0CXi5Iznh9kfIZFQcM,168
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
@@ -29,25 +29,25 @@ checkout_intents/_utils/_utils.py,sha256=g9ftElB09kVT6EVfCIlD_nUfANhDX5_vZO61FDW
29
29
  checkout_intents/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
30
30
  checkout_intents/resources/__init__.py,sha256=sHRW0nwo1GnFBFPoTNohkEbvOk7au-R3MdfVn_yb8Ds,1120
31
31
  checkout_intents/resources/brands.py,sha256=jJ5Jn2GG3MPkdKSg6_OG89dSQTaSGM9e7lBtovn-ABE,6389
32
- checkout_intents/resources/checkout_intents.py,sha256=AkV2MsOPINapNgVJQiArVP8qTCAosbB1jlkknCRoIQ0,59756
32
+ checkout_intents/resources/checkout_intents.py,sha256=CY1YZYBBdntsMmShiQxHN4oMI10Q_dES6IGHw7uBEJ0,60280
33
33
  checkout_intents/types/__init__.py,sha256=VhZDCRhKlUnKs1h-8UNWj0HUUtJBjHFo16Stxy_kgS4,1298
34
- checkout_intents/types/base_checkout_intent.py,sha256=i31jUBw1fFlFQI4pUxLhiHAM82k3dDWiK3puTlKO5VE,728
34
+ checkout_intents/types/base_checkout_intent.py,sha256=0lS_qyJd8xz-DIukZEPKkEUl52wPs4CiXMOV7Aulc8M,997
35
35
  checkout_intents/types/brand_retrieve_response.py,sha256=c8DCAJvHFHcrIOW6onHj5Y51Yba7zyOrRXZuGfqYkBc,561
36
36
  checkout_intents/types/buyer.py,sha256=Ov6mVD-Hjm9A-i9p2dWCXtniLhYpG_6jvy9DReC54YQ,530
37
37
  checkout_intents/types/buyer_param.py,sha256=DAtEoK4VSzv2qDBBlC4RRE4FbHd87pieTOlfRntbjqg,695
38
- checkout_intents/types/checkout_intent.py,sha256=c7Geo_oT9ARDz8ZC5Kq6DxdOB-WlhSlxVlx9VuU95-Q,2638
38
+ checkout_intents/types/checkout_intent.py,sha256=LLTGXwIRdZmxaHRcHAYZ6DPWnZurym2yG0pOfmkQ2eg,2726
39
39
  checkout_intents/types/checkout_intent_add_payment_params.py,sha256=s8KKWVM3XainGTLCwdfUjb5vgS80o2_W0wwUwRCFbk0,479
40
40
  checkout_intents/types/checkout_intent_confirm_params.py,sha256=v_fcmuH5GoEwUJLbV7N9BDti63dg8z1nmhpcr4-1qcs,473
41
- checkout_intents/types/checkout_intent_create_params.py,sha256=DEfM_bAsMijLAtGTZpC0RjnwvJc3rQDd_H9jEgjFc28,812
41
+ checkout_intents/types/checkout_intent_create_params.py,sha256=J5jIPp7PkRxv2-IQdb_-UMd8U1OF-Ub6cOQ5cZLPwSM,1055
42
42
  checkout_intents/types/checkout_intent_list_params.py,sha256=zc8_xwBHChOcl7bTMSjU7ZbHKIyQGYeUy5UrxeloJj0,521
43
- checkout_intents/types/checkout_intent_purchase_params.py,sha256=aQ2mYStqnWiSR7BXKbWZ6dEPXD8fBDwhhBssh-d6ado,967
43
+ checkout_intents/types/checkout_intent_purchase_params.py,sha256=GSb1wJVAq0RiJmTNcvhqhIT0gpd7uU2FfhkWgin_QpE,1210
44
44
  checkout_intents/types/money.py,sha256=-AfFFrfnUy6cAaFykF_gWZQxDGlzA1r_dJzJZRxhUto,328
45
45
  checkout_intents/types/offer.py,sha256=9nGYAlA3tEiRU9lvsktnVl6EWj5dLNr6K9LB8WprckI,985
46
46
  checkout_intents/types/payment_method.py,sha256=-v5-L5RPojm8IDrdAhIMGmhVb89vwqT1jhgb-ZWOG7Q,1069
47
47
  checkout_intents/types/payment_method_param.py,sha256=_yzwZ5nw7bStK4U2-1ybtpjdJz5funCOMN7MALtF0xk,1225
48
48
  checkout_intents/types/variant_selection.py,sha256=y6mlU-qGwDfE77mU-x1GTXkDsmn6vuPpy5lBYXqXCBw,259
49
49
  checkout_intents/types/variant_selection_param.py,sha256=ahwTmDVIUMV8jvpggEo2jDUTIm9xvXbntDxmIZqT2_k,355
50
- checkout_intents-0.7.0.dist-info/METADATA,sha256=821Ib8V0YkpJFBHUAmb-tZAWV4HIgOEhnuzhAwGo52s,23781
51
- checkout_intents-0.7.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
52
- checkout_intents-0.7.0.dist-info/licenses/LICENSE,sha256=dRDmL6lFnLaphTaman8kAc21qY1IQ_qsAETk1F-b6jY,1056
53
- checkout_intents-0.7.0.dist-info/RECORD,,
50
+ checkout_intents-0.9.0.dist-info/METADATA,sha256=YefXWCLHIhjrvpzN5tCqy9A6K4zZ5qnYpKViu6yhO-U,24749
51
+ checkout_intents-0.9.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
52
+ checkout_intents-0.9.0.dist-info/licenses/LICENSE,sha256=dRDmL6lFnLaphTaman8kAc21qY1IQ_qsAETk1F-b6jY,1056
53
+ checkout_intents-0.9.0.dist-info/RECORD,,