Orders
Orders — methods, parameters, and examples for easy-sdk (pip).
An Order is the line-item record produced by checkout. It groups one
or more priced items into a single transaction so you can render
receipts, attach metadata, and reconcile against transfers.
Namespace: client.orders. Orders are created automatically by checkout
flows; the SDK exposes read endpoints plus a tag-only update.
Methods
retrieve
order = client.orders.retrieve("ord_123")list
orders = client.orders.list(limit=50, offset=0)
batch = client.orders.list(ids=["ord_1", "ord_2"])Returns list[Order]. See Pagination.
update_tags
order = client.orders.update_tags(
"ord_123",
tags={"reconciled": True, "warehouse": "us-east"},
)PATCHes only the tags map — the rest of the order is immutable from
the API.
Object shape
Order mirrors the API's order document. The most-used fields:
| Field | Notes |
|---|---|
id | Always present. |
customer_id | The customer who placed the order. |
items | Line items (price_id, quantity, etc.). |
total / subtotal | Integer amounts in the smallest currency unit. |
currency | Three-letter ISO code. |
tags | Free-form metadata; mutable via update_tags. |
created_at, updated_at | ISO-8601 timestamps. |
EasyModel allows extras, so any new server fields appear on the
object even before the SDK ships explicit annotations for them.
Examples
Look up the order behind a checkout session
session = client.embedded_checkout.retrieve_session("ecs_123")
# (`session.payment_status` and other status fields drive UI here)Tag and walk recent orders
PAGE = 100
offset = 0
while True:
page = client.orders.list(limit=PAGE, offset=offset)
if not page:
break
for o in page:
client.orders.update_tags(o.id, tags={"synced": True})
if len(page) < PAGE:
break
offset += PAGE