API Reference
OpenAPI
Section titled “OpenAPI”The spec covers public storefront and partner routes only. Admin operator routes use Hono RPC (EsimApiType) and are documented internally under Internal → Full-stack edge stack.
Download or browse: openapi.json
Regenerate after route changes:
pnpm --filter @traveler-labs/esim-api run openapi:generateCommit both workers/esim-api/openapi.json and apps/docs/public/openapi.json.
Route groups
Section titled “Route groups”Public (/api/v1)
Section titled “Public (/api/v1)”| Method | Path | Tag |
|---|---|---|
| GET | /config | config |
| GET | /products | catalog |
| GET | /products/{slug} | catalog |
| POST | /orders | orders |
| GET | /orders/{id} | orders |
| POST | /campaigns/{code}/redeem | campaigns |
| GET | /esims/{id} | esims |
| GET | /esims/{id}/usage | esims |
| POST | /esims/{id}/topup | esims |
| POST | /esims/{id}/refund-request | esims |
Partner (/api/v1/partner)
Section titled “Partner (/api/v1/partner)”| Method | Path | Auth header |
|---|---|---|
| POST | /orders | X-Partner-Api-Key |
| POST | /orders/bulk | X-Partner-Api-Key |
| GET | /orders/{id} | X-Partner-Api-Key |
RPC (admin — not in OpenAPI)
Section titled “RPC (admin — not in OpenAPI)”Admin UI uses typed Hono RPC via hc<EsimApiType> (worker origin) or hc<EsimAdminRoutesType> with base URL /api/v1/admin. Cross-package inference requires a single boundary cast in apps/admin/src/lib/rpc-admin.ts; route types are exported as EsimAdminRoutesType / EsimAdminRpc from workers/esim-api/src/rpc-types.ts.