Shopee integration guide

Connect Shopee shops, regions, and order fields in Ongapi.

OAuth and regions

Use POST /v1/connections/authorize with platform: "shopee" and a supported region (MY, SG, TH, VN, PH, ID). Live connections require a paid plan and a live API key.

Order sync

Ongapi reconciles orders on a schedule and accepts Shopee push webhooks on the Railway API host. Status updates map into the canonical state machine (pending → ready_to_ship → shipped, and so on).

Field notes

shipping_address.country is filled from Shopee recipient_address.region. totals.discount is voucher_from_seller plus voucher_from_shopee, or "0.00" when Shopee omits both. Amounts are decimal strings.

fulfillment.tracking_number comes from Shopee logistics when a tracking number exists (not the internal package id). If the partner app lacks logistics read access, the field stays null.

Write APIs

Use shared routes POST /v1/orders/{id}/ship, GET /v1/orders/{id}/shipping-label, GET /v1/connections/{id}/warehouses, and PUT /v1/connections/{id}/inventory. Mock connections return success. Live Shopee calls logistics, document, warehouse, and stock APIs. Missing scopes return capability_unsupported until the seller re-authorizes. Details: Orders and events.