ordercore
Stdlib-only Python client for OrderCore — the commerce API for AI agents. Catalog, checkout sessions, and idempotent orders: agent retries never double-charge.
pip install ordercore # Python 3.8+, zero dependencies
Try it with no signup
OrderCore.sandbox() issues a fresh read-only key on the demo tenant and
returns a ready client — no signup, no key of your own:
from ordercore import OrderCore
oc = OrderCore.sandbox() # read-only demo key, issued for you
products = oc.products.list() # live demo catalog
print(len(products["data"]), "products")
The sandbox key is read-only (writes return 403), strictly rate limited, and
short lived. For a full read/write key: https://ordercore.ai/bootstrap.
With your own key
from ordercore import OrderCore
oc = OrderCore(api_key="oc_live_...")
# Seed a demo catalog (idempotent), then create a retry-safe order.
seed = oc.onboarding.demo_data()
order = oc.orders.create(
{"customer_id": seed["sample_customer_id"],
"items": [{"sku_id": seed["sample_order_item"]["sku_id"], "quantity": 1}]},
idempotency_key="first-order-001",
)
print(order["id"], order["status"])
Why this client is agent-safe
orders.create/confirm/cancelalways send anIdempotency-Key(auto-generated if you don't pass one). Replaying a key returns the original order; the same key with a different payload raisesOrderCoreErrorwithstatus=409anderror: "conflict"in the body (the raised error's.codeis populated from thaterrorfield) instead of double-ordering.- GETs and idempotency-keyed writes retry on 408/429/5xx and network errors with exponential backoff. Un-keyed writes are never retried.
Surface
account.{auth,status,usage,readiness} · products.{list,get,create,update,delete} ·
skus.get · inventory.{list,adjust,reserve,release} · prices.list ·
orders.{create,list,get,confirm,cancel} · onboarding.demo_data ·
webhooks.{list_endpoints,create_endpoint,delete_endpoint} ·
checkout.{create_session,update_session,complete_session} ·
request(method, path, ...) for anything else.
Links
- Get an API key (2 fields, no payment): https://ordercore.ai/bootstrap
- Full API guide: https://ordercore.ai/docs.md · OpenAPI: https://ordercore.ai/openapi.yaml
- MCP server (same tools for Claude/Cursor): https://ordercore.ai/what-is-an-mcp-commerce-server
MIT © Cloudpeakify s.r.o.
Metadata
Release files for ordercore 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ordercore-0.1.0.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ordercore-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.0 kB
Release files / ordercore-0.1.0.tar.gz
| Download URL | ordercore-0.1.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
513a6f5f1103804f246f0389f320f027ccdea3876384c4b1d97f6589d5625b0f
|
|
BLAKE2b-256 checksum How to use checksums |
fe95d2a75b6ac24c24f094c855f1eaa185e201cb4df75fdb7accf9da7be868d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / ordercore-0.1.0-py3-none-any.whl
| Download URL | ordercore-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e130f2710af1644c7f80b74fe6daab06370a2fd7dd5d278cbd6defa52712878e
|
|
BLAKE2b-256 checksum How to use checksums |
917709f27c2b126c40a5f819e337f8ba79a7dfcc6224413b1fc02e88c4855642
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|