- Developers
- Before you go live
Before you go live
Prior to transitioning into the live Production environment, your system must pass acceptance criteria covering secure connectivity, end-to-end verification on the uatexpress UAT sandbox, duplicate-order safeguards, and operational monitoring. This page provides a concise, actionable checklist to confirm launch readiness before opening live commercial sales.
The four acceptance gates
Section titled “The four acceptance gates”The four gates must be cleared sequentially. Each gate builds on the previous one: secure connectivity enables business testing, understanding operator behavior informs error safeguards, and monitoring protects live operations once safeguards are active.
The diagram below shows the four sequential acceptance gates before launching in Production:
flowchart LR K["Gate 1 — Connection"] --> K1["Live key in secrets manager only"] K --> K2["Isolated UAT and Production configs"] K1 --> N["Gate 2 — Business flows"] K2 --> N N --> N1["Run full lifecycle on uatexpress"] N --> N2["Classify 8 ticketing vs 4 lookup operators"] N1 --> C["Gate 3 — Safeguards"] C1["Block duplicate creation locally"] C2["Query state before timeout retry"] N2 --> C C --> C1 C --> C2 C1 --> G["Gate 4 — Monitoring"] C2 --> G G --> G1["Daily scheduled reconciliation"] G --> G2["Alert on 429s, balance, and disruptions"]Acceptance checklist
Section titled “Acceptance checklist”Gate 1 — Connection and security
Section titled “Gate 1 — Connection and security”- Secret key protection: The Production API key lives exclusively in a server-side secrets manager or protected environment variable, uses the narrowest preset/scopes needed, and never appears in client builds or git history.
- Base URL confirmation: Production points to
https://api.ferry.vn, cleanly separated fromhttps://api.ferryvn.neton UAT. - Separate API keys and webhook secrets: UAT and Production API keys and
whsec_...signing secrets are isolated in separate configurations to prevent cross-environment calls or signature failures. - Zero-downtime rotation drill: Your team has rehearsed Rotate with grace (
1h/24h/7d) on the Dashboard for both API keys and webhook signing secrets.
API keys do not expire unless expires_at is set; revocation is immediate and permanent. Establish an emergency credential contact before opening sales.
Gate 2 — Business flows and ferry operators
Section titled “Gate 2 — Business flows and ferry operators”- End-to-end lifecycle on
uatexpress(UAT): Exercised voyage search → boat layout → booking creation →confirmToIssue→ boarding pass PDF download → cancellation request, plus controlled failure cases (UnavailableSeats,DuplicateSocialId,PassengerInfoIncomplete120145). - Correctly classify the 12 Production operators: Enabled automated checkout for the 8 ticketing operators (
PhuQuocExpress,SuperDong,GreenLines,Lightning68,HoaBinhShip,PhuQuyExpress,ChanKhaLuxury,CangSaKy) and filtered or labelled the 4 schedule-lookup-only operators (BinhAnHaTien,ThanhThoi,HangChauTourist,SaiGonWaterGo). - Partial issuance and voyage disruption handling: Handled multi-leg partial issuance outcomes and integrated trip delay/cancellation tracking (
/api/v1/disruptions+disruption.*webhooks). - Price formula verification: Cross-checked retail customer totals (including VAT and harbor fees minus vouchers) against agency NET settlement amounts.
Gate 3 — Data error prevention
Section titled “Gate 3 — Data error prevention”- Local duplicate suppression: Submitted two rapid requests in testing and confirmed only a single booking is created on your backend, not merely via a disabled UI button.
- Safe timeout recovery: When
POST /bookingstimes out, your backend queries recent bookings before deciding whether to submit a fresh creation call. - Webhook verification and deduplication: Your webhook endpoint verifies Standard Webhooks HMAC signatures on raw request bytes (signing enabled on Dashboard) and deduplicates by
webhook-id. - Safe empty-list handling: Empty arrays
[]from list endpoints never trigger automatic deletion or cancellation of local records.
Gate 4 — Monitoring and operations
Section titled “Gate 4 — Monitoring and operations”- Daily scheduled reconciliation: An automated job reconciles booking states, financial transactions, and voyage disruptions (
updated_since) between both systems daily. - Webhook receiver verified: Your public HTTPS endpoint (port 443 or 8443) answers with 2xx under 2 seconds and has passed a signed
webhook.testping from Send test on the Dashboard. - Abnormal silence alerts: Alerts fire when inbound webhooks or bookings stay silent longer than expected for the time of day.
- Correlation logging (
x-request-id): Every failed request logsx-request-id, booking ID, HTTP status, and 6-digit error code with at least 30 days retention. - Unexpected empty-list alerts: Alerts trigger when a normally populated route query suddenly returns
[]with HTTP 200.
What to monitor from day one
Section titled “What to monitor from day one”Track four operational signals continuously once live traffic starts:
- Booking status via API is the source of truth: Webhooks provide low-latency signals, while
GET /bookings/{id}and scheduled reconciliation backfill any event dropped after 4 delivery attempts. - Autonomous background transitions: Ferry’s background workers reconcile paid pending bookings with operators automatically; a booking can advance to Issued (10) minutes later without a new partner call.
- Live operator gateway latency: Unlike
uatexpressreturning tickets instantaneously on UAT, live operator gateways on Production can take 5–8 minutes. Configure generous client timeouts and transition to status polling instead of aborting early. - Available balance, business error codes, and rate-limit headers: Monitor agency deposit balance, 6-digit error rates, and
X-RateLimit-*/RateLimit-*/Retry-Afterheaders to top up funds and smooth traffic spikes before hitting 429s.
Global rate limiting runs at 5,000 requests per 10 seconds per client IP per route/replica, while confirmToIssue caps at 5 requests per 60 seconds per client IP + bookingId alongside optional per-API-key per-minute limits.
Differences between UAT and Production
Section titled “Differences between UAT and Production”| Item | UAT environment | Production environment | Action required when switching |
|---|---|---|---|
| Base URL | https://api.ferryvn.net | https://api.ferry.vn | Switch environment configuration to the live Production domain |
| Operator connectivity | Isolated via OPERATOR_ADAPTER_ALLOWLIST=uatexpress (uatexpress sandbox only, zero cost) | Connects 12 real ferry operators (8 ticketing + 4 schedule lookup; MaiLinhExpress removed) | Switch from UAT ... test piers to live pier codes and fund your agency deposit balance |
| Electronic invoices | MISA meInvoice test environment (no tax value) | Live commercial MISA meInvoice VAT issuance | Verify organization e-invoicing configuration on the Production Dashboard |
| Debt healing & data persistence | Dry-run mode; database refreshed periodically from Production | Live automated reconciliation and persistent ledgers | Enable daily reconciliation jobs from day one |
| API keys & webhook secrets | Dedicated UAT keys and secrets | Dedicated Production keys and secrets | Create least-privilege Production keys and enable webhook signing on the Production Dashboard |
Common misconceptions
Section titled “Common misconceptions”| Misconception | Reality | Consequence |
|---|---|---|
Keeping tight timeouts tuned only for uatexpress | Live Production operators can take 5–8 minutes to issue tickets | Premature client timeouts lead to duplicate bookings and double charges |
| Assuming all 12 Production operators issue tickets via API | 8 operators support ticketing; 4 support schedule and fare lookup only | Selling voyages of the 4 lookup-only carriers causes checkout failures |
| Waiting for Ferry idempotency headers | Ferry has no idempotency key on booking creation | Retrying timed-out POST /bookings calls creates duplicate orders |
| Relying solely on webhooks without reconciliation | Events drop after 4 failed attempts; unverified payloads risk spoofing | Drifted order states or forged webhook acceptance |
Using full-access * keys everywhere | * keys can modify settings and delete child organizations | Larger blast radius if an auxiliary service key leaks |
Where to look in Scalar
Section titled “Where to look in Scalar”Use https://api.ferry.vn/docs for final pre-launch smoke checks by calling a read-only endpoint with your Production key on the Production domain:
| Verification target | Group in API reference |
|---|---|
| Smoke-test live API key on a read call | Voyages |
| Query voyage disruptions affecting orders | Disruptions |
| Reconcile booking status | Bookings |
| Inspect individual leg order details | Orders |
| Reconcile deposit balance and ledger entries | Transactions, Debt Ledgers |
| Verify organization profile bound to your API key | Organizations |
Read next
Section titled “Read next”| Page | When to read |
|---|---|
| Integration surface overview | Review partner API scope and tier boundaries |
| Environments | Compare the uatexpress UAT sandbox and 12 Production operators |
| Authentication with an API key | Configure least-privilege scopes and zero-downtime rotation |
| General conventions | Review pagination cursors, UTC timestamps, and duplicate prevention |
| Errors and how to handle them | Handle business error codes (120145, 120100, 120140) |
| Rate limits | Configure backoff and monitor X-RateLimit-* / RateLimit-* headers |
| Webhooks | Verify Standard Webhooks signatures and run async ingestion |
| The booking flow | Review complete booking lifecycles before sign-off |
Open questions
Section titled “Open questions”- Service Level Agreements (SLA): Ferry has not published a formal uptime or incident-response SLA document; agree on escalation contacts and support hours with your Ferry liaison prior to opening sales.
- Silence alert window: Optimal silence alert thresholds depend on your daily booking volume and seasonal traffic patterns; tune separate daytime and overnight thresholds.