You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -11,7 +11,7 @@ Sync for Commerce: The API for Sync for Commerce.
11
11
12
12
Sync for Commerce automatically replicates and reconciles sales data from a merchant’s source PoS, Payments, and eCommerce systems into their accounting software. This eliminates manual processing by merchants and transforms their ability to run and grow their business.
Not seeing the endpoints you're expecting? We've [reorganized our products](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Sync for Commerce](https://docs.codat.io/sync-for-commerce-v1-api#/).
17
17
@@ -45,6 +45,7 @@ Not seeing the endpoints you're expecting? We've [reorganized our products](http
45
45
*[Server Selection](#server-selection)
46
46
*[Custom HTTP Client](#custom-http-client)
47
47
*[Authentication](#authentication)
48
+
*[Resource Management](#resource-management)
48
49
*[Debugging](#debugging)
49
50
*[Support](#support)
50
51
@@ -53,6 +54,11 @@ Not seeing the endpoints you're expecting? We've [reorganized our products](http
53
54
<!-- Start SDK Installation [installation] -->
54
55
## SDK Installation
55
56
57
+
> [!NOTE]
58
+
> **Python version upgrade policy**
59
+
>
60
+
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
61
+
56
62
The SDK can be installed with either *pip* or *poetry* package managers.
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
256
318
"locale": shared.Locale.EN_US,
257
319
})
258
320
259
-
if res isnotNone:
260
-
# handle response
261
-
pass
321
+
assert res isnotNone
322
+
323
+
# Handle response
324
+
print(res)
262
325
263
326
```
264
327
<!-- End Retries [retries] -->
@@ -279,10 +342,11 @@ By default, an API error will raise a errors.SDKError exception, which has the f
279
342
280
343
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `get_config_text_sync_flow_async` method may raise the following exceptions:
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
301
366
"locale": shared.Locale.EN_US,
302
367
})
303
368
304
-
if res isnotNone:
305
-
# handle response
306
-
pass
369
+
assert res isnotNone
370
+
371
+
# Handle response
372
+
print(res)
307
373
374
+
except errors.ErrorMessage as e:
375
+
# handle e.data: errors.ErrorMessageData
376
+
raise(e)
308
377
except errors.ErrorMessage as e:
309
378
# handle e.data: errors.ErrorMessageData
310
379
raise(e)
@@ -319,7 +388,7 @@ with CodatSyncCommerce(
319
388
320
389
### Override Server URL Per-Client
321
390
322
-
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
391
+
The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
323
392
```python
324
393
from codat_sync_for_commerce import CodatSyncCommerce
325
394
from codat_sync_for_commerce.models import shared
@@ -330,13 +399,15 @@ with CodatSyncCommerce(
330
399
auth_header="Basic BASE_64_ENCODED(API_KEY)",
331
400
),
332
401
) as codat_sync_commerce:
402
+
333
403
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
334
404
"locale": shared.Locale.EN_US,
335
405
})
336
406
337
-
if res isnotNone:
338
-
# handle response
339
-
pass
407
+
assert res isnotNone
408
+
409
+
# Handle response
410
+
print(res)
340
411
341
412
```
342
413
<!-- End Server Selection [server] -->
@@ -443,17 +514,49 @@ with CodatSyncCommerce(
443
514
auth_header="Basic BASE_64_ENCODED(API_KEY)",
444
515
),
445
516
) as codat_sync_commerce:
517
+
446
518
res = codat_sync_commerce.sync_flow_settings.get_config_text_sync_flow(request={
The `CodatSyncCommerce` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
0 commit comments