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