Skip to content

Before you go live

7 min read

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 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"]
  • 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 from https://api.ferryvn.net on 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, PassengerInfoIncomplete 120145).
  • 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.
  • 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 /bookings times 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.
  • 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.test ping 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 logs x-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.

Track four operational signals continuously once live traffic starts:

  1. 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.
  2. 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.
  3. Live operator gateway latency: Unlike uatexpress returning 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.
  4. Available balance, business error codes, and rate-limit headers: Monitor agency deposit balance, 6-digit error rates, and X-RateLimit-* / RateLimit-* / Retry-After headers 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.

ItemUAT environmentProduction environmentAction required when switching
Base URLhttps://api.ferryvn.nethttps://api.ferry.vnSwitch environment configuration to the live Production domain
Operator connectivityIsolated 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 invoicesMISA meInvoice test environment (no tax value)Live commercial MISA meInvoice VAT issuanceVerify organization e-invoicing configuration on the Production Dashboard
Debt healing & data persistenceDry-run mode; database refreshed periodically from ProductionLive automated reconciliation and persistent ledgersEnable daily reconciliation jobs from day one
API keys & webhook secretsDedicated UAT keys and secretsDedicated Production keys and secretsCreate least-privilege Production keys and enable webhook signing on the Production Dashboard
MisconceptionRealityConsequence
Keeping tight timeouts tuned only for uatexpressLive Production operators can take 5–8 minutes to issue ticketsPremature client timeouts lead to duplicate bookings and double charges
Assuming all 12 Production operators issue tickets via API8 operators support ticketing; 4 support schedule and fare lookup onlySelling voyages of the 4 lookup-only carriers causes checkout failures
Waiting for Ferry idempotency headersFerry has no idempotency key on booking creationRetrying timed-out POST /bookings calls creates duplicate orders
Relying solely on webhooks without reconciliationEvents drop after 4 failed attempts; unverified payloads risk spoofingDrifted order states or forged webhook acceptance
Using full-access * keys everywhere* keys can modify settings and delete child organizationsLarger blast radius if an auxiliary service key leaks

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 targetGroup in API reference
Smoke-test live API key on a read callVoyages
Query voyage disruptions affecting ordersDisruptions
Reconcile booking statusBookings
Inspect individual leg order detailsOrders
Reconcile deposit balance and ledger entriesTransactions, Debt Ledgers
Verify organization profile bound to your API keyOrganizations
PageWhen to read
Integration surface overviewReview partner API scope and tier boundaries
EnvironmentsCompare the uatexpress UAT sandbox and 12 Production operators
Authentication with an API keyConfigure least-privilege scopes and zero-downtime rotation
General conventionsReview pagination cursors, UTC timestamps, and duplicate prevention
Errors and how to handle themHandle business error codes (120145, 120100, 120140)
Rate limitsConfigure backoff and monitor X-RateLimit-* / RateLimit-* headers
WebhooksVerify Standard Webhooks signatures and run async ingestion
The booking flowReview complete booking lifecycles before sign-off
  • 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.