vortex-sdk 0.2.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.
Files changed (123) hide show
  1. vortex/__init__.py +265 -0
  2. vortex/api/__init__.py +24 -0
  3. vortex/api/billing_api.py +34608 -0
  4. vortex/api/catalog_api.py +708 -0
  5. vortex/api/checkout_api.py +372 -0
  6. vortex/api/credit_notes_api.py +1688 -0
  7. vortex/api/customer_balance_api.py +1747 -0
  8. vortex/api/customers_api.py +387 -0
  9. vortex/api/discounts_api.py +2623 -0
  10. vortex/api/entitlements_api.py +1646 -0
  11. vortex/api/hosted_api.py +2855 -0
  12. vortex/api/invoices_api.py +2402 -0
  13. vortex/api/payables_api.py +1380 -0
  14. vortex/api/payment_methods_api.py +2069 -0
  15. vortex/api/payment_requests_api.py +1877 -0
  16. vortex/api/payments_api.py +694 -0
  17. vortex/api/payments_readiness_api.py +2311 -0
  18. vortex/api/public_api.py +6931 -0
  19. vortex/api/quotes_api.py +6817 -0
  20. vortex/api/receipts_api.py +1111 -0
  21. vortex/api/subscriptions_api.py +1059 -0
  22. vortex/api/tax_api.py +1397 -0
  23. vortex/api/webhooks_api.py +4931 -0
  24. vortex/api_client.py +804 -0
  25. vortex/api_response.py +21 -0
  26. vortex/configuration.py +658 -0
  27. vortex/exceptions.py +218 -0
  28. vortex/models/__init__.py +104 -0
  29. vortex/models/api_error.py +103 -0
  30. vortex/models/api_error_error.py +114 -0
  31. vortex/models/api_write_envelope.py +101 -0
  32. vortex/models/apply_coupon_request.py +97 -0
  33. vortex/models/billing_order_form_sign_request.py +103 -0
  34. vortex/models/billing_order_form_signature_request_request.py +86 -0
  35. vortex/models/billing_order_form_void_request.py +86 -0
  36. vortex/models/billing_order_forms_expire_due_request.py +90 -0
  37. vortex/models/billing_order_update_request.py +99 -0
  38. vortex/models/billing_orders_execute_due_request.py +90 -0
  39. vortex/models/billing_quote_create_request.py +119 -0
  40. vortex/models/billing_quote_line_input.py +93 -0
  41. vortex/models/billing_quote_version_approve_request.py +87 -0
  42. vortex/models/billing_quote_version_create_request.py +103 -0
  43. vortex/models/billing_quote_version_update_request.py +102 -0
  44. vortex/models/billing_quote_version_void_request.py +96 -0
  45. vortex/models/checkout_session_line_item_request.py +91 -0
  46. vortex/models/coupon_targets.py +89 -0
  47. vortex/models/create_checkout_session_request.py +140 -0
  48. vortex/models/create_coupon_request.py +132 -0
  49. vortex/models/create_deposit_balance_payable_request.py +172 -0
  50. vortex/models/create_installment_payable_request.py +170 -0
  51. vortex/models/create_payable_request.py +158 -0
  52. vortex/models/create_recurring_payable_request.py +181 -0
  53. vortex/models/create_recurring_payable_request_cadence.py +96 -0
  54. vortex/models/credit_note_create_line.py +105 -0
  55. vortex/models/credit_note_create_request.py +112 -0
  56. vortex/models/credit_note_reason.py +39 -0
  57. vortex/models/credit_note_refund_reconcile_request.py +86 -0
  58. vortex/models/credit_note_refund_request.py +94 -0
  59. vortex/models/customer_balance_targets.py +102 -0
  60. vortex/models/customer_default_payment_method_request.py +88 -0
  61. vortex/models/customer_payment_method_archive_request.py +88 -0
  62. vortex/models/customer_payment_method_attach_request.py +94 -0
  63. vortex/models/customer_payment_method_setup_request.py +100 -0
  64. vortex/models/customer_upsert_request.py +96 -0
  65. vortex/models/expire_customer_balance_request.py +98 -0
  66. vortex/models/grant_customer_balance_from_payment_request.py +103 -0
  67. vortex/models/grant_customer_balance_request.py +106 -0
  68. vortex/models/grant_entitlement_request.py +106 -0
  69. vortex/models/invoice_collect_request.py +86 -0
  70. vortex/models/invoice_create_request.py +92 -0
  71. vortex/models/invoice_finalize_request.py +86 -0
  72. vortex/models/invoice_mark_uncollectible_request.py +90 -0
  73. vortex/models/invoice_tax.py +142 -0
  74. vortex/models/invoice_void_request.py +88 -0
  75. vortex/models/merchant_account_create_request.py +183 -0
  76. vortex/models/merchant_address.py +96 -0
  77. vortex/models/merchant_associated_identity.py +114 -0
  78. vortex/models/merchant_onboarding_link_request.py +95 -0
  79. vortex/models/merchant_profile_date.py +90 -0
  80. vortex/models/merchant_settlement_bank_account.py +94 -0
  81. vortex/models/merchant_tax_profile_request.py +125 -0
  82. vortex/models/merchant_tax_profile_request_registrations_inner.py +88 -0
  83. vortex/models/merchant_underwriting_data.py +127 -0
  84. vortex/models/merchant_underwriting_data_card_volume_distribution.py +90 -0
  85. vortex/models/merchant_underwriting_data_volume_distribution_by_business_type.py +90 -0
  86. vortex/models/open_api_invoice_tax_response.py +92 -0
  87. vortex/models/open_api_invoice_tax_response_all_of_data.py +92 -0
  88. vortex/models/payment_request_collect_request.py +86 -0
  89. vortex/models/payment_request_create_request.py +100 -0
  90. vortex/models/payment_request_link_create_request.py +89 -0
  91. vortex/models/price_create_request.py +122 -0
  92. vortex/models/product_create_request.py +92 -0
  93. vortex/models/reverse_customer_balance_request.py +98 -0
  94. vortex/models/revoke_entitlement_request.py +106 -0
  95. vortex/models/subscription_change_request.py +111 -0
  96. vortex/models/subscription_create_request.py +122 -0
  97. vortex/models/subscription_item_change_preview_request.py +100 -0
  98. vortex/models/subscription_item_change_request_item.py +91 -0
  99. vortex/models/tax_address.py +96 -0
  100. vortex/models/tax_behavior.py +36 -0
  101. vortex/models/tax_behavior_policy.py +100 -0
  102. vortex/models/tax_behavior_policy_request.py +89 -0
  103. vortex/models/tax_failure.py +104 -0
  104. vortex/models/tax_finalize_request.py +98 -0
  105. vortex/models/tax_jurisdiction_evidence.py +94 -0
  106. vortex/models/tax_line_evidence.py +103 -0
  107. vortex/models/tax_quote_request.py +98 -0
  108. vortex/models/terminate_applied_coupon_request.py +87 -0
  109. vortex/models/terminate_coupon_request.py +87 -0
  110. vortex/models/webhook_deliveries_dispatch_request.py +91 -0
  111. vortex/models/webhook_deliveries_redrive_request.py +107 -0
  112. vortex/models/webhook_delivery_replay_request.py +88 -0
  113. vortex/models/webhook_endpoint_create_request.py +91 -0
  114. vortex/models/webhook_endpoint_secret_rotate_request.py +87 -0
  115. vortex/models/webhook_endpoint_test_request.py +88 -0
  116. vortex/models/webhook_endpoint_update_request.py +103 -0
  117. vortex/models/webhook_event_resend_request.py +86 -0
  118. vortex/rest.py +263 -0
  119. vortex_sdk-0.2.0.dist-info/METADATA +34 -0
  120. vortex_sdk-0.2.0.dist-info/RECORD +123 -0
  121. vortex_sdk-0.2.0.dist-info/WHEEL +5 -0
  122. vortex_sdk-0.2.0.dist-info/licenses/LICENSE +21 -0
  123. vortex_sdk-0.2.0.dist-info/top_level.txt +1 -0
vortex/api/tax_api.py ADDED
@@ -0,0 +1,1397 @@
1
+ """
2
+ Vortex Payments API
3
+
4
+ Public Vortex Payments API for customers, subscriptions, invoices, payment requests, checkout, receipts, webhooks, tax.
5
+
6
+ The version of the OpenAPI document: 2026-08
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field, StrictStr
19
+ from typing import Optional
20
+ from typing_extensions import Annotated
21
+ from vortex.models.api_write_envelope import ApiWriteEnvelope
22
+ from vortex.models.merchant_tax_profile_request import MerchantTaxProfileRequest
23
+ from vortex.models.open_api_invoice_tax_response import OpenApiInvoiceTaxResponse
24
+ from vortex.models.tax_finalize_request import TaxFinalizeRequest
25
+ from vortex.models.tax_quote_request import TaxQuoteRequest
26
+
27
+ from vortex.api_client import ApiClient, RequestSerialized
28
+ from vortex.api_response import ApiResponse
29
+ from vortex.rest import RESTResponseType
30
+
31
+
32
+ class TaxApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def finalize_invoice_tax(
47
+ self,
48
+ invoice_id: StrictStr,
49
+ environment: StrictStr,
50
+ merchant_account_id: StrictStr,
51
+ tax_finalize_request: TaxFinalizeRequest,
52
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
53
+ _request_timeout: Union[
54
+ None,
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Tuple[
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Annotated[StrictFloat, Field(gt=0)]
59
+ ]
60
+ ] = None,
61
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
+ _content_type: Optional[StrictStr] = None,
63
+ _headers: Optional[Dict[StrictStr, Any]] = None,
64
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
+ ) -> OpenApiInvoiceTaxResponse:
66
+ """Finalize tax evidence for an invoice
67
+
68
+
69
+ :param invoice_id: (required)
70
+ :type invoice_id: str
71
+ :param environment: (required)
72
+ :type environment: str
73
+ :param merchant_account_id: (required)
74
+ :type merchant_account_id: str
75
+ :param tax_finalize_request: (required)
76
+ :type tax_finalize_request: TaxFinalizeRequest
77
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
78
+ :type idempotency_key: str
79
+ :param _request_timeout: timeout setting for this request. If one
80
+ number provided, it will be total request
81
+ timeout. It can also be a pair (tuple) of
82
+ (connection, read) timeouts.
83
+ :type _request_timeout: int, tuple(int, int), optional
84
+ :param _request_auth: set to override the auth_settings for an a single
85
+ request; this effectively ignores the
86
+ authentication in the spec for a single request.
87
+ :type _request_auth: dict, optional
88
+ :param _content_type: force content-type for the request.
89
+ :type _content_type: str, Optional
90
+ :param _headers: set to override the headers for a single
91
+ request; this effectively ignores the headers
92
+ in the spec for a single request.
93
+ :type _headers: dict, optional
94
+ :param _host_index: set to override the host_index for a single
95
+ request; this effectively ignores the host_index
96
+ in the spec for a single request.
97
+ :type _host_index: int, optional
98
+ :return: Returns the result object.
99
+ """ # noqa: E501
100
+
101
+ _param = self._finalize_invoice_tax_serialize(
102
+ invoice_id=invoice_id,
103
+ environment=environment,
104
+ merchant_account_id=merchant_account_id,
105
+ tax_finalize_request=tax_finalize_request,
106
+ idempotency_key=idempotency_key,
107
+ _request_auth=_request_auth,
108
+ _content_type=_content_type,
109
+ _headers=_headers,
110
+ _host_index=_host_index
111
+ )
112
+
113
+ _response_types_map: Dict[str, Optional[str]] = {
114
+ '200': "OpenApiInvoiceTaxResponse",
115
+ '400': "ApiError",
116
+ '401': "ApiError",
117
+ '409': "ApiError",
118
+ '422': "ApiError",
119
+ '429': "ApiError",
120
+ }
121
+ response_data = self.api_client.call_api(
122
+ *_param,
123
+ _request_timeout=_request_timeout
124
+ )
125
+ response_data.read()
126
+ return self.api_client.response_deserialize(
127
+ response_data=response_data,
128
+ response_types_map=_response_types_map,
129
+ ).data
130
+
131
+
132
+ @validate_call
133
+ def finalize_invoice_tax_with_http_info(
134
+ self,
135
+ invoice_id: StrictStr,
136
+ environment: StrictStr,
137
+ merchant_account_id: StrictStr,
138
+ tax_finalize_request: TaxFinalizeRequest,
139
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
140
+ _request_timeout: Union[
141
+ None,
142
+ Annotated[StrictFloat, Field(gt=0)],
143
+ Tuple[
144
+ Annotated[StrictFloat, Field(gt=0)],
145
+ Annotated[StrictFloat, Field(gt=0)]
146
+ ]
147
+ ] = None,
148
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
149
+ _content_type: Optional[StrictStr] = None,
150
+ _headers: Optional[Dict[StrictStr, Any]] = None,
151
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
152
+ ) -> ApiResponse[OpenApiInvoiceTaxResponse]:
153
+ """Finalize tax evidence for an invoice
154
+
155
+
156
+ :param invoice_id: (required)
157
+ :type invoice_id: str
158
+ :param environment: (required)
159
+ :type environment: str
160
+ :param merchant_account_id: (required)
161
+ :type merchant_account_id: str
162
+ :param tax_finalize_request: (required)
163
+ :type tax_finalize_request: TaxFinalizeRequest
164
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
165
+ :type idempotency_key: str
166
+ :param _request_timeout: timeout setting for this request. If one
167
+ number provided, it will be total request
168
+ timeout. It can also be a pair (tuple) of
169
+ (connection, read) timeouts.
170
+ :type _request_timeout: int, tuple(int, int), optional
171
+ :param _request_auth: set to override the auth_settings for an a single
172
+ request; this effectively ignores the
173
+ authentication in the spec for a single request.
174
+ :type _request_auth: dict, optional
175
+ :param _content_type: force content-type for the request.
176
+ :type _content_type: str, Optional
177
+ :param _headers: set to override the headers for a single
178
+ request; this effectively ignores the headers
179
+ in the spec for a single request.
180
+ :type _headers: dict, optional
181
+ :param _host_index: set to override the host_index for a single
182
+ request; this effectively ignores the host_index
183
+ in the spec for a single request.
184
+ :type _host_index: int, optional
185
+ :return: Returns the result object.
186
+ """ # noqa: E501
187
+
188
+ _param = self._finalize_invoice_tax_serialize(
189
+ invoice_id=invoice_id,
190
+ environment=environment,
191
+ merchant_account_id=merchant_account_id,
192
+ tax_finalize_request=tax_finalize_request,
193
+ idempotency_key=idempotency_key,
194
+ _request_auth=_request_auth,
195
+ _content_type=_content_type,
196
+ _headers=_headers,
197
+ _host_index=_host_index
198
+ )
199
+
200
+ _response_types_map: Dict[str, Optional[str]] = {
201
+ '200': "OpenApiInvoiceTaxResponse",
202
+ '400': "ApiError",
203
+ '401': "ApiError",
204
+ '409': "ApiError",
205
+ '422': "ApiError",
206
+ '429': "ApiError",
207
+ }
208
+ response_data = self.api_client.call_api(
209
+ *_param,
210
+ _request_timeout=_request_timeout
211
+ )
212
+ response_data.read()
213
+ return self.api_client.response_deserialize(
214
+ response_data=response_data,
215
+ response_types_map=_response_types_map,
216
+ )
217
+
218
+
219
+ @validate_call
220
+ def finalize_invoice_tax_without_preload_content(
221
+ self,
222
+ invoice_id: StrictStr,
223
+ environment: StrictStr,
224
+ merchant_account_id: StrictStr,
225
+ tax_finalize_request: TaxFinalizeRequest,
226
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
227
+ _request_timeout: Union[
228
+ None,
229
+ Annotated[StrictFloat, Field(gt=0)],
230
+ Tuple[
231
+ Annotated[StrictFloat, Field(gt=0)],
232
+ Annotated[StrictFloat, Field(gt=0)]
233
+ ]
234
+ ] = None,
235
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
236
+ _content_type: Optional[StrictStr] = None,
237
+ _headers: Optional[Dict[StrictStr, Any]] = None,
238
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
239
+ ) -> RESTResponseType:
240
+ """Finalize tax evidence for an invoice
241
+
242
+
243
+ :param invoice_id: (required)
244
+ :type invoice_id: str
245
+ :param environment: (required)
246
+ :type environment: str
247
+ :param merchant_account_id: (required)
248
+ :type merchant_account_id: str
249
+ :param tax_finalize_request: (required)
250
+ :type tax_finalize_request: TaxFinalizeRequest
251
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
252
+ :type idempotency_key: str
253
+ :param _request_timeout: timeout setting for this request. If one
254
+ number provided, it will be total request
255
+ timeout. It can also be a pair (tuple) of
256
+ (connection, read) timeouts.
257
+ :type _request_timeout: int, tuple(int, int), optional
258
+ :param _request_auth: set to override the auth_settings for an a single
259
+ request; this effectively ignores the
260
+ authentication in the spec for a single request.
261
+ :type _request_auth: dict, optional
262
+ :param _content_type: force content-type for the request.
263
+ :type _content_type: str, Optional
264
+ :param _headers: set to override the headers for a single
265
+ request; this effectively ignores the headers
266
+ in the spec for a single request.
267
+ :type _headers: dict, optional
268
+ :param _host_index: set to override the host_index for a single
269
+ request; this effectively ignores the host_index
270
+ in the spec for a single request.
271
+ :type _host_index: int, optional
272
+ :return: Returns the result object.
273
+ """ # noqa: E501
274
+
275
+ _param = self._finalize_invoice_tax_serialize(
276
+ invoice_id=invoice_id,
277
+ environment=environment,
278
+ merchant_account_id=merchant_account_id,
279
+ tax_finalize_request=tax_finalize_request,
280
+ idempotency_key=idempotency_key,
281
+ _request_auth=_request_auth,
282
+ _content_type=_content_type,
283
+ _headers=_headers,
284
+ _host_index=_host_index
285
+ )
286
+
287
+ _response_types_map: Dict[str, Optional[str]] = {
288
+ '200': "OpenApiInvoiceTaxResponse",
289
+ '400': "ApiError",
290
+ '401': "ApiError",
291
+ '409': "ApiError",
292
+ '422': "ApiError",
293
+ '429': "ApiError",
294
+ }
295
+ response_data = self.api_client.call_api(
296
+ *_param,
297
+ _request_timeout=_request_timeout
298
+ )
299
+ return response_data.response
300
+
301
+
302
+ def _finalize_invoice_tax_serialize(
303
+ self,
304
+ invoice_id,
305
+ environment,
306
+ merchant_account_id,
307
+ tax_finalize_request,
308
+ idempotency_key,
309
+ _request_auth,
310
+ _content_type,
311
+ _headers,
312
+ _host_index,
313
+ ) -> RequestSerialized:
314
+
315
+ _host = None
316
+
317
+ _collection_formats: Dict[str, str] = {
318
+ }
319
+
320
+ _path_params: Dict[str, str] = {}
321
+ _query_params: List[Tuple[str, str]] = []
322
+ _header_params: Dict[str, Optional[str]] = _headers or {}
323
+ _form_params: List[Tuple[str, str]] = []
324
+ _files: Dict[
325
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
326
+ ] = {}
327
+ _body_params: Optional[bytes] = None
328
+
329
+ # process the path parameters
330
+ if invoice_id is not None:
331
+ _path_params['invoiceId'] = invoice_id
332
+ # process the query parameters
333
+ if environment is not None:
334
+
335
+ _query_params.append(('environment', environment))
336
+
337
+ if merchant_account_id is not None:
338
+
339
+ _query_params.append(('merchantAccountId', merchant_account_id))
340
+
341
+ # process the header parameters
342
+ if idempotency_key is not None:
343
+ _header_params['Idempotency-Key'] = idempotency_key
344
+ # process the form parameters
345
+ # process the body parameter
346
+ if tax_finalize_request is not None:
347
+ _body_params = tax_finalize_request
348
+
349
+
350
+ # set the HTTP header `Accept`
351
+ if 'Accept' not in _header_params:
352
+ _header_params['Accept'] = self.api_client.select_header_accept(
353
+ [
354
+ 'application/json'
355
+ ]
356
+ )
357
+
358
+ # set the HTTP header `Content-Type`
359
+ if _content_type:
360
+ _header_params['Content-Type'] = _content_type
361
+ else:
362
+ _default_content_type = (
363
+ self.api_client.select_header_content_type(
364
+ [
365
+ 'application/json'
366
+ ]
367
+ )
368
+ )
369
+ if _default_content_type is not None:
370
+ _header_params['Content-Type'] = _default_content_type
371
+
372
+ # authentication setting
373
+ _auth_settings: List[str] = [
374
+ 'api-key'
375
+ ]
376
+
377
+ return self.api_client.param_serialize(
378
+ method='POST',
379
+ resource_path='/v1/invoices/{invoiceId}/tax/finalize',
380
+ path_params=_path_params,
381
+ query_params=_query_params,
382
+ header_params=_header_params,
383
+ body=_body_params,
384
+ post_params=_form_params,
385
+ files=_files,
386
+ auth_settings=_auth_settings,
387
+ collection_formats=_collection_formats,
388
+ _host=_host,
389
+ _request_auth=_request_auth
390
+ )
391
+
392
+
393
+
394
+
395
+ @validate_call
396
+ def get_merchant_account_tax_profile(
397
+ self,
398
+ merchant_account_id: StrictStr,
399
+ environment: StrictStr,
400
+ merchant_account_id2: StrictStr,
401
+ _request_timeout: Union[
402
+ None,
403
+ Annotated[StrictFloat, Field(gt=0)],
404
+ Tuple[
405
+ Annotated[StrictFloat, Field(gt=0)],
406
+ Annotated[StrictFloat, Field(gt=0)]
407
+ ]
408
+ ] = None,
409
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
410
+ _content_type: Optional[StrictStr] = None,
411
+ _headers: Optional[Dict[StrictStr, Any]] = None,
412
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
413
+ ) -> ApiWriteEnvelope:
414
+ """Get merchant tax profile
415
+
416
+
417
+ :param merchant_account_id: (required)
418
+ :type merchant_account_id: str
419
+ :param environment: (required)
420
+ :type environment: str
421
+ :param merchant_account_id2: (required)
422
+ :type merchant_account_id2: str
423
+ :param _request_timeout: timeout setting for this request. If one
424
+ number provided, it will be total request
425
+ timeout. It can also be a pair (tuple) of
426
+ (connection, read) timeouts.
427
+ :type _request_timeout: int, tuple(int, int), optional
428
+ :param _request_auth: set to override the auth_settings for an a single
429
+ request; this effectively ignores the
430
+ authentication in the spec for a single request.
431
+ :type _request_auth: dict, optional
432
+ :param _content_type: force content-type for the request.
433
+ :type _content_type: str, Optional
434
+ :param _headers: set to override the headers for a single
435
+ request; this effectively ignores the headers
436
+ in the spec for a single request.
437
+ :type _headers: dict, optional
438
+ :param _host_index: set to override the host_index for a single
439
+ request; this effectively ignores the host_index
440
+ in the spec for a single request.
441
+ :type _host_index: int, optional
442
+ :return: Returns the result object.
443
+ """ # noqa: E501
444
+
445
+ _param = self._get_merchant_account_tax_profile_serialize(
446
+ merchant_account_id=merchant_account_id,
447
+ environment=environment,
448
+ merchant_account_id2=merchant_account_id2,
449
+ _request_auth=_request_auth,
450
+ _content_type=_content_type,
451
+ _headers=_headers,
452
+ _host_index=_host_index
453
+ )
454
+
455
+ _response_types_map: Dict[str, Optional[str]] = {
456
+ '200': "ApiWriteEnvelope",
457
+ '400': "ApiError",
458
+ '401': "ApiError",
459
+ '409': "ApiError",
460
+ '422': "ApiError",
461
+ '429': "ApiError",
462
+ }
463
+ response_data = self.api_client.call_api(
464
+ *_param,
465
+ _request_timeout=_request_timeout
466
+ )
467
+ response_data.read()
468
+ return self.api_client.response_deserialize(
469
+ response_data=response_data,
470
+ response_types_map=_response_types_map,
471
+ ).data
472
+
473
+
474
+ @validate_call
475
+ def get_merchant_account_tax_profile_with_http_info(
476
+ self,
477
+ merchant_account_id: StrictStr,
478
+ environment: StrictStr,
479
+ merchant_account_id2: StrictStr,
480
+ _request_timeout: Union[
481
+ None,
482
+ Annotated[StrictFloat, Field(gt=0)],
483
+ Tuple[
484
+ Annotated[StrictFloat, Field(gt=0)],
485
+ Annotated[StrictFloat, Field(gt=0)]
486
+ ]
487
+ ] = None,
488
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
489
+ _content_type: Optional[StrictStr] = None,
490
+ _headers: Optional[Dict[StrictStr, Any]] = None,
491
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
492
+ ) -> ApiResponse[ApiWriteEnvelope]:
493
+ """Get merchant tax profile
494
+
495
+
496
+ :param merchant_account_id: (required)
497
+ :type merchant_account_id: str
498
+ :param environment: (required)
499
+ :type environment: str
500
+ :param merchant_account_id2: (required)
501
+ :type merchant_account_id2: str
502
+ :param _request_timeout: timeout setting for this request. If one
503
+ number provided, it will be total request
504
+ timeout. It can also be a pair (tuple) of
505
+ (connection, read) timeouts.
506
+ :type _request_timeout: int, tuple(int, int), optional
507
+ :param _request_auth: set to override the auth_settings for an a single
508
+ request; this effectively ignores the
509
+ authentication in the spec for a single request.
510
+ :type _request_auth: dict, optional
511
+ :param _content_type: force content-type for the request.
512
+ :type _content_type: str, Optional
513
+ :param _headers: set to override the headers for a single
514
+ request; this effectively ignores the headers
515
+ in the spec for a single request.
516
+ :type _headers: dict, optional
517
+ :param _host_index: set to override the host_index for a single
518
+ request; this effectively ignores the host_index
519
+ in the spec for a single request.
520
+ :type _host_index: int, optional
521
+ :return: Returns the result object.
522
+ """ # noqa: E501
523
+
524
+ _param = self._get_merchant_account_tax_profile_serialize(
525
+ merchant_account_id=merchant_account_id,
526
+ environment=environment,
527
+ merchant_account_id2=merchant_account_id2,
528
+ _request_auth=_request_auth,
529
+ _content_type=_content_type,
530
+ _headers=_headers,
531
+ _host_index=_host_index
532
+ )
533
+
534
+ _response_types_map: Dict[str, Optional[str]] = {
535
+ '200': "ApiWriteEnvelope",
536
+ '400': "ApiError",
537
+ '401': "ApiError",
538
+ '409': "ApiError",
539
+ '422': "ApiError",
540
+ '429': "ApiError",
541
+ }
542
+ response_data = self.api_client.call_api(
543
+ *_param,
544
+ _request_timeout=_request_timeout
545
+ )
546
+ response_data.read()
547
+ return self.api_client.response_deserialize(
548
+ response_data=response_data,
549
+ response_types_map=_response_types_map,
550
+ )
551
+
552
+
553
+ @validate_call
554
+ def get_merchant_account_tax_profile_without_preload_content(
555
+ self,
556
+ merchant_account_id: StrictStr,
557
+ environment: StrictStr,
558
+ merchant_account_id2: StrictStr,
559
+ _request_timeout: Union[
560
+ None,
561
+ Annotated[StrictFloat, Field(gt=0)],
562
+ Tuple[
563
+ Annotated[StrictFloat, Field(gt=0)],
564
+ Annotated[StrictFloat, Field(gt=0)]
565
+ ]
566
+ ] = None,
567
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
568
+ _content_type: Optional[StrictStr] = None,
569
+ _headers: Optional[Dict[StrictStr, Any]] = None,
570
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
571
+ ) -> RESTResponseType:
572
+ """Get merchant tax profile
573
+
574
+
575
+ :param merchant_account_id: (required)
576
+ :type merchant_account_id: str
577
+ :param environment: (required)
578
+ :type environment: str
579
+ :param merchant_account_id2: (required)
580
+ :type merchant_account_id2: str
581
+ :param _request_timeout: timeout setting for this request. If one
582
+ number provided, it will be total request
583
+ timeout. It can also be a pair (tuple) of
584
+ (connection, read) timeouts.
585
+ :type _request_timeout: int, tuple(int, int), optional
586
+ :param _request_auth: set to override the auth_settings for an a single
587
+ request; this effectively ignores the
588
+ authentication in the spec for a single request.
589
+ :type _request_auth: dict, optional
590
+ :param _content_type: force content-type for the request.
591
+ :type _content_type: str, Optional
592
+ :param _headers: set to override the headers for a single
593
+ request; this effectively ignores the headers
594
+ in the spec for a single request.
595
+ :type _headers: dict, optional
596
+ :param _host_index: set to override the host_index for a single
597
+ request; this effectively ignores the host_index
598
+ in the spec for a single request.
599
+ :type _host_index: int, optional
600
+ :return: Returns the result object.
601
+ """ # noqa: E501
602
+
603
+ _param = self._get_merchant_account_tax_profile_serialize(
604
+ merchant_account_id=merchant_account_id,
605
+ environment=environment,
606
+ merchant_account_id2=merchant_account_id2,
607
+ _request_auth=_request_auth,
608
+ _content_type=_content_type,
609
+ _headers=_headers,
610
+ _host_index=_host_index
611
+ )
612
+
613
+ _response_types_map: Dict[str, Optional[str]] = {
614
+ '200': "ApiWriteEnvelope",
615
+ '400': "ApiError",
616
+ '401': "ApiError",
617
+ '409': "ApiError",
618
+ '422': "ApiError",
619
+ '429': "ApiError",
620
+ }
621
+ response_data = self.api_client.call_api(
622
+ *_param,
623
+ _request_timeout=_request_timeout
624
+ )
625
+ return response_data.response
626
+
627
+
628
+ def _get_merchant_account_tax_profile_serialize(
629
+ self,
630
+ merchant_account_id,
631
+ environment,
632
+ merchant_account_id2,
633
+ _request_auth,
634
+ _content_type,
635
+ _headers,
636
+ _host_index,
637
+ ) -> RequestSerialized:
638
+
639
+ _host = None
640
+
641
+ _collection_formats: Dict[str, str] = {
642
+ }
643
+
644
+ _path_params: Dict[str, str] = {}
645
+ _query_params: List[Tuple[str, str]] = []
646
+ _header_params: Dict[str, Optional[str]] = _headers or {}
647
+ _form_params: List[Tuple[str, str]] = []
648
+ _files: Dict[
649
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
650
+ ] = {}
651
+ _body_params: Optional[bytes] = None
652
+
653
+ # process the path parameters
654
+ if merchant_account_id is not None:
655
+ _path_params['merchantAccountId'] = merchant_account_id
656
+ # process the query parameters
657
+ if environment is not None:
658
+
659
+ _query_params.append(('environment', environment))
660
+
661
+ if merchant_account_id2 is not None:
662
+
663
+ _query_params.append(('merchantAccountId', merchant_account_id2))
664
+
665
+ # process the header parameters
666
+ # process the form parameters
667
+ # process the body parameter
668
+
669
+
670
+ # set the HTTP header `Accept`
671
+ if 'Accept' not in _header_params:
672
+ _header_params['Accept'] = self.api_client.select_header_accept(
673
+ [
674
+ 'application/json'
675
+ ]
676
+ )
677
+
678
+
679
+ # authentication setting
680
+ _auth_settings: List[str] = [
681
+ 'api-key'
682
+ ]
683
+
684
+ return self.api_client.param_serialize(
685
+ method='GET',
686
+ resource_path='/v1/merchant-accounts/{merchantAccountId}/tax-profile',
687
+ path_params=_path_params,
688
+ query_params=_query_params,
689
+ header_params=_header_params,
690
+ body=_body_params,
691
+ post_params=_form_params,
692
+ files=_files,
693
+ auth_settings=_auth_settings,
694
+ collection_formats=_collection_formats,
695
+ _host=_host,
696
+ _request_auth=_request_auth
697
+ )
698
+
699
+
700
+
701
+
702
+ @validate_call
703
+ def quote_invoice_tax(
704
+ self,
705
+ invoice_id: StrictStr,
706
+ environment: StrictStr,
707
+ merchant_account_id: StrictStr,
708
+ tax_quote_request: TaxQuoteRequest,
709
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
710
+ _request_timeout: Union[
711
+ None,
712
+ Annotated[StrictFloat, Field(gt=0)],
713
+ Tuple[
714
+ Annotated[StrictFloat, Field(gt=0)],
715
+ Annotated[StrictFloat, Field(gt=0)]
716
+ ]
717
+ ] = None,
718
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
719
+ _content_type: Optional[StrictStr] = None,
720
+ _headers: Optional[Dict[StrictStr, Any]] = None,
721
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
722
+ ) -> OpenApiInvoiceTaxResponse:
723
+ """Quote tax for a draft invoice
724
+
725
+
726
+ :param invoice_id: (required)
727
+ :type invoice_id: str
728
+ :param environment: (required)
729
+ :type environment: str
730
+ :param merchant_account_id: (required)
731
+ :type merchant_account_id: str
732
+ :param tax_quote_request: (required)
733
+ :type tax_quote_request: TaxQuoteRequest
734
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
735
+ :type idempotency_key: str
736
+ :param _request_timeout: timeout setting for this request. If one
737
+ number provided, it will be total request
738
+ timeout. It can also be a pair (tuple) of
739
+ (connection, read) timeouts.
740
+ :type _request_timeout: int, tuple(int, int), optional
741
+ :param _request_auth: set to override the auth_settings for an a single
742
+ request; this effectively ignores the
743
+ authentication in the spec for a single request.
744
+ :type _request_auth: dict, optional
745
+ :param _content_type: force content-type for the request.
746
+ :type _content_type: str, Optional
747
+ :param _headers: set to override the headers for a single
748
+ request; this effectively ignores the headers
749
+ in the spec for a single request.
750
+ :type _headers: dict, optional
751
+ :param _host_index: set to override the host_index for a single
752
+ request; this effectively ignores the host_index
753
+ in the spec for a single request.
754
+ :type _host_index: int, optional
755
+ :return: Returns the result object.
756
+ """ # noqa: E501
757
+
758
+ _param = self._quote_invoice_tax_serialize(
759
+ invoice_id=invoice_id,
760
+ environment=environment,
761
+ merchant_account_id=merchant_account_id,
762
+ tax_quote_request=tax_quote_request,
763
+ idempotency_key=idempotency_key,
764
+ _request_auth=_request_auth,
765
+ _content_type=_content_type,
766
+ _headers=_headers,
767
+ _host_index=_host_index
768
+ )
769
+
770
+ _response_types_map: Dict[str, Optional[str]] = {
771
+ '200': "OpenApiInvoiceTaxResponse",
772
+ '400': "ApiError",
773
+ '401': "ApiError",
774
+ '409': "ApiError",
775
+ '422': "ApiError",
776
+ '429': "ApiError",
777
+ }
778
+ response_data = self.api_client.call_api(
779
+ *_param,
780
+ _request_timeout=_request_timeout
781
+ )
782
+ response_data.read()
783
+ return self.api_client.response_deserialize(
784
+ response_data=response_data,
785
+ response_types_map=_response_types_map,
786
+ ).data
787
+
788
+
789
+ @validate_call
790
+ def quote_invoice_tax_with_http_info(
791
+ self,
792
+ invoice_id: StrictStr,
793
+ environment: StrictStr,
794
+ merchant_account_id: StrictStr,
795
+ tax_quote_request: TaxQuoteRequest,
796
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
797
+ _request_timeout: Union[
798
+ None,
799
+ Annotated[StrictFloat, Field(gt=0)],
800
+ Tuple[
801
+ Annotated[StrictFloat, Field(gt=0)],
802
+ Annotated[StrictFloat, Field(gt=0)]
803
+ ]
804
+ ] = None,
805
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
806
+ _content_type: Optional[StrictStr] = None,
807
+ _headers: Optional[Dict[StrictStr, Any]] = None,
808
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
809
+ ) -> ApiResponse[OpenApiInvoiceTaxResponse]:
810
+ """Quote tax for a draft invoice
811
+
812
+
813
+ :param invoice_id: (required)
814
+ :type invoice_id: str
815
+ :param environment: (required)
816
+ :type environment: str
817
+ :param merchant_account_id: (required)
818
+ :type merchant_account_id: str
819
+ :param tax_quote_request: (required)
820
+ :type tax_quote_request: TaxQuoteRequest
821
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
822
+ :type idempotency_key: str
823
+ :param _request_timeout: timeout setting for this request. If one
824
+ number provided, it will be total request
825
+ timeout. It can also be a pair (tuple) of
826
+ (connection, read) timeouts.
827
+ :type _request_timeout: int, tuple(int, int), optional
828
+ :param _request_auth: set to override the auth_settings for an a single
829
+ request; this effectively ignores the
830
+ authentication in the spec for a single request.
831
+ :type _request_auth: dict, optional
832
+ :param _content_type: force content-type for the request.
833
+ :type _content_type: str, Optional
834
+ :param _headers: set to override the headers for a single
835
+ request; this effectively ignores the headers
836
+ in the spec for a single request.
837
+ :type _headers: dict, optional
838
+ :param _host_index: set to override the host_index for a single
839
+ request; this effectively ignores the host_index
840
+ in the spec for a single request.
841
+ :type _host_index: int, optional
842
+ :return: Returns the result object.
843
+ """ # noqa: E501
844
+
845
+ _param = self._quote_invoice_tax_serialize(
846
+ invoice_id=invoice_id,
847
+ environment=environment,
848
+ merchant_account_id=merchant_account_id,
849
+ tax_quote_request=tax_quote_request,
850
+ idempotency_key=idempotency_key,
851
+ _request_auth=_request_auth,
852
+ _content_type=_content_type,
853
+ _headers=_headers,
854
+ _host_index=_host_index
855
+ )
856
+
857
+ _response_types_map: Dict[str, Optional[str]] = {
858
+ '200': "OpenApiInvoiceTaxResponse",
859
+ '400': "ApiError",
860
+ '401': "ApiError",
861
+ '409': "ApiError",
862
+ '422': "ApiError",
863
+ '429': "ApiError",
864
+ }
865
+ response_data = self.api_client.call_api(
866
+ *_param,
867
+ _request_timeout=_request_timeout
868
+ )
869
+ response_data.read()
870
+ return self.api_client.response_deserialize(
871
+ response_data=response_data,
872
+ response_types_map=_response_types_map,
873
+ )
874
+
875
+
876
+ @validate_call
877
+ def quote_invoice_tax_without_preload_content(
878
+ self,
879
+ invoice_id: StrictStr,
880
+ environment: StrictStr,
881
+ merchant_account_id: StrictStr,
882
+ tax_quote_request: TaxQuoteRequest,
883
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
884
+ _request_timeout: Union[
885
+ None,
886
+ Annotated[StrictFloat, Field(gt=0)],
887
+ Tuple[
888
+ Annotated[StrictFloat, Field(gt=0)],
889
+ Annotated[StrictFloat, Field(gt=0)]
890
+ ]
891
+ ] = None,
892
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
893
+ _content_type: Optional[StrictStr] = None,
894
+ _headers: Optional[Dict[StrictStr, Any]] = None,
895
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
896
+ ) -> RESTResponseType:
897
+ """Quote tax for a draft invoice
898
+
899
+
900
+ :param invoice_id: (required)
901
+ :type invoice_id: str
902
+ :param environment: (required)
903
+ :type environment: str
904
+ :param merchant_account_id: (required)
905
+ :type merchant_account_id: str
906
+ :param tax_quote_request: (required)
907
+ :type tax_quote_request: TaxQuoteRequest
908
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
909
+ :type idempotency_key: str
910
+ :param _request_timeout: timeout setting for this request. If one
911
+ number provided, it will be total request
912
+ timeout. It can also be a pair (tuple) of
913
+ (connection, read) timeouts.
914
+ :type _request_timeout: int, tuple(int, int), optional
915
+ :param _request_auth: set to override the auth_settings for an a single
916
+ request; this effectively ignores the
917
+ authentication in the spec for a single request.
918
+ :type _request_auth: dict, optional
919
+ :param _content_type: force content-type for the request.
920
+ :type _content_type: str, Optional
921
+ :param _headers: set to override the headers for a single
922
+ request; this effectively ignores the headers
923
+ in the spec for a single request.
924
+ :type _headers: dict, optional
925
+ :param _host_index: set to override the host_index for a single
926
+ request; this effectively ignores the host_index
927
+ in the spec for a single request.
928
+ :type _host_index: int, optional
929
+ :return: Returns the result object.
930
+ """ # noqa: E501
931
+
932
+ _param = self._quote_invoice_tax_serialize(
933
+ invoice_id=invoice_id,
934
+ environment=environment,
935
+ merchant_account_id=merchant_account_id,
936
+ tax_quote_request=tax_quote_request,
937
+ idempotency_key=idempotency_key,
938
+ _request_auth=_request_auth,
939
+ _content_type=_content_type,
940
+ _headers=_headers,
941
+ _host_index=_host_index
942
+ )
943
+
944
+ _response_types_map: Dict[str, Optional[str]] = {
945
+ '200': "OpenApiInvoiceTaxResponse",
946
+ '400': "ApiError",
947
+ '401': "ApiError",
948
+ '409': "ApiError",
949
+ '422': "ApiError",
950
+ '429': "ApiError",
951
+ }
952
+ response_data = self.api_client.call_api(
953
+ *_param,
954
+ _request_timeout=_request_timeout
955
+ )
956
+ return response_data.response
957
+
958
+
959
+ def _quote_invoice_tax_serialize(
960
+ self,
961
+ invoice_id,
962
+ environment,
963
+ merchant_account_id,
964
+ tax_quote_request,
965
+ idempotency_key,
966
+ _request_auth,
967
+ _content_type,
968
+ _headers,
969
+ _host_index,
970
+ ) -> RequestSerialized:
971
+
972
+ _host = None
973
+
974
+ _collection_formats: Dict[str, str] = {
975
+ }
976
+
977
+ _path_params: Dict[str, str] = {}
978
+ _query_params: List[Tuple[str, str]] = []
979
+ _header_params: Dict[str, Optional[str]] = _headers or {}
980
+ _form_params: List[Tuple[str, str]] = []
981
+ _files: Dict[
982
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
983
+ ] = {}
984
+ _body_params: Optional[bytes] = None
985
+
986
+ # process the path parameters
987
+ if invoice_id is not None:
988
+ _path_params['invoiceId'] = invoice_id
989
+ # process the query parameters
990
+ if environment is not None:
991
+
992
+ _query_params.append(('environment', environment))
993
+
994
+ if merchant_account_id is not None:
995
+
996
+ _query_params.append(('merchantAccountId', merchant_account_id))
997
+
998
+ # process the header parameters
999
+ if idempotency_key is not None:
1000
+ _header_params['Idempotency-Key'] = idempotency_key
1001
+ # process the form parameters
1002
+ # process the body parameter
1003
+ if tax_quote_request is not None:
1004
+ _body_params = tax_quote_request
1005
+
1006
+
1007
+ # set the HTTP header `Accept`
1008
+ if 'Accept' not in _header_params:
1009
+ _header_params['Accept'] = self.api_client.select_header_accept(
1010
+ [
1011
+ 'application/json'
1012
+ ]
1013
+ )
1014
+
1015
+ # set the HTTP header `Content-Type`
1016
+ if _content_type:
1017
+ _header_params['Content-Type'] = _content_type
1018
+ else:
1019
+ _default_content_type = (
1020
+ self.api_client.select_header_content_type(
1021
+ [
1022
+ 'application/json'
1023
+ ]
1024
+ )
1025
+ )
1026
+ if _default_content_type is not None:
1027
+ _header_params['Content-Type'] = _default_content_type
1028
+
1029
+ # authentication setting
1030
+ _auth_settings: List[str] = [
1031
+ 'api-key'
1032
+ ]
1033
+
1034
+ return self.api_client.param_serialize(
1035
+ method='POST',
1036
+ resource_path='/v1/invoices/{invoiceId}/tax/quote',
1037
+ path_params=_path_params,
1038
+ query_params=_query_params,
1039
+ header_params=_header_params,
1040
+ body=_body_params,
1041
+ post_params=_form_params,
1042
+ files=_files,
1043
+ auth_settings=_auth_settings,
1044
+ collection_formats=_collection_formats,
1045
+ _host=_host,
1046
+ _request_auth=_request_auth
1047
+ )
1048
+
1049
+
1050
+
1051
+
1052
+ @validate_call
1053
+ def upsert_merchant_account_tax_profile(
1054
+ self,
1055
+ merchant_account_id: StrictStr,
1056
+ environment: StrictStr,
1057
+ merchant_account_id2: StrictStr,
1058
+ merchant_tax_profile_request: MerchantTaxProfileRequest,
1059
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
1060
+ _request_timeout: Union[
1061
+ None,
1062
+ Annotated[StrictFloat, Field(gt=0)],
1063
+ Tuple[
1064
+ Annotated[StrictFloat, Field(gt=0)],
1065
+ Annotated[StrictFloat, Field(gt=0)]
1066
+ ]
1067
+ ] = None,
1068
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1069
+ _content_type: Optional[StrictStr] = None,
1070
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1071
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1072
+ ) -> ApiWriteEnvelope:
1073
+ """Create or update merchant tax profile
1074
+
1075
+
1076
+ :param merchant_account_id: (required)
1077
+ :type merchant_account_id: str
1078
+ :param environment: (required)
1079
+ :type environment: str
1080
+ :param merchant_account_id2: (required)
1081
+ :type merchant_account_id2: str
1082
+ :param merchant_tax_profile_request: (required)
1083
+ :type merchant_tax_profile_request: MerchantTaxProfileRequest
1084
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
1085
+ :type idempotency_key: str
1086
+ :param _request_timeout: timeout setting for this request. If one
1087
+ number provided, it will be total request
1088
+ timeout. It can also be a pair (tuple) of
1089
+ (connection, read) timeouts.
1090
+ :type _request_timeout: int, tuple(int, int), optional
1091
+ :param _request_auth: set to override the auth_settings for an a single
1092
+ request; this effectively ignores the
1093
+ authentication in the spec for a single request.
1094
+ :type _request_auth: dict, optional
1095
+ :param _content_type: force content-type for the request.
1096
+ :type _content_type: str, Optional
1097
+ :param _headers: set to override the headers for a single
1098
+ request; this effectively ignores the headers
1099
+ in the spec for a single request.
1100
+ :type _headers: dict, optional
1101
+ :param _host_index: set to override the host_index for a single
1102
+ request; this effectively ignores the host_index
1103
+ in the spec for a single request.
1104
+ :type _host_index: int, optional
1105
+ :return: Returns the result object.
1106
+ """ # noqa: E501
1107
+
1108
+ _param = self._upsert_merchant_account_tax_profile_serialize(
1109
+ merchant_account_id=merchant_account_id,
1110
+ environment=environment,
1111
+ merchant_account_id2=merchant_account_id2,
1112
+ merchant_tax_profile_request=merchant_tax_profile_request,
1113
+ idempotency_key=idempotency_key,
1114
+ _request_auth=_request_auth,
1115
+ _content_type=_content_type,
1116
+ _headers=_headers,
1117
+ _host_index=_host_index
1118
+ )
1119
+
1120
+ _response_types_map: Dict[str, Optional[str]] = {
1121
+ '200': "ApiWriteEnvelope",
1122
+ '400': "ApiError",
1123
+ '401': "ApiError",
1124
+ '409': "ApiError",
1125
+ '422': "ApiError",
1126
+ '429': "ApiError",
1127
+ }
1128
+ response_data = self.api_client.call_api(
1129
+ *_param,
1130
+ _request_timeout=_request_timeout
1131
+ )
1132
+ response_data.read()
1133
+ return self.api_client.response_deserialize(
1134
+ response_data=response_data,
1135
+ response_types_map=_response_types_map,
1136
+ ).data
1137
+
1138
+
1139
+ @validate_call
1140
+ def upsert_merchant_account_tax_profile_with_http_info(
1141
+ self,
1142
+ merchant_account_id: StrictStr,
1143
+ environment: StrictStr,
1144
+ merchant_account_id2: StrictStr,
1145
+ merchant_tax_profile_request: MerchantTaxProfileRequest,
1146
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
1147
+ _request_timeout: Union[
1148
+ None,
1149
+ Annotated[StrictFloat, Field(gt=0)],
1150
+ Tuple[
1151
+ Annotated[StrictFloat, Field(gt=0)],
1152
+ Annotated[StrictFloat, Field(gt=0)]
1153
+ ]
1154
+ ] = None,
1155
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1156
+ _content_type: Optional[StrictStr] = None,
1157
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1158
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1159
+ ) -> ApiResponse[ApiWriteEnvelope]:
1160
+ """Create or update merchant tax profile
1161
+
1162
+
1163
+ :param merchant_account_id: (required)
1164
+ :type merchant_account_id: str
1165
+ :param environment: (required)
1166
+ :type environment: str
1167
+ :param merchant_account_id2: (required)
1168
+ :type merchant_account_id2: str
1169
+ :param merchant_tax_profile_request: (required)
1170
+ :type merchant_tax_profile_request: MerchantTaxProfileRequest
1171
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
1172
+ :type idempotency_key: str
1173
+ :param _request_timeout: timeout setting for this request. If one
1174
+ number provided, it will be total request
1175
+ timeout. It can also be a pair (tuple) of
1176
+ (connection, read) timeouts.
1177
+ :type _request_timeout: int, tuple(int, int), optional
1178
+ :param _request_auth: set to override the auth_settings for an a single
1179
+ request; this effectively ignores the
1180
+ authentication in the spec for a single request.
1181
+ :type _request_auth: dict, optional
1182
+ :param _content_type: force content-type for the request.
1183
+ :type _content_type: str, Optional
1184
+ :param _headers: set to override the headers for a single
1185
+ request; this effectively ignores the headers
1186
+ in the spec for a single request.
1187
+ :type _headers: dict, optional
1188
+ :param _host_index: set to override the host_index for a single
1189
+ request; this effectively ignores the host_index
1190
+ in the spec for a single request.
1191
+ :type _host_index: int, optional
1192
+ :return: Returns the result object.
1193
+ """ # noqa: E501
1194
+
1195
+ _param = self._upsert_merchant_account_tax_profile_serialize(
1196
+ merchant_account_id=merchant_account_id,
1197
+ environment=environment,
1198
+ merchant_account_id2=merchant_account_id2,
1199
+ merchant_tax_profile_request=merchant_tax_profile_request,
1200
+ idempotency_key=idempotency_key,
1201
+ _request_auth=_request_auth,
1202
+ _content_type=_content_type,
1203
+ _headers=_headers,
1204
+ _host_index=_host_index
1205
+ )
1206
+
1207
+ _response_types_map: Dict[str, Optional[str]] = {
1208
+ '200': "ApiWriteEnvelope",
1209
+ '400': "ApiError",
1210
+ '401': "ApiError",
1211
+ '409': "ApiError",
1212
+ '422': "ApiError",
1213
+ '429': "ApiError",
1214
+ }
1215
+ response_data = self.api_client.call_api(
1216
+ *_param,
1217
+ _request_timeout=_request_timeout
1218
+ )
1219
+ response_data.read()
1220
+ return self.api_client.response_deserialize(
1221
+ response_data=response_data,
1222
+ response_types_map=_response_types_map,
1223
+ )
1224
+
1225
+
1226
+ @validate_call
1227
+ def upsert_merchant_account_tax_profile_without_preload_content(
1228
+ self,
1229
+ merchant_account_id: StrictStr,
1230
+ environment: StrictStr,
1231
+ merchant_account_id2: StrictStr,
1232
+ merchant_tax_profile_request: MerchantTaxProfileRequest,
1233
+ idempotency_key: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.")] = None,
1234
+ _request_timeout: Union[
1235
+ None,
1236
+ Annotated[StrictFloat, Field(gt=0)],
1237
+ Tuple[
1238
+ Annotated[StrictFloat, Field(gt=0)],
1239
+ Annotated[StrictFloat, Field(gt=0)]
1240
+ ]
1241
+ ] = None,
1242
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1243
+ _content_type: Optional[StrictStr] = None,
1244
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1245
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1246
+ ) -> RESTResponseType:
1247
+ """Create or update merchant tax profile
1248
+
1249
+
1250
+ :param merchant_account_id: (required)
1251
+ :type merchant_account_id: str
1252
+ :param environment: (required)
1253
+ :type environment: str
1254
+ :param merchant_account_id2: (required)
1255
+ :type merchant_account_id2: str
1256
+ :param merchant_tax_profile_request: (required)
1257
+ :type merchant_tax_profile_request: MerchantTaxProfileRequest
1258
+ :param idempotency_key: Required for production-safe retries on mutating routes. Reusing a key with a different request body returns 409.
1259
+ :type idempotency_key: str
1260
+ :param _request_timeout: timeout setting for this request. If one
1261
+ number provided, it will be total request
1262
+ timeout. It can also be a pair (tuple) of
1263
+ (connection, read) timeouts.
1264
+ :type _request_timeout: int, tuple(int, int), optional
1265
+ :param _request_auth: set to override the auth_settings for an a single
1266
+ request; this effectively ignores the
1267
+ authentication in the spec for a single request.
1268
+ :type _request_auth: dict, optional
1269
+ :param _content_type: force content-type for the request.
1270
+ :type _content_type: str, Optional
1271
+ :param _headers: set to override the headers for a single
1272
+ request; this effectively ignores the headers
1273
+ in the spec for a single request.
1274
+ :type _headers: dict, optional
1275
+ :param _host_index: set to override the host_index for a single
1276
+ request; this effectively ignores the host_index
1277
+ in the spec for a single request.
1278
+ :type _host_index: int, optional
1279
+ :return: Returns the result object.
1280
+ """ # noqa: E501
1281
+
1282
+ _param = self._upsert_merchant_account_tax_profile_serialize(
1283
+ merchant_account_id=merchant_account_id,
1284
+ environment=environment,
1285
+ merchant_account_id2=merchant_account_id2,
1286
+ merchant_tax_profile_request=merchant_tax_profile_request,
1287
+ idempotency_key=idempotency_key,
1288
+ _request_auth=_request_auth,
1289
+ _content_type=_content_type,
1290
+ _headers=_headers,
1291
+ _host_index=_host_index
1292
+ )
1293
+
1294
+ _response_types_map: Dict[str, Optional[str]] = {
1295
+ '200': "ApiWriteEnvelope",
1296
+ '400': "ApiError",
1297
+ '401': "ApiError",
1298
+ '409': "ApiError",
1299
+ '422': "ApiError",
1300
+ '429': "ApiError",
1301
+ }
1302
+ response_data = self.api_client.call_api(
1303
+ *_param,
1304
+ _request_timeout=_request_timeout
1305
+ )
1306
+ return response_data.response
1307
+
1308
+
1309
+ def _upsert_merchant_account_tax_profile_serialize(
1310
+ self,
1311
+ merchant_account_id,
1312
+ environment,
1313
+ merchant_account_id2,
1314
+ merchant_tax_profile_request,
1315
+ idempotency_key,
1316
+ _request_auth,
1317
+ _content_type,
1318
+ _headers,
1319
+ _host_index,
1320
+ ) -> RequestSerialized:
1321
+
1322
+ _host = None
1323
+
1324
+ _collection_formats: Dict[str, str] = {
1325
+ }
1326
+
1327
+ _path_params: Dict[str, str] = {}
1328
+ _query_params: List[Tuple[str, str]] = []
1329
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1330
+ _form_params: List[Tuple[str, str]] = []
1331
+ _files: Dict[
1332
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1333
+ ] = {}
1334
+ _body_params: Optional[bytes] = None
1335
+
1336
+ # process the path parameters
1337
+ if merchant_account_id is not None:
1338
+ _path_params['merchantAccountId'] = merchant_account_id
1339
+ # process the query parameters
1340
+ if environment is not None:
1341
+
1342
+ _query_params.append(('environment', environment))
1343
+
1344
+ if merchant_account_id2 is not None:
1345
+
1346
+ _query_params.append(('merchantAccountId', merchant_account_id2))
1347
+
1348
+ # process the header parameters
1349
+ if idempotency_key is not None:
1350
+ _header_params['Idempotency-Key'] = idempotency_key
1351
+ # process the form parameters
1352
+ # process the body parameter
1353
+ if merchant_tax_profile_request is not None:
1354
+ _body_params = merchant_tax_profile_request
1355
+
1356
+
1357
+ # set the HTTP header `Accept`
1358
+ if 'Accept' not in _header_params:
1359
+ _header_params['Accept'] = self.api_client.select_header_accept(
1360
+ [
1361
+ 'application/json'
1362
+ ]
1363
+ )
1364
+
1365
+ # set the HTTP header `Content-Type`
1366
+ if _content_type:
1367
+ _header_params['Content-Type'] = _content_type
1368
+ else:
1369
+ _default_content_type = (
1370
+ self.api_client.select_header_content_type(
1371
+ [
1372
+ 'application/json'
1373
+ ]
1374
+ )
1375
+ )
1376
+ if _default_content_type is not None:
1377
+ _header_params['Content-Type'] = _default_content_type
1378
+
1379
+ # authentication setting
1380
+ _auth_settings: List[str] = [
1381
+ 'api-key'
1382
+ ]
1383
+
1384
+ return self.api_client.param_serialize(
1385
+ method='PUT',
1386
+ resource_path='/v1/merchant-accounts/{merchantAccountId}/tax-profile',
1387
+ path_params=_path_params,
1388
+ query_params=_query_params,
1389
+ header_params=_header_params,
1390
+ body=_body_params,
1391
+ post_params=_form_params,
1392
+ files=_files,
1393
+ auth_settings=_auth_settings,
1394
+ collection_formats=_collection_formats,
1395
+ _host=_host,
1396
+ _request_auth=_request_auth
1397
+ )