用於建構與驗證 OTEP 整合、可直接複製貼上的範例。所有端點皆為公開唯讀。
跨自配送、第三方與承運商的一條標準化時間軸。
curl https://api.superlabel.ca/api/v1/otep/trackings/SR123456789
{
"result": true,
"format": "otep",
"data": {
"otep_version": "0.1",
"profile": "parcel",
"subject": { "order_id": 12345, "tracking_number": "SR123456789" },
"current_status": "delivered",
"delivered": true,
"events": [
{ "occurred_at": "2026-06-10T08:00:00-04:00", "status_code": "out_for_delivery",
"phase": "out_for_delivery", "location": { "name": "Toronto Hub" },
"source": { "type": "self_delivery" } },
{ "occurred_at": "2026-06-10T11:30:00-04:00", "status_code": "delivered",
"source": { "type": "self_delivery" }, "pod": { "recipient": "J. Smith" } }
]
}
}
加上 ?format=(或 Accept profile)即可把同一條時間軸轉換為 GS1 EPCIS 2.0、IATA ONE Record、UN/CEFACT、OpenTelemetry (OTLP)、OGC SensorThings、AfterShip、Shopify、Amazon、Walmart、BigCommerce、Magento、WooCommerce 或 Etsy。
curl "https://api.superlabel.ca/api/v1/otep/trackings/SR123456789?format=epcis"
{ "format": "epcis", "data": { "type": "EPCISDocument", "schemaVersion": "2.0",
"epcisBody": { "eventList": [
{ "type": "ObjectEvent", "action": "OBSERVE", "eventTime": "2026-06-10T11:30:00-04:00",
"bizStep": "urn:epcglobal:cbv:bizstep:receiving", "disposition": "urn:epcglobal:cbv:disp:received" } ] } } }
curl "https://api.superlabel.ca/api/v1/otep/trackings/SR123456789?format=otlp"
向驗證器 POST 任意時間軸,即可取得針對規範的精確錯誤與警告。
curl -X POST https://api.superlabel.ca/api/v1/otep/validate \ -H "Content-Type: application/json" -d '{ "otep_version":"0.1","profile":"parcel", "subject":{"tracking_number":"SR1"}, "events":[{"status_code":"not_a_code","source":{"type":"bogus"}}] }'
{
"conformant": false,
"errors": [
{ "path": "events[0].occurred_at", "message": "occurred_at is required (ISO-8601 with offset)" },
{ "path": "events[0].status_code", "message": "unknown status_code 'not_a_code'..." },
{ "path": "events[0].source.type", "message": "source.type must be one of: self_delivery, ..." }
],
"warnings": []
}
把你的原始碼翻譯為 OTEP 碼;並在 source.external_event_code 中保留你的原生碼。完整碼表見 Codebook。
# your code -> OTEP status_code "OFD" -> "out_for_delivery" "DELIVERED" -> "delivered" "ATTEMPT_FAIL" -> "delivery_failed" "RTS" -> "return_to_sender"
{ "occurred_at": "2026-06-10T08:00:00-04:00", "status_code": "out_for_delivery",
"source": { "type": "carrier_label", "carrier_code": "ACME", "external_event_code": "OFD" } }
公共 MCP 服務提供 otep_tracking 工具——助手可用自然語言取得時間軸(並投影)。
{ "method": "tools/call",
"params": { "name": "otep_tracking",
"arguments": { "tracking_number": "SR123456789", "format": "epcis" } } }
如需更深入的協助,開發者 MCP 提供 get_otep_guide,且所有內容(規範、JSON Schema、Codebook、MCP 設定、skill)都可在協定首頁取得。