checkout-intents 0.9.0__tar.gz → 0.11.0__tar.gz

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.
Files changed (100) hide show
  1. checkout_intents-0.11.0/.release-please-manifest.json +3 -0
  2. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/CHANGELOG.md +30 -0
  3. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/LICENSE +1 -1
  4. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/PKG-INFO +10 -30
  5. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/README.md +9 -29
  6. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/api.md +14 -0
  7. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/pyproject.toml +1 -1
  8. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_base_client.py +134 -11
  9. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_client.py +38 -1
  10. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_models.py +16 -1
  11. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_types.py +9 -0
  12. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_version.py +1 -1
  13. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/resources/__init__.py +14 -0
  14. checkout_intents-0.11.0/src/checkout_intents/resources/betas/__init__.py +33 -0
  15. checkout_intents-0.11.0/src/checkout_intents/resources/betas/betas.py +102 -0
  16. checkout_intents-0.11.0/src/checkout_intents/resources/betas/checkout_sessions.py +208 -0
  17. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/resources/checkout_intents.py +6 -6
  18. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/__init__.py +1 -0
  19. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/base_checkout_intent.py +1 -1
  20. checkout_intents-0.11.0/src/checkout_intents/types/betas/__init__.py +5 -0
  21. checkout_intents-0.11.0/src/checkout_intents/types/betas/checkout_session_create_params.py +62 -0
  22. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/checkout_intent_create_params.py +1 -1
  23. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/checkout_intent_purchase_params.py +1 -1
  24. checkout_intents-0.11.0/src/checkout_intents/types/checkout_session.py +16 -0
  25. checkout_intents-0.11.0/tests/api_resources/betas/__init__.py +1 -0
  26. checkout_intents-0.11.0/tests/api_resources/betas/test_checkout_sessions.py +162 -0
  27. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/api_resources/test_checkout_intents.py +4 -4
  28. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_client.py +207 -66
  29. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/uv.lock +1 -1
  30. checkout_intents-0.9.0/.release-please-manifest.json +0 -3
  31. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/.gitignore +0 -0
  32. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/CONTRIBUTING.md +0 -0
  33. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/SECURITY.md +0 -0
  34. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/bin/check-release-environment +0 -0
  35. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/bin/publish-pypi +0 -0
  36. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/examples/.keep +0 -0
  37. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/examples/complete-checkout-intent.py +0 -0
  38. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/examples/error-handling.py +0 -0
  39. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/noxfile.py +0 -0
  40. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/release-please-config.json +0 -0
  41. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/requirements-dev.lock +0 -0
  42. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/requirements.lock +0 -0
  43. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/__init__.py +0 -0
  44. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_compat.py +0 -0
  45. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_constants.py +0 -0
  46. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_exceptions.py +0 -0
  47. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_files.py +0 -0
  48. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_qs.py +0 -0
  49. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_resource.py +0 -0
  50. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_response.py +0 -0
  51. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_streaming.py +0 -0
  52. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/__init__.py +0 -0
  53. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_compat.py +0 -0
  54. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_datetime_parse.py +0 -0
  55. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_logs.py +0 -0
  56. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_proxy.py +0 -0
  57. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_reflection.py +0 -0
  58. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_resources_proxy.py +0 -0
  59. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_streams.py +0 -0
  60. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_sync.py +0 -0
  61. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_transform.py +0 -0
  62. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_typing.py +0 -0
  63. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/_utils/_utils.py +0 -0
  64. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/lib/.keep +0 -0
  65. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/pagination.py +0 -0
  66. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/py.typed +0 -0
  67. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/resources/brands.py +0 -0
  68. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/brand_retrieve_response.py +0 -0
  69. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/buyer.py +0 -0
  70. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/buyer_param.py +0 -0
  71. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/checkout_intent.py +0 -0
  72. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/checkout_intent_add_payment_params.py +0 -0
  73. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/checkout_intent_confirm_params.py +0 -0
  74. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/checkout_intent_list_params.py +0 -0
  75. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/money.py +0 -0
  76. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/offer.py +0 -0
  77. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/payment_method.py +0 -0
  78. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/payment_method_param.py +0 -0
  79. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/variant_selection.py +0 -0
  80. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/src/checkout_intents/types/variant_selection_param.py +0 -0
  81. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/__init__.py +0 -0
  82. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/api_resources/__init__.py +0 -0
  83. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/api_resources/test_brands.py +0 -0
  84. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/conftest.py +0 -0
  85. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/sample_file.txt +0 -0
  86. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_deepcopy.py +0 -0
  87. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_environment_inference.py +0 -0
  88. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_extract_files.py +0 -0
  89. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_files.py +0 -0
  90. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_models.py +0 -0
  91. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_polling.py +0 -0
  92. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_qs.py +0 -0
  93. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_required_args.py +0 -0
  94. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_response.py +0 -0
  95. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_streaming.py +0 -0
  96. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_transform.py +0 -0
  97. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_utils/test_datetime_parse.py +0 -0
  98. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_utils/test_proxy.py +0 -0
  99. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/test_utils/test_typing.py +0 -0
  100. {checkout_intents-0.9.0 → checkout_intents-0.11.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.11.0"
3
+ }
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.0 (2026-01-15)
4
+
5
+ Full Changelog: [v0.10.0...v0.11.0](https://github.com/rye-com/checkout-intents-python/compare/v0.10.0...v0.11.0)
6
+
7
+ ### Features
8
+
9
+ * **client:** add support for binary request streaming ([438d3db](https://github.com/rye-com/checkout-intents-python/commit/438d3db019a0e94f9f7d2ea204887c15ea34ec8d))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **api:** correctly type quantity as int ([c0cfd41](https://github.com/rye-com/checkout-intents-python/commit/c0cfd41c5d71765cf3d34eddd1c640282caa4c33))
15
+ * **api:** correctly type quantity as integer ([642e3f2](https://github.com/rye-com/checkout-intents-python/commit/642e3f206f4ba6120ff4f9892c8bc077f10fedfd))
16
+
17
+
18
+ ### Chores
19
+
20
+ * **internal:** bump uv.lock version ([9e551da](https://github.com/rye-com/checkout-intents-python/commit/9e551da1755c820314699cc0d2ccaf8578f5f7f8))
21
+
22
+ ## 0.10.0 (2026-01-06)
23
+
24
+ Full Changelog: [v0.9.0...v0.10.0](https://github.com/rye-com/checkout-intents-python/compare/v0.9.0...v0.10.0)
25
+
26
+ ### Features
27
+
28
+ * Fix Slack follow-up messages not posting to thread when initial message fails ([61f39ce](https://github.com/rye-com/checkout-intents-python/commit/61f39ce09ad720d99fb866eca1d30cd6fbe353fc))
29
+ * Improve JSDoc for checkout sessions ([dffa705](https://github.com/rye-com/checkout-intents-python/commit/dffa70546832f5f4c74ba0e1c3280a98739bc9bf))
30
+ * RYE-6466: Enrich tracked analytics context for the checkout intents api ([26ed61e](https://github.com/rye-com/checkout-intents-python/commit/26ed61e274b71f66d5c952561fe9565213aeed1b))
31
+ * Tidy API docs ([1ce6f5f](https://github.com/rye-com/checkout-intents-python/commit/1ce6f5fe5e7ca420b911b11d8bb5106e09e0ac40))
32
+
3
33
  ## 0.9.0 (2025-12-25)
4
34
 
5
35
  Full Changelog: [v0.8.0...v0.9.0](https://github.com/rye-com/checkout-intents-python/compare/v0.8.0...v0.9.0)
@@ -1,4 +1,4 @@
1
- Copyright 2025 Checkout Intents
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: checkout-intents
3
- Version: 0.9.0
3
+ Version: 0.11.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
@@ -82,7 +82,7 @@ checkout_intent = client.checkout_intents.purchase(
82
82
  "province": "NY",
83
83
  },
84
84
  payment_method={
85
- "stripe_token": "tok_visa",
85
+ "stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
86
86
  "type": "stripe_token",
87
87
  },
88
88
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
@@ -217,7 +217,7 @@ async def main() -> None:
217
217
  "province": "NY",
218
218
  },
219
219
  payment_method={
220
- "stripe_token": "tok_visa",
220
+ "stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
221
221
  "type": "stripe_token",
222
222
  },
223
223
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
@@ -270,7 +270,7 @@ async def main() -> None:
270
270
  "province": "NY",
271
271
  },
272
272
  payment_method={
273
- "stripe_token": "tok_visa",
273
+ "stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
274
274
  "type": "stripe_token",
275
275
  },
276
276
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
@@ -408,7 +408,7 @@ from checkout_intents import CheckoutIntents
408
408
  client = CheckoutIntents()
409
409
 
410
410
  try:
411
- client.checkout_intents.purchase(
411
+ client.checkout_intents.create(
412
412
  buyer={
413
413
  "address1": "123 Main St",
414
414
  "city": "New York",
@@ -420,10 +420,6 @@ try:
420
420
  "postal_code": "10001",
421
421
  "province": "NY",
422
422
  },
423
- payment_method={
424
- "stripe_token": "tok_visa",
425
- "type": "stripe_token",
426
- },
427
423
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
428
424
  quantity=1,
429
425
  )
@@ -489,7 +485,7 @@ client = CheckoutIntents(
489
485
  )
490
486
 
491
487
  # Or, configure per-request:
492
- client.with_options(max_retries=5).checkout_intents.purchase(
488
+ client.with_options(max_retries=5).checkout_intents.create(
493
489
  buyer={
494
490
  "address1": "123 Main St",
495
491
  "city": "New York",
@@ -501,10 +497,6 @@ client.with_options(max_retries=5).checkout_intents.purchase(
501
497
  "postal_code": "10001",
502
498
  "province": "NY",
503
499
  },
504
- payment_method={
505
- "stripe_token": "tok_visa",
506
- "type": "stripe_token",
507
- },
508
500
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
509
501
  quantity=1,
510
502
  )
@@ -530,7 +522,7 @@ client = CheckoutIntents(
530
522
  )
531
523
 
532
524
  # Override per-request:
533
- client.with_options(timeout=5.0).checkout_intents.purchase(
525
+ client.with_options(timeout=5.0).checkout_intents.create(
534
526
  buyer={
535
527
  "address1": "123 Main St",
536
528
  "city": "New York",
@@ -542,10 +534,6 @@ client.with_options(timeout=5.0).checkout_intents.purchase(
542
534
  "postal_code": "10001",
543
535
  "province": "NY",
544
536
  },
545
- payment_method={
546
- "stripe_token": "tok_visa",
547
- "type": "stripe_token",
548
- },
549
537
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
550
538
  quantity=1,
551
539
  )
@@ -589,7 +577,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
589
577
  from checkout_intents import CheckoutIntents
590
578
 
591
579
  client = CheckoutIntents()
592
- response = client.checkout_intents.with_raw_response.purchase(
580
+ response = client.checkout_intents.with_raw_response.create(
593
581
  buyer={
594
582
  "address1": "123 Main St",
595
583
  "city": "New York",
@@ -601,16 +589,12 @@ response = client.checkout_intents.with_raw_response.purchase(
601
589
  "postal_code": "10001",
602
590
  "province": "NY",
603
591
  },
604
- payment_method={
605
- "stripe_token": "tok_visa",
606
- "type": "stripe_token",
607
- },
608
592
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
609
593
  quantity=1,
610
594
  )
611
595
  print(response.headers.get('X-My-Header'))
612
596
 
613
- checkout_intent = response.parse() # get the object that `checkout_intents.purchase()` would have returned
597
+ checkout_intent = response.parse() # get the object that `checkout_intents.create()` would have returned
614
598
  print(checkout_intent)
615
599
  ```
616
600
 
@@ -625,7 +609,7 @@ The above interface eagerly reads the full response body when you make the reque
625
609
  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.
626
610
 
627
611
  ```python
628
- with client.checkout_intents.with_streaming_response.purchase(
612
+ with client.checkout_intents.with_streaming_response.create(
629
613
  buyer={
630
614
  "address1": "123 Main St",
631
615
  "city": "New York",
@@ -637,10 +621,6 @@ with client.checkout_intents.with_streaming_response.purchase(
637
621
  "postal_code": "10001",
638
622
  "province": "NY",
639
623
  },
640
- payment_method={
641
- "stripe_token": "tok_visa",
642
- "type": "stripe_token",
643
- },
644
624
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
645
625
  quantity=1,
646
626
  ) as response:
@@ -47,7 +47,7 @@ checkout_intent = client.checkout_intents.purchase(
47
47
  "province": "NY",
48
48
  },
49
49
  payment_method={
50
- "stripe_token": "tok_visa",
50
+ "stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
51
51
  "type": "stripe_token",
52
52
  },
53
53
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
@@ -182,7 +182,7 @@ async def main() -> None:
182
182
  "province": "NY",
183
183
  },
184
184
  payment_method={
185
- "stripe_token": "tok_visa",
185
+ "stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
186
186
  "type": "stripe_token",
187
187
  },
188
188
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
@@ -235,7 +235,7 @@ async def main() -> None:
235
235
  "province": "NY",
236
236
  },
237
237
  payment_method={
238
- "stripe_token": "tok_visa",
238
+ "stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
239
239
  "type": "stripe_token",
240
240
  },
241
241
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
@@ -373,7 +373,7 @@ from checkout_intents import CheckoutIntents
373
373
  client = CheckoutIntents()
374
374
 
375
375
  try:
376
- client.checkout_intents.purchase(
376
+ client.checkout_intents.create(
377
377
  buyer={
378
378
  "address1": "123 Main St",
379
379
  "city": "New York",
@@ -385,10 +385,6 @@ try:
385
385
  "postal_code": "10001",
386
386
  "province": "NY",
387
387
  },
388
- payment_method={
389
- "stripe_token": "tok_visa",
390
- "type": "stripe_token",
391
- },
392
388
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
393
389
  quantity=1,
394
390
  )
@@ -454,7 +450,7 @@ client = CheckoutIntents(
454
450
  )
455
451
 
456
452
  # Or, configure per-request:
457
- client.with_options(max_retries=5).checkout_intents.purchase(
453
+ client.with_options(max_retries=5).checkout_intents.create(
458
454
  buyer={
459
455
  "address1": "123 Main St",
460
456
  "city": "New York",
@@ -466,10 +462,6 @@ client.with_options(max_retries=5).checkout_intents.purchase(
466
462
  "postal_code": "10001",
467
463
  "province": "NY",
468
464
  },
469
- payment_method={
470
- "stripe_token": "tok_visa",
471
- "type": "stripe_token",
472
- },
473
465
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
474
466
  quantity=1,
475
467
  )
@@ -495,7 +487,7 @@ client = CheckoutIntents(
495
487
  )
496
488
 
497
489
  # Override per-request:
498
- client.with_options(timeout=5.0).checkout_intents.purchase(
490
+ client.with_options(timeout=5.0).checkout_intents.create(
499
491
  buyer={
500
492
  "address1": "123 Main St",
501
493
  "city": "New York",
@@ -507,10 +499,6 @@ client.with_options(timeout=5.0).checkout_intents.purchase(
507
499
  "postal_code": "10001",
508
500
  "province": "NY",
509
501
  },
510
- payment_method={
511
- "stripe_token": "tok_visa",
512
- "type": "stripe_token",
513
- },
514
502
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
515
503
  quantity=1,
516
504
  )
@@ -554,7 +542,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
554
542
  from checkout_intents import CheckoutIntents
555
543
 
556
544
  client = CheckoutIntents()
557
- response = client.checkout_intents.with_raw_response.purchase(
545
+ response = client.checkout_intents.with_raw_response.create(
558
546
  buyer={
559
547
  "address1": "123 Main St",
560
548
  "city": "New York",
@@ -566,16 +554,12 @@ response = client.checkout_intents.with_raw_response.purchase(
566
554
  "postal_code": "10001",
567
555
  "province": "NY",
568
556
  },
569
- payment_method={
570
- "stripe_token": "tok_visa",
571
- "type": "stripe_token",
572
- },
573
557
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
574
558
  quantity=1,
575
559
  )
576
560
  print(response.headers.get('X-My-Header'))
577
561
 
578
- checkout_intent = response.parse() # get the object that `checkout_intents.purchase()` would have returned
562
+ checkout_intent = response.parse() # get the object that `checkout_intents.create()` would have returned
579
563
  print(checkout_intent)
580
564
  ```
581
565
 
@@ -590,7 +574,7 @@ The above interface eagerly reads the full response body when you make the reque
590
574
  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.
591
575
 
592
576
  ```python
593
- with client.checkout_intents.with_streaming_response.purchase(
577
+ with client.checkout_intents.with_streaming_response.create(
594
578
  buyer={
595
579
  "address1": "123 Main St",
596
580
  "city": "New York",
@@ -602,10 +586,6 @@ with client.checkout_intents.with_streaming_response.purchase(
602
586
  "postal_code": "10001",
603
587
  "province": "NY",
604
588
  },
605
- payment_method={
606
- "stripe_token": "tok_visa",
607
- "type": "stripe_token",
608
- },
609
589
  product_url="https://rye-protocol.myshopify.com/products/rye-sticker",
610
590
  quantity=1,
611
591
  ) as response:
@@ -23,6 +23,20 @@ Methods:
23
23
  - <code title="post /api/v1/checkout-intents/{id}/confirm">client.checkout_intents.<a href="./src/checkout_intents/resources/checkout_intents.py">confirm</a>(id, \*\*<a href="src/checkout_intents/types/checkout_intent_confirm_params.py">params</a>) -> <a href="./src/checkout_intents/types/checkout_intent.py">CheckoutIntent</a></code>
24
24
  - <code title="post /api/v1/checkout-intents/purchase">client.checkout_intents.<a href="./src/checkout_intents/resources/checkout_intents.py">purchase</a>(\*\*<a href="src/checkout_intents/types/checkout_intent_purchase_params.py">params</a>) -> <a href="./src/checkout_intents/types/checkout_intent.py">CheckoutIntent</a></code>
25
25
 
26
+ # Betas
27
+
28
+ Types:
29
+
30
+ ```python
31
+ from checkout_intents.types import CheckoutSession
32
+ ```
33
+
34
+ ## CheckoutSessions
35
+
36
+ Methods:
37
+
38
+ - <code title="post /api/v1/betas/checkout-sessions">client.betas.checkout_sessions.<a href="./src/checkout_intents/resources/betas/checkout_sessions.py">create</a>(\*\*<a href="src/checkout_intents/types/betas/checkout_session_create_params.py">params</a>) -> <a href="./src/checkout_intents/types/checkout_session.py">CheckoutSession</a></code>
39
+
26
40
  # Brands
27
41
 
28
42
  Types:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "checkout-intents"
3
- version = "0.9.0"
3
+ version = "0.11.0"
4
4
  description = "The official Python library for the Checkout Intents API"
5
5
  dynamic = ["readme"]
6
6
  license = "MIT"
@@ -9,6 +9,7 @@ import asyncio
9
9
  import inspect
10
10
  import logging
11
11
  import platform
12
+ import warnings
12
13
  import email.utils
13
14
  from types import TracebackType
14
15
  from random import random
@@ -51,9 +52,11 @@ from ._types import (
51
52
  ResponseT,
52
53
  AnyMapping,
53
54
  PostParser,
55
+ BinaryTypes,
54
56
  RequestFiles,
55
57
  HttpxSendArgs,
56
58
  RequestOptions,
59
+ AsyncBinaryTypes,
57
60
  HttpxRequestFiles,
58
61
  ModelBuilderProtocol,
59
62
  not_given,
@@ -477,8 +480,19 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
477
480
  retries_taken: int = 0,
478
481
  ) -> httpx.Request:
479
482
  if log.isEnabledFor(logging.DEBUG):
480
- log.debug("Request options: %s", model_dump(options, exclude_unset=True))
481
-
483
+ log.debug(
484
+ "Request options: %s",
485
+ model_dump(
486
+ options,
487
+ exclude_unset=True,
488
+ # Pydantic v1 can't dump every type we support in content, so we exclude it for now.
489
+ exclude={
490
+ "content",
491
+ }
492
+ if PYDANTIC_V1
493
+ else {},
494
+ ),
495
+ )
482
496
  kwargs: dict[str, Any] = {}
483
497
 
484
498
  json_data = options.json_data
@@ -532,7 +546,13 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
532
546
  is_body_allowed = options.method.lower() != "get"
533
547
 
534
548
  if is_body_allowed:
535
- if isinstance(json_data, bytes):
549
+ if options.content is not None and json_data is not None:
550
+ raise TypeError("Passing both `content` and `json_data` is not supported")
551
+ if options.content is not None and files is not None:
552
+ raise TypeError("Passing both `content` and `files` is not supported")
553
+ if options.content is not None:
554
+ kwargs["content"] = options.content
555
+ elif isinstance(json_data, bytes):
536
556
  kwargs["content"] = json_data
537
557
  else:
538
558
  kwargs["json"] = json_data if is_given(json_data) else None
@@ -1194,6 +1214,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1194
1214
  *,
1195
1215
  cast_to: Type[ResponseT],
1196
1216
  body: Body | None = None,
1217
+ content: BinaryTypes | None = None,
1197
1218
  options: RequestOptions = {},
1198
1219
  files: RequestFiles | None = None,
1199
1220
  stream: Literal[False] = False,
@@ -1206,6 +1227,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1206
1227
  *,
1207
1228
  cast_to: Type[ResponseT],
1208
1229
  body: Body | None = None,
1230
+ content: BinaryTypes | None = None,
1209
1231
  options: RequestOptions = {},
1210
1232
  files: RequestFiles | None = None,
1211
1233
  stream: Literal[True],
@@ -1219,6 +1241,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1219
1241
  *,
1220
1242
  cast_to: Type[ResponseT],
1221
1243
  body: Body | None = None,
1244
+ content: BinaryTypes | None = None,
1222
1245
  options: RequestOptions = {},
1223
1246
  files: RequestFiles | None = None,
1224
1247
  stream: bool,
@@ -1231,13 +1254,25 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1231
1254
  *,
1232
1255
  cast_to: Type[ResponseT],
1233
1256
  body: Body | None = None,
1257
+ content: BinaryTypes | None = None,
1234
1258
  options: RequestOptions = {},
1235
1259
  files: RequestFiles | None = None,
1236
1260
  stream: bool = False,
1237
1261
  stream_cls: type[_StreamT] | None = None,
1238
1262
  ) -> ResponseT | _StreamT:
1263
+ if body is not None and content is not None:
1264
+ raise TypeError("Passing both `body` and `content` is not supported")
1265
+ if files is not None and content is not None:
1266
+ raise TypeError("Passing both `files` and `content` is not supported")
1267
+ if isinstance(body, bytes):
1268
+ warnings.warn(
1269
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1270
+ "Please pass raw bytes via the `content` parameter instead.",
1271
+ DeprecationWarning,
1272
+ stacklevel=2,
1273
+ )
1239
1274
  opts = FinalRequestOptions.construct(
1240
- method="post", url=path, json_data=body, files=to_httpx_files(files), **options
1275
+ method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1241
1276
  )
1242
1277
  return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
1243
1278
 
@@ -1247,11 +1282,23 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1247
1282
  *,
1248
1283
  cast_to: Type[ResponseT],
1249
1284
  body: Body | None = None,
1285
+ content: BinaryTypes | None = None,
1250
1286
  files: RequestFiles | None = None,
1251
1287
  options: RequestOptions = {},
1252
1288
  ) -> ResponseT:
1289
+ if body is not None and content is not None:
1290
+ raise TypeError("Passing both `body` and `content` is not supported")
1291
+ if files is not None and content is not None:
1292
+ raise TypeError("Passing both `files` and `content` is not supported")
1293
+ if isinstance(body, bytes):
1294
+ warnings.warn(
1295
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1296
+ "Please pass raw bytes via the `content` parameter instead.",
1297
+ DeprecationWarning,
1298
+ stacklevel=2,
1299
+ )
1253
1300
  opts = FinalRequestOptions.construct(
1254
- method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
1301
+ method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1255
1302
  )
1256
1303
  return self.request(cast_to, opts)
1257
1304
 
@@ -1261,11 +1308,23 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1261
1308
  *,
1262
1309
  cast_to: Type[ResponseT],
1263
1310
  body: Body | None = None,
1311
+ content: BinaryTypes | None = None,
1264
1312
  files: RequestFiles | None = None,
1265
1313
  options: RequestOptions = {},
1266
1314
  ) -> ResponseT:
1315
+ if body is not None and content is not None:
1316
+ raise TypeError("Passing both `body` and `content` is not supported")
1317
+ if files is not None and content is not None:
1318
+ raise TypeError("Passing both `files` and `content` is not supported")
1319
+ if isinstance(body, bytes):
1320
+ warnings.warn(
1321
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1322
+ "Please pass raw bytes via the `content` parameter instead.",
1323
+ DeprecationWarning,
1324
+ stacklevel=2,
1325
+ )
1267
1326
  opts = FinalRequestOptions.construct(
1268
- method="put", url=path, json_data=body, files=to_httpx_files(files), **options
1327
+ method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1269
1328
  )
1270
1329
  return self.request(cast_to, opts)
1271
1330
 
@@ -1275,9 +1334,19 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1275
1334
  *,
1276
1335
  cast_to: Type[ResponseT],
1277
1336
  body: Body | None = None,
1337
+ content: BinaryTypes | None = None,
1278
1338
  options: RequestOptions = {},
1279
1339
  ) -> ResponseT:
1280
- opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
1340
+ if body is not None and content is not None:
1341
+ raise TypeError("Passing both `body` and `content` is not supported")
1342
+ if isinstance(body, bytes):
1343
+ warnings.warn(
1344
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1345
+ "Please pass raw bytes via the `content` parameter instead.",
1346
+ DeprecationWarning,
1347
+ stacklevel=2,
1348
+ )
1349
+ opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
1281
1350
  return self.request(cast_to, opts)
1282
1351
 
1283
1352
  def get_api_list(
@@ -1717,6 +1786,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1717
1786
  *,
1718
1787
  cast_to: Type[ResponseT],
1719
1788
  body: Body | None = None,
1789
+ content: AsyncBinaryTypes | None = None,
1720
1790
  files: RequestFiles | None = None,
1721
1791
  options: RequestOptions = {},
1722
1792
  stream: Literal[False] = False,
@@ -1729,6 +1799,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1729
1799
  *,
1730
1800
  cast_to: Type[ResponseT],
1731
1801
  body: Body | None = None,
1802
+ content: AsyncBinaryTypes | None = None,
1732
1803
  files: RequestFiles | None = None,
1733
1804
  options: RequestOptions = {},
1734
1805
  stream: Literal[True],
@@ -1742,6 +1813,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1742
1813
  *,
1743
1814
  cast_to: Type[ResponseT],
1744
1815
  body: Body | None = None,
1816
+ content: AsyncBinaryTypes | None = None,
1745
1817
  files: RequestFiles | None = None,
1746
1818
  options: RequestOptions = {},
1747
1819
  stream: bool,
@@ -1754,13 +1826,25 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1754
1826
  *,
1755
1827
  cast_to: Type[ResponseT],
1756
1828
  body: Body | None = None,
1829
+ content: AsyncBinaryTypes | None = None,
1757
1830
  files: RequestFiles | None = None,
1758
1831
  options: RequestOptions = {},
1759
1832
  stream: bool = False,
1760
1833
  stream_cls: type[_AsyncStreamT] | None = None,
1761
1834
  ) -> ResponseT | _AsyncStreamT:
1835
+ if body is not None and content is not None:
1836
+ raise TypeError("Passing both `body` and `content` is not supported")
1837
+ if files is not None and content is not None:
1838
+ raise TypeError("Passing both `files` and `content` is not supported")
1839
+ if isinstance(body, bytes):
1840
+ warnings.warn(
1841
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1842
+ "Please pass raw bytes via the `content` parameter instead.",
1843
+ DeprecationWarning,
1844
+ stacklevel=2,
1845
+ )
1762
1846
  opts = FinalRequestOptions.construct(
1763
- method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1847
+ method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
1764
1848
  )
1765
1849
  return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
1766
1850
 
@@ -1770,11 +1854,28 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1770
1854
  *,
1771
1855
  cast_to: Type[ResponseT],
1772
1856
  body: Body | None = None,
1857
+ content: AsyncBinaryTypes | None = None,
1773
1858
  files: RequestFiles | None = None,
1774
1859
  options: RequestOptions = {},
1775
1860
  ) -> ResponseT:
1861
+ if body is not None and content is not None:
1862
+ raise TypeError("Passing both `body` and `content` is not supported")
1863
+ if files is not None and content is not None:
1864
+ raise TypeError("Passing both `files` and `content` is not supported")
1865
+ if isinstance(body, bytes):
1866
+ warnings.warn(
1867
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1868
+ "Please pass raw bytes via the `content` parameter instead.",
1869
+ DeprecationWarning,
1870
+ stacklevel=2,
1871
+ )
1776
1872
  opts = FinalRequestOptions.construct(
1777
- method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1873
+ method="patch",
1874
+ url=path,
1875
+ json_data=body,
1876
+ content=content,
1877
+ files=await async_to_httpx_files(files),
1878
+ **options,
1778
1879
  )
1779
1880
  return await self.request(cast_to, opts)
1780
1881
 
@@ -1784,11 +1885,23 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1784
1885
  *,
1785
1886
  cast_to: Type[ResponseT],
1786
1887
  body: Body | None = None,
1888
+ content: AsyncBinaryTypes | None = None,
1787
1889
  files: RequestFiles | None = None,
1788
1890
  options: RequestOptions = {},
1789
1891
  ) -> ResponseT:
1892
+ if body is not None and content is not None:
1893
+ raise TypeError("Passing both `body` and `content` is not supported")
1894
+ if files is not None and content is not None:
1895
+ raise TypeError("Passing both `files` and `content` is not supported")
1896
+ if isinstance(body, bytes):
1897
+ warnings.warn(
1898
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1899
+ "Please pass raw bytes via the `content` parameter instead.",
1900
+ DeprecationWarning,
1901
+ stacklevel=2,
1902
+ )
1790
1903
  opts = FinalRequestOptions.construct(
1791
- method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1904
+ method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
1792
1905
  )
1793
1906
  return await self.request(cast_to, opts)
1794
1907
 
@@ -1798,9 +1911,19 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1798
1911
  *,
1799
1912
  cast_to: Type[ResponseT],
1800
1913
  body: Body | None = None,
1914
+ content: AsyncBinaryTypes | None = None,
1801
1915
  options: RequestOptions = {},
1802
1916
  ) -> ResponseT:
1803
- opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
1917
+ if body is not None and content is not None:
1918
+ raise TypeError("Passing both `body` and `content` is not supported")
1919
+ if isinstance(body, bytes):
1920
+ warnings.warn(
1921
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1922
+ "Please pass raw bytes via the `content` parameter instead.",
1923
+ DeprecationWarning,
1924
+ stacklevel=2,
1925
+ )
1926
+ opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
1804
1927
  return await self.request(cast_to, opts)
1805
1928
 
1806
1929
  def get_api_list(