订单与事件

读取规范订单,以及 order.created 与 order.updated 事件。

GET /v1/orders returns the canonical orders for the shops your API key can see. GET /v1/events returns the same changes as outbound webhooks.

Order

Each order has an id prefixed ord_, a connection id prefixed conn_, a platform (shopee, tiktok_shop, lazada, shopify, or mock on Sandbox), a platform order id, a status, and optional fulfillment fields such as tracking number.

Statuses move forward only. A pending order can become ready to ship. Jumping from pending straight to shipped is ignored until a legal intermediate status arrives. A fulfilled Shopify order is stored as shipped, not completed, because ready to ship cannot move directly to completed.

Canonical status values match the OpenAPI enum: unpaid, pending, ready_to_ship, shipped, delivered, completed, cancelled, in_refund, refunded.

Money and address fields

All amounts in totals and line item price are decimal strings (for example "99.00"). Currency is on the order root as currency.

Platformshipping_address.country sourcetotals.discount
Shopeerecipient_address.region from the platform payloadvoucher_from_seller + voucher_from_shopee, or "0.00" when both are absent
TikTok Shoprecipient_address.region_codepayment.seller_discount + payment.platform_discount, or "0.00"
LazadaShipping address country when presentvoucher, otherwise voucher_seller + voucher_platform
ShopifyShipping address countryMapped from total_discounts
Sandbox (mock)"MY" on sample orders"0.00"

country is not normalized to ISO 3166 across platforms. Treat it as the marketplace’s own region or country code string.

Platformcitystatepostal_codecountry
Shopeerecipient_address.cityrecipient_address.staterecipient_address.zipcoderecipient_address.region
TikTok Shoprecipient_address.district_info (city level)district_info (state or province)postal_code when presentregion_code
Lazadaaddress_shipping.cityaddress_shipping.address2 when presentpost_codecountry when present
ShopifyShipping address cityShipping address provinceShipping address zipShipping address country
Sandbox (mock)Sample city on test ordersSample stateSample postal code"MY" on sample orders

Fields stay null when the marketplace payload omits them.

Fulfillment fields (read path)

On GET /v1/orders and webhooks, fulfillment is a snapshot of what the marketplace already stored when Ongapi last synced the order. It is not updated by your app until you call a write endpoint below or the platform pushes a change.

waybill_url on the order object is a tracking link when the platform sends one, not a PDF label download. Use GET /v1/orders/{id}/shipping-label for marketplace AWBs when supported.

Platformtracking_numbershipping_providerwaybill_url
ShopeeLogistics tracking when Shopee returns one; otherwise nullCarrier from order detailAlways null (not a PDF label URL)
TikTok ShopPackage tracking when presentPackage carrier nameAlways null
Lazadatracking_code from order items when presentshipment_provider from the same rowAlways null
ShopifyFulfillment tracking numberFulfillment carrierShopify tracking_url when set (tracking link, not a marketplace AWB)
Sandbox (mock)null unless your test payload sets fulfillmentSamenull

Events

Event ids use the prefix evt_.

TypeWhen
order.createdThe order is stored for the first time
order.updatedStatus or fulfillment changed. changed_fields lists what moved
connection.reauth_requiredThe shop token must be authorized again

On Sandbox, post a mock webhook to create an order, then read it back with your test key. See Getting started.

Write APIs (integrations)

EndpointPurpose
POST /v1/orders/{id}/shipPush seller tracking or request platform logistics (mode: seller_tracking or platform_logistics). Requires Idempotency-Key. Updates fulfillment and emits order.updated.
GET /v1/orders/{id}/shipping-labelDownload or fetch a platform AWB when the marketplace provides one. Shopify returns waybill_unavailable.
GET /v1/connections/{id}/warehousesList warehouse or location ids for inventory writes.
PUT /v1/connections/{id}/inventorySet available quantity per SKU or platform_item_id and warehouse_id. Requires Idempotency-Key.

Sandbox (mock): all write calls return success and update the canonical order (ship also emits order.updated).

Live shops: Shopee, TikTok Shop, and Lazada call the marketplace for ship, shipping labels, warehouses, and inventory. Shopify POST …/ship accepts only seller_tracking and creates a fulfillment; platform_logistics returns capability_unsupported. Shopify GET …/shipping-label always returns HTTP 409 with waybill_unavailable. Shopify warehouses and inventory use Admin locations and inventory levels.

Missing partner scopes return HTTP 501 with capability_unsupported. Re-authorize the shop after partner scopes are added. Shopify platform_logistics also returns 501 capability_unsupported (seller tracking only). A label that the marketplace cannot print yet returns HTTP 409 with waybill_unavailable. Idempotency-Key is stored for 24 hours: the same key replays the first successful response and does not call the platform again.

For seller_tracking, Shopee requires tracking_number only. TikTok Shop and Lazada also require shipping_provider (TikTok: carrier id or exact provider name from TikTok logistics; Lazada: carrier name such as LEX).

Error codeHTTPWhen
invalid_request400Missing or invalid body (for example tracking_number or shipping_provider)
waybill_unavailable409No platform AWB (always for Shopify; or order not ready on SEA marketplaces)
capability_unsupported501Missing OAuth scopes for this write, or unsupported mode (for example Shopify platform_logistics)
platform_error502Marketplace API failed; response may include the platform message