omnicommerce) is generated from the same public OpenAPI spec as the TypeScript SDK. Every documented REST operation is a resource method. Responses are parsed JSON: objects are dicts, arrays are lists, and an empty body is None.
Install
Install the SDK from PyPI:Authenticate
Use an organization API key (omni_sk_...) as a bearer token. Do not send organization_id on API-key requests.
api_key to read OMNI_API_KEY. Override the host with base_url or environment (https://omnicommerce.sg by default). OmniEnvironment.LOCAL is http://localhost:3000. See Authentication.
AsyncOmni is the async client and uses async with.
Resource clients
Each call takes keyword arguments. Path, query, and JSON fields keep their wire names in snake_case:productId is product_id, minPrice is min_price.
client.with_raw_response.orders.get(...) returns data, status_code, headers, and url.
Publish selected fields
Passmarketplaces to choose where to publish/update. Omit it to use every enabled or already listed marketplace. Pass update_fields to publish only those saved product fields, matching the publish popover. Selected-field updates require an existing listing and assigned store; other fields and listing visibility stay unchanged. Omit fields for a full publish.
ok and every target result: valid marketplaces can queue while another fails. Price and inventory selections return their durable jobs in the same results. Queued work is not proof of a live marketplace change. See the API reference for supported fields and marketplace capability limits.
Product inventory
Response keys keep their API casing even though method arguments use snake_case. Readpage["items"] and each row’s stockQuantity and variantCount (above 0 means the product has variants).
stockQuantity is catalog stock, matching the Products page. Parent rows already aggregate their variants; virtual bundles already account for component stock and any manual cap. Preserve null or missing values as unknown. Do not read inventoryQuantity, inventory.quantity, or stock_quantity, and do not sum a missing variants array. See Product inventory for quantity semantics.
Market price comparison
Compare up to 50 simple product or variant IDs. This read-only API requirescatalog:read and returns a durable job. AsyncOmni exposes the same methods with await.
gl to compare every recorded listing market. Global Zalora uses each country’s listing price and currency, including Hong Kong and Taiwan. An India Shopify store selling in SGD is researched in Singapore. Pass gl="sg" to restrict research to Singapore. Use variant IDs for products with variants.
Inspect the final result.success and each market’s success, priceSource, priceAsOf, and errors. Missing exact published prices remain explicit failures; catalog research may still be returned. Unlisted products use catalog pricing. No monetary values are combined across currencies. Persisted price evidence can be stale; refresh listings as needed and verify shopping variants and pack sizes. A client wait timeout does not cancel the job. See the API reference for the canonical contract.
Coverage
Looks, returns, settlements, marketplaces, search, evaluate, monitor, sync, Zalora, and the remaining documented tags follow the same pattern.
client.agents.general.invoke waits for the Omni agent. Pass request_options=RequestOptions(timeout_in_seconds=780) on that call. start returns immediately and get_run(run_id=...) polls the run. See Omni agent API.
File uploads
Upload methods (documents.upload, products.upload_image) send multipart/form-data. Pass an open binary file, or a (filename, bytes, content_type) tuple.
Errors
Non-2xx responses raiseOmniError subclasses. See SDK errors.
GET, HEAD, OPTIONS, PUT, and DELETE retry on 5xx and network failures. 408 and 429 retry for every method. POST and PATCH are not retried on 5xx.
Webhooks
{timestamp}.{raw_body} compared to X-Omni-Signature. See Webhooks.