checkout-intents 0.11.0__tar.gz → 0.12.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.12.0/.release-please-manifest.json +3 -0
  2. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/CHANGELOG.md +15 -0
  3. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/PKG-INFO +1 -1
  4. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/pyproject.toml +1 -1
  5. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_client.py +4 -0
  6. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_version.py +1 -1
  7. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/resources/betas/checkout_sessions.py +16 -2
  8. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/resources/checkout_intents.py +64 -8
  9. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/base_checkout_intent.py +11 -0
  10. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/betas/checkout_session_create_params.py +11 -1
  11. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/checkout_intent_create_params.py +11 -1
  12. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/checkout_intent_purchase_params.py +11 -1
  13. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/api_resources/betas/test_checkout_sessions.py +2 -0
  14. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/api_resources/test_checkout_intents.py +4 -0
  15. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_client.py +62 -0
  16. checkout_intents-0.11.0/.release-please-manifest.json +0 -3
  17. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/.gitignore +0 -0
  18. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/CONTRIBUTING.md +0 -0
  19. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/LICENSE +0 -0
  20. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/README.md +0 -0
  21. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/SECURITY.md +0 -0
  22. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/api.md +0 -0
  23. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/bin/check-release-environment +0 -0
  24. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/bin/publish-pypi +0 -0
  25. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/examples/.keep +0 -0
  26. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/examples/complete-checkout-intent.py +0 -0
  27. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/examples/error-handling.py +0 -0
  28. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/noxfile.py +0 -0
  29. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/release-please-config.json +0 -0
  30. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/requirements-dev.lock +0 -0
  31. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/requirements.lock +0 -0
  32. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/__init__.py +0 -0
  33. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_base_client.py +0 -0
  34. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_compat.py +0 -0
  35. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_constants.py +0 -0
  36. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_exceptions.py +0 -0
  37. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_files.py +0 -0
  38. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_models.py +0 -0
  39. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_qs.py +0 -0
  40. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_resource.py +0 -0
  41. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_response.py +0 -0
  42. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_streaming.py +0 -0
  43. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_types.py +0 -0
  44. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/__init__.py +0 -0
  45. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_compat.py +0 -0
  46. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_datetime_parse.py +0 -0
  47. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_logs.py +0 -0
  48. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_proxy.py +0 -0
  49. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_reflection.py +0 -0
  50. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_resources_proxy.py +0 -0
  51. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_streams.py +0 -0
  52. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_sync.py +0 -0
  53. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_transform.py +0 -0
  54. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_typing.py +0 -0
  55. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/_utils/_utils.py +0 -0
  56. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/lib/.keep +0 -0
  57. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/pagination.py +0 -0
  58. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/py.typed +0 -0
  59. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/resources/__init__.py +0 -0
  60. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/resources/betas/__init__.py +0 -0
  61. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/resources/betas/betas.py +0 -0
  62. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/resources/brands.py +0 -0
  63. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/__init__.py +0 -0
  64. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/betas/__init__.py +0 -0
  65. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/brand_retrieve_response.py +0 -0
  66. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/buyer.py +0 -0
  67. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/buyer_param.py +0 -0
  68. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/checkout_intent.py +0 -0
  69. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/checkout_intent_add_payment_params.py +0 -0
  70. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/checkout_intent_confirm_params.py +0 -0
  71. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/checkout_intent_list_params.py +0 -0
  72. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/checkout_session.py +0 -0
  73. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/money.py +0 -0
  74. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/offer.py +0 -0
  75. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/payment_method.py +0 -0
  76. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/payment_method_param.py +0 -0
  77. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/variant_selection.py +0 -0
  78. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/src/checkout_intents/types/variant_selection_param.py +0 -0
  79. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/__init__.py +0 -0
  80. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/api_resources/__init__.py +0 -0
  81. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/api_resources/betas/__init__.py +0 -0
  82. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/api_resources/test_brands.py +0 -0
  83. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/conftest.py +0 -0
  84. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/sample_file.txt +0 -0
  85. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_deepcopy.py +0 -0
  86. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_environment_inference.py +0 -0
  87. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_extract_files.py +0 -0
  88. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_files.py +0 -0
  89. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_models.py +0 -0
  90. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_polling.py +0 -0
  91. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_qs.py +0 -0
  92. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_required_args.py +0 -0
  93. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_response.py +0 -0
  94. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_streaming.py +0 -0
  95. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_transform.py +0 -0
  96. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_utils/test_datetime_parse.py +0 -0
  97. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_utils/test_proxy.py +0 -0
  98. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/test_utils/test_typing.py +0 -0
  99. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/tests/utils.py +0 -0
  100. {checkout_intents-0.11.0 → checkout_intents-0.12.0}/uv.lock +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.12.0"
3
+ }
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0 (2026-01-24)
4
+
5
+ Full Changelog: [v0.11.0...v0.12.0](https://github.com/rye-com/checkout-intents-python/compare/v0.11.0...v0.12.0)
6
+
7
+ ### Features
8
+
9
+ * add support for idempotency for v2 api ([b7a09af](https://github.com/rye-com/checkout-intents-python/commit/b7a09af76927e67befdbe59566bddf7ab43240f0))
10
+ * **api:** introduce offerRetrievalEffort constraint ([5bc7a2c](https://github.com/rye-com/checkout-intents-python/commit/5bc7a2cc58c555dd4dcd5c0e3abf1f157cd61e8f))
11
+
12
+
13
+ ### Chores
14
+
15
+ * **ci:** upgrade `actions/github-script` ([526d94a](https://github.com/rye-com/checkout-intents-python/commit/526d94ae385eb0e5f54124ca429651d55ce0ec53))
16
+ * **internal:** update `actions/checkout` version ([9eadb2e](https://github.com/rye-com/checkout-intents-python/commit/9eadb2e9a5a8abaad98be7567dd3dc195458cd53))
17
+
3
18
  ## 0.11.0 (2026-01-15)
4
19
 
5
20
  Full Changelog: [v0.10.0...v0.11.0](https://github.com/rye-com/checkout-intents-python/compare/v0.10.0...v0.11.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: checkout-intents
3
- Version: 0.11.0
3
+ Version: 0.12.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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "checkout-intents"
3
- version = "0.11.0"
3
+ version = "0.12.0"
4
4
  description = "The official Python library for the Checkout Intents API"
5
5
  dynamic = ["readme"]
6
6
  license = "MIT"
@@ -167,6 +167,8 @@ class CheckoutIntents(SyncAPIClient):
167
167
  _strict_response_validation=_strict_response_validation,
168
168
  )
169
169
 
170
+ self._idempotency_header = "Idempotency-Key"
171
+
170
172
  @cached_property
171
173
  def checkout_intents(self) -> CheckoutIntentsResource:
172
174
  from .resources.checkout_intents import CheckoutIntentsResource
@@ -396,6 +398,8 @@ class AsyncCheckoutIntents(AsyncAPIClient):
396
398
  _strict_response_validation=_strict_response_validation,
397
399
  )
398
400
 
401
+ self._idempotency_header = "Idempotency-Key"
402
+
399
403
  @cached_property
400
404
  def checkout_intents(self) -> AsyncCheckoutIntentsResource:
401
405
  from .resources.checkout_intents import AsyncCheckoutIntentsResource
@@ -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.11.0" # x-release-please-version
4
+ __version__ = "0.12.0" # x-release-please-version
@@ -59,6 +59,7 @@ class CheckoutSessionsResource(SyncAPIResource):
59
59
  extra_query: Query | None = None,
60
60
  extra_body: Body | None = None,
61
61
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
62
+ idempotency_key: str | None = None,
62
63
  ) -> CheckoutSession:
63
64
  """
64
65
  Create a new checkout session.
@@ -77,6 +78,8 @@ class CheckoutSessionsResource(SyncAPIResource):
77
78
  extra_body: Add additional JSON properties to the request
78
79
 
79
80
  timeout: Override the client-level default timeout for this request, in seconds
81
+
82
+ idempotency_key: Specify a custom idempotency key for this request
80
83
  """
81
84
  return self._post(
82
85
  "/api/v1/betas/checkout-sessions",
@@ -92,7 +95,11 @@ class CheckoutSessionsResource(SyncAPIResource):
92
95
  checkout_session_create_params.CheckoutSessionCreateParams,
93
96
  ),
94
97
  options=make_request_options(
95
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
98
+ extra_headers=extra_headers,
99
+ extra_query=extra_query,
100
+ extra_body=extra_body,
101
+ timeout=timeout,
102
+ idempotency_key=idempotency_key,
96
103
  ),
97
104
  cast_to=CheckoutSession,
98
105
  )
@@ -133,6 +140,7 @@ class AsyncCheckoutSessionsResource(AsyncAPIResource):
133
140
  extra_query: Query | None = None,
134
141
  extra_body: Body | None = None,
135
142
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
143
+ idempotency_key: str | None = None,
136
144
  ) -> CheckoutSession:
137
145
  """
138
146
  Create a new checkout session.
@@ -151,6 +159,8 @@ class AsyncCheckoutSessionsResource(AsyncAPIResource):
151
159
  extra_body: Add additional JSON properties to the request
152
160
 
153
161
  timeout: Override the client-level default timeout for this request, in seconds
162
+
163
+ idempotency_key: Specify a custom idempotency key for this request
154
164
  """
155
165
  return await self._post(
156
166
  "/api/v1/betas/checkout-sessions",
@@ -166,7 +176,11 @@ class AsyncCheckoutSessionsResource(AsyncAPIResource):
166
176
  checkout_session_create_params.CheckoutSessionCreateParams,
167
177
  ),
168
178
  options=make_request_options(
169
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
179
+ extra_headers=extra_headers,
180
+ extra_query=extra_query,
181
+ extra_body=extra_body,
182
+ timeout=timeout,
183
+ idempotency_key=idempotency_key,
170
184
  ),
171
185
  cast_to=CheckoutSession,
172
186
  )
@@ -80,6 +80,7 @@ class CheckoutIntentsResource(SyncAPIResource):
80
80
  extra_query: Query | None = None,
81
81
  extra_body: Body | None = None,
82
82
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
83
+ idempotency_key: str | None = None,
83
84
  ) -> CheckoutIntent:
84
85
  """
85
86
  Create a checkout intent with the given request body.
@@ -92,6 +93,8 @@ class CheckoutIntentsResource(SyncAPIResource):
92
93
  extra_body: Add additional JSON properties to the request
93
94
 
94
95
  timeout: Override the client-level default timeout for this request, in seconds
96
+
97
+ idempotency_key: Specify a custom idempotency key for this request
95
98
  """
96
99
  return cast(
97
100
  CheckoutIntent,
@@ -109,7 +112,11 @@ class CheckoutIntentsResource(SyncAPIResource):
109
112
  checkout_intent_create_params.CheckoutIntentCreateParams,
110
113
  ),
111
114
  options=make_request_options(
112
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
115
+ extra_headers=extra_headers,
116
+ extra_query=extra_query,
117
+ extra_body=extra_body,
118
+ timeout=timeout,
119
+ idempotency_key=idempotency_key,
113
120
  ),
114
121
  cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
115
122
  ),
@@ -217,6 +224,7 @@ class CheckoutIntentsResource(SyncAPIResource):
217
224
  extra_query: Query | None = None,
218
225
  extra_body: Body | None = None,
219
226
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
227
+ idempotency_key: str | None = None,
220
228
  ) -> CheckoutIntent:
221
229
  """
222
230
  Add payment details to a checkout intent
@@ -229,6 +237,8 @@ class CheckoutIntentsResource(SyncAPIResource):
229
237
  extra_body: Add additional JSON properties to the request
230
238
 
231
239
  timeout: Override the client-level default timeout for this request, in seconds
240
+
241
+ idempotency_key: Specify a custom idempotency key for this request
232
242
  """
233
243
  if not id:
234
244
  raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
@@ -241,7 +251,11 @@ class CheckoutIntentsResource(SyncAPIResource):
241
251
  checkout_intent_add_payment_params.CheckoutIntentAddPaymentParams,
242
252
  ),
243
253
  options=make_request_options(
244
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
254
+ extra_headers=extra_headers,
255
+ extra_query=extra_query,
256
+ extra_body=extra_body,
257
+ timeout=timeout,
258
+ idempotency_key=idempotency_key,
245
259
  ),
246
260
  cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
247
261
  ),
@@ -258,6 +272,7 @@ class CheckoutIntentsResource(SyncAPIResource):
258
272
  extra_query: Query | None = None,
259
273
  extra_body: Body | None = None,
260
274
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
275
+ idempotency_key: str | None = None,
261
276
  ) -> CheckoutIntent:
262
277
  """
263
278
  Confirm a checkout intent with provided payment information
@@ -273,6 +288,8 @@ class CheckoutIntentsResource(SyncAPIResource):
273
288
  extra_body: Add additional JSON properties to the request
274
289
 
275
290
  timeout: Override the client-level default timeout for this request, in seconds
291
+
292
+ idempotency_key: Specify a custom idempotency key for this request
276
293
  """
277
294
  if not id:
278
295
  raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
@@ -284,7 +301,11 @@ class CheckoutIntentsResource(SyncAPIResource):
284
301
  {"payment_method": payment_method}, checkout_intent_confirm_params.CheckoutIntentConfirmParams
285
302
  ),
286
303
  options=make_request_options(
287
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
304
+ extra_headers=extra_headers,
305
+ extra_query=extra_query,
306
+ extra_body=extra_body,
307
+ timeout=timeout,
308
+ idempotency_key=idempotency_key,
288
309
  ),
289
310
  cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
290
311
  ),
@@ -306,6 +327,7 @@ class CheckoutIntentsResource(SyncAPIResource):
306
327
  extra_query: Query | None = None,
307
328
  extra_body: Body | None = None,
308
329
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
330
+ idempotency_key: str | None = None,
309
331
  ) -> CheckoutIntent:
310
332
  """
311
333
  Create a checkout intent and immediately trigger the purchase workflow.
@@ -322,6 +344,8 @@ class CheckoutIntentsResource(SyncAPIResource):
322
344
  extra_body: Add additional JSON properties to the request
323
345
 
324
346
  timeout: Override the client-level default timeout for this request, in seconds
347
+
348
+ idempotency_key: Specify a custom idempotency key for this request
325
349
  """
326
350
  return cast(
327
351
  CheckoutIntent,
@@ -340,7 +364,11 @@ class CheckoutIntentsResource(SyncAPIResource):
340
364
  checkout_intent_purchase_params.CheckoutIntentPurchaseParams
341
365
  ),
342
366
  options=make_request_options(
343
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
367
+ extra_headers=extra_headers,
368
+ extra_query=extra_query,
369
+ extra_body=extra_body,
370
+ timeout=timeout,
371
+ idempotency_key=idempotency_key,
344
372
  ),
345
373
  cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
346
374
  ),
@@ -741,6 +769,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
741
769
  extra_query: Query | None = None,
742
770
  extra_body: Body | None = None,
743
771
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
772
+ idempotency_key: str | None = None,
744
773
  ) -> CheckoutIntent:
745
774
  """
746
775
  Create a checkout intent with the given request body.
@@ -753,6 +782,8 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
753
782
  extra_body: Add additional JSON properties to the request
754
783
 
755
784
  timeout: Override the client-level default timeout for this request, in seconds
785
+
786
+ idempotency_key: Specify a custom idempotency key for this request
756
787
  """
757
788
  return cast(
758
789
  CheckoutIntent,
@@ -770,7 +801,11 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
770
801
  checkout_intent_create_params.CheckoutIntentCreateParams,
771
802
  ),
772
803
  options=make_request_options(
773
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
804
+ extra_headers=extra_headers,
805
+ extra_query=extra_query,
806
+ extra_body=extra_body,
807
+ timeout=timeout,
808
+ idempotency_key=idempotency_key,
774
809
  ),
775
810
  cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
776
811
  ),
@@ -878,6 +913,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
878
913
  extra_query: Query | None = None,
879
914
  extra_body: Body | None = None,
880
915
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
916
+ idempotency_key: str | None = None,
881
917
  ) -> CheckoutIntent:
882
918
  """
883
919
  Add payment details to a checkout intent
@@ -890,6 +926,8 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
890
926
  extra_body: Add additional JSON properties to the request
891
927
 
892
928
  timeout: Override the client-level default timeout for this request, in seconds
929
+
930
+ idempotency_key: Specify a custom idempotency key for this request
893
931
  """
894
932
  if not id:
895
933
  raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
@@ -902,7 +940,11 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
902
940
  checkout_intent_add_payment_params.CheckoutIntentAddPaymentParams,
903
941
  ),
904
942
  options=make_request_options(
905
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
943
+ extra_headers=extra_headers,
944
+ extra_query=extra_query,
945
+ extra_body=extra_body,
946
+ timeout=timeout,
947
+ idempotency_key=idempotency_key,
906
948
  ),
907
949
  cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
908
950
  ),
@@ -919,6 +961,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
919
961
  extra_query: Query | None = None,
920
962
  extra_body: Body | None = None,
921
963
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
964
+ idempotency_key: str | None = None,
922
965
  ) -> CheckoutIntent:
923
966
  """
924
967
  Confirm a checkout intent with provided payment information
@@ -934,6 +977,8 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
934
977
  extra_body: Add additional JSON properties to the request
935
978
 
936
979
  timeout: Override the client-level default timeout for this request, in seconds
980
+
981
+ idempotency_key: Specify a custom idempotency key for this request
937
982
  """
938
983
  if not id:
939
984
  raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
@@ -945,7 +990,11 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
945
990
  {"payment_method": payment_method}, checkout_intent_confirm_params.CheckoutIntentConfirmParams
946
991
  ),
947
992
  options=make_request_options(
948
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
993
+ extra_headers=extra_headers,
994
+ extra_query=extra_query,
995
+ extra_body=extra_body,
996
+ timeout=timeout,
997
+ idempotency_key=idempotency_key,
949
998
  ),
950
999
  cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
951
1000
  ),
@@ -967,6 +1016,7 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
967
1016
  extra_query: Query | None = None,
968
1017
  extra_body: Body | None = None,
969
1018
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
1019
+ idempotency_key: str | None = None,
970
1020
  ) -> CheckoutIntent:
971
1021
  """
972
1022
  Create a checkout intent and immediately trigger the purchase workflow.
@@ -983,6 +1033,8 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
983
1033
  extra_body: Add additional JSON properties to the request
984
1034
 
985
1035
  timeout: Override the client-level default timeout for this request, in seconds
1036
+
1037
+ idempotency_key: Specify a custom idempotency key for this request
986
1038
  """
987
1039
  return cast(
988
1040
  CheckoutIntent,
@@ -1001,7 +1053,11 @@ class AsyncCheckoutIntentsResource(AsyncAPIResource):
1001
1053
  checkout_intent_purchase_params.CheckoutIntentPurchaseParams
1002
1054
  ),
1003
1055
  options=make_request_options(
1004
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1056
+ extra_headers=extra_headers,
1057
+ extra_query=extra_query,
1058
+ extra_body=extra_body,
1059
+ timeout=timeout,
1060
+ idempotency_key=idempotency_key,
1005
1061
  ),
1006
1062
  cast_to=cast(Any, CheckoutIntent), # Union types cannot be passed in as arguments in the type system
1007
1063
  ),
@@ -2,6 +2,7 @@
2
2
 
3
3
  from typing import List, Optional
4
4
  from datetime import datetime
5
+ from typing_extensions import Literal
5
6
 
6
7
  from pydantic import Field as FieldInfo
7
8
 
@@ -17,6 +18,16 @@ class Constraints(BaseModel):
17
18
 
18
19
  max_total_price: Optional[int] = FieldInfo(alias="maxTotalPrice", default=None)
19
20
 
21
+ offer_retrieval_effort: Optional[Literal["max", "low"]] = FieldInfo(alias="offerRetrievalEffort", default=None)
22
+ """Controls how much effort the system should spend retrieving an offer.
23
+
24
+ - 'max': Full effort including AI agent fallback (slower, higher success rate)
25
+ - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
26
+ success rate)
27
+
28
+ Default: 'max'
29
+ """
30
+
20
31
 
21
32
  class BaseCheckoutIntent(BaseModel):
22
33
  id: str
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import Iterable
6
- from typing_extensions import Required, Annotated, TypedDict
6
+ from typing_extensions import Literal, Required, Annotated, TypedDict
7
7
 
8
8
  from ..._types import SequenceNotStr
9
9
  from ..._utils import PropertyInfo
@@ -60,3 +60,13 @@ class Constraints(TypedDict, total=False):
60
60
  max_shipping_price: Annotated[int, PropertyInfo(alias="maxShippingPrice")]
61
61
 
62
62
  max_total_price: Annotated[int, PropertyInfo(alias="maxTotalPrice")]
63
+
64
+ offer_retrieval_effort: Annotated[Literal["max", "low"], PropertyInfo(alias="offerRetrievalEffort")]
65
+ """Controls how much effort the system should spend retrieving an offer.
66
+
67
+ - 'max': Full effort including AI agent fallback (slower, higher success rate)
68
+ - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
69
+ success rate)
70
+
71
+ Default: 'max'
72
+ """
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import Iterable
6
- from typing_extensions import Required, Annotated, TypedDict
6
+ from typing_extensions import Literal, Required, Annotated, TypedDict
7
7
 
8
8
  from .._types import SequenceNotStr
9
9
  from .._utils import PropertyInfo
@@ -31,3 +31,13 @@ class Constraints(TypedDict, total=False):
31
31
  max_shipping_price: Annotated[int, PropertyInfo(alias="maxShippingPrice")]
32
32
 
33
33
  max_total_price: Annotated[int, PropertyInfo(alias="maxTotalPrice")]
34
+
35
+ offer_retrieval_effort: Annotated[Literal["max", "low"], PropertyInfo(alias="offerRetrievalEffort")]
36
+ """Controls how much effort the system should spend retrieving an offer.
37
+
38
+ - 'max': Full effort including AI agent fallback (slower, higher success rate)
39
+ - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
40
+ success rate)
41
+
42
+ Default: 'max'
43
+ """
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from typing import Iterable
6
- from typing_extensions import Required, Annotated, TypedDict
6
+ from typing_extensions import Literal, Required, Annotated, TypedDict
7
7
 
8
8
  from .._types import SequenceNotStr
9
9
  from .._utils import PropertyInfo
@@ -34,3 +34,13 @@ class Constraints(TypedDict, total=False):
34
34
  max_shipping_price: Annotated[int, PropertyInfo(alias="maxShippingPrice")]
35
35
 
36
36
  max_total_price: Annotated[int, PropertyInfo(alias="maxTotalPrice")]
37
+
38
+ offer_retrieval_effort: Annotated[Literal["max", "low"], PropertyInfo(alias="offerRetrievalEffort")]
39
+ """Controls how much effort the system should spend retrieving an offer.
40
+
41
+ - 'max': Full effort including AI agent fallback (slower, higher success rate)
42
+ - 'low': Fast API-only retrieval, fails if API unavailable (faster, lower
43
+ success rate)
44
+
45
+ Default: 'max'
46
+ """
@@ -47,6 +47,7 @@ class TestCheckoutSessions:
47
47
  constraints={
48
48
  "max_shipping_price": 500,
49
49
  "max_total_price": 100000,
50
+ "offer_retrieval_effort": "max",
50
51
  },
51
52
  promo_codes=["string"],
52
53
  variant_selections=[
@@ -122,6 +123,7 @@ class TestAsyncCheckoutSessions:
122
123
  constraints={
123
124
  "max_shipping_price": 500,
124
125
  "max_total_price": 100000,
126
+ "offer_retrieval_effort": "max",
125
127
  },
126
128
  promo_codes=["string"],
127
129
  variant_selections=[
@@ -61,6 +61,7 @@ class TestCheckoutIntents:
61
61
  constraints={
62
62
  "max_shipping_price": 500,
63
63
  "max_total_price": 100000,
64
+ "offer_retrieval_effort": "max",
64
65
  },
65
66
  promo_codes=["sqF12lZ1VlBb"],
66
67
  variant_selections=[
@@ -393,6 +394,7 @@ class TestCheckoutIntents:
393
394
  constraints={
394
395
  "max_shipping_price": 500,
395
396
  "max_total_price": 100000,
397
+ "offer_retrieval_effort": "max",
396
398
  },
397
399
  promo_codes=["sqF12lZ1VlBb"],
398
400
  variant_selections=[
@@ -509,6 +511,7 @@ class TestAsyncCheckoutIntents:
509
511
  constraints={
510
512
  "max_shipping_price": 500,
511
513
  "max_total_price": 100000,
514
+ "offer_retrieval_effort": "max",
512
515
  },
513
516
  promo_codes=["sqF12lZ1VlBb"],
514
517
  variant_selections=[
@@ -841,6 +844,7 @@ class TestAsyncCheckoutIntents:
841
844
  constraints={
842
845
  "max_shipping_price": 500,
843
846
  "max_total_price": 100000,
847
+ "offer_retrieval_effort": "max",
844
848
  },
845
849
  promo_codes=["sqF12lZ1VlBb"],
846
850
  variant_selections=[
@@ -685,6 +685,37 @@ class TestCheckoutIntents:
685
685
  assert isinstance(response, Model)
686
686
  assert response.foo == 2
687
687
 
688
+ @pytest.mark.respx(base_url=base_url)
689
+ def test_idempotency_header_options(self, respx_mock: MockRouter, client: CheckoutIntents) -> None:
690
+ respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={}))
691
+
692
+ response = client.post("/foo", cast_to=httpx.Response)
693
+
694
+ header = response.request.headers.get("Idempotency-Key")
695
+ assert header is not None
696
+ assert header.startswith("stainless-python-retry")
697
+
698
+ # explicit header
699
+ response = client.post(
700
+ "/foo",
701
+ cast_to=httpx.Response,
702
+ options=make_request_options(extra_headers={"Idempotency-Key": "custom-key"}),
703
+ )
704
+ assert response.request.headers.get("Idempotency-Key") == "custom-key"
705
+
706
+ response = client.post(
707
+ "/foo",
708
+ cast_to=httpx.Response,
709
+ options=make_request_options(extra_headers={"idempotency-key": "custom-key"}),
710
+ )
711
+ assert response.request.headers.get("Idempotency-Key") == "custom-key"
712
+
713
+ # custom argument
714
+ response = client.post(
715
+ "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key")
716
+ )
717
+ assert response.request.headers.get("Idempotency-Key") == "custom-key"
718
+
688
719
  def test_base_url_setter(self) -> None:
689
720
  client = CheckoutIntents(
690
721
  base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True
@@ -1668,6 +1699,37 @@ class TestAsyncCheckoutIntents:
1668
1699
  assert isinstance(response, Model)
1669
1700
  assert response.foo == 2
1670
1701
 
1702
+ @pytest.mark.respx(base_url=base_url)
1703
+ async def test_idempotency_header_options(self, respx_mock: MockRouter, async_client: AsyncCheckoutIntents) -> None:
1704
+ respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={}))
1705
+
1706
+ response = await async_client.post("/foo", cast_to=httpx.Response)
1707
+
1708
+ header = response.request.headers.get("Idempotency-Key")
1709
+ assert header is not None
1710
+ assert header.startswith("stainless-python-retry")
1711
+
1712
+ # explicit header
1713
+ response = await async_client.post(
1714
+ "/foo",
1715
+ cast_to=httpx.Response,
1716
+ options=make_request_options(extra_headers={"Idempotency-Key": "custom-key"}),
1717
+ )
1718
+ assert response.request.headers.get("Idempotency-Key") == "custom-key"
1719
+
1720
+ response = await async_client.post(
1721
+ "/foo",
1722
+ cast_to=httpx.Response,
1723
+ options=make_request_options(extra_headers={"idempotency-key": "custom-key"}),
1724
+ )
1725
+ assert response.request.headers.get("Idempotency-Key") == "custom-key"
1726
+
1727
+ # custom argument
1728
+ response = await async_client.post(
1729
+ "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key")
1730
+ )
1731
+ assert response.request.headers.get("Idempotency-Key") == "custom-key"
1732
+
1671
1733
  async def test_base_url_setter(self) -> None:
1672
1734
  client = AsyncCheckoutIntents(
1673
1735
  base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.11.0"
3
- }