Skip to content

Environments

6 min read

Ferry provides two runtime environments: Production for commercial customer operations and UAT for end-to-end partner integration testing. This page explains the uatexpress sandbox on UAT, the 12 real ferry operators connected on Production, and the behavioral differences to account for before switching environments.

Partner systems interact with Ferry across two distinct environments configured as follows:

EnvironmentPrimary purposeBase URLOpenAPI documentation
ProductionLive commercial operationshttps://api.ferry.vnhttps://api.ferry.vn/docs
UATEnd-to-end integration testing with uatexpresshttps://api.ferryvn.nethttps://api.ferryvn.net/docs

Key configuration principles to keep in mind:

  • Version prefix: All business API routes follow the format /api/v1/<resource-name>.
  • OpenAPI documentation: The interactive Scalar portal is served directly at /docs (without the /api prefix). Opening /docs on a given domain displays the documentation for that specific environment.
  • Key isolation: Each environment maintains its own database and API key directory; always store UAT and Production keys in separate environment variables.

On UAT (https://api.ferryvn.net), Ferry restricts active operator adapters strictly to uatexpress (OPERATOR_ADAPTER_ALLOWLIST=uatexpress) and enables the simulated ferry company UAT Express (operator_code: uatexpress). There is no special “test mode” flag in API requests or responses: contracts, payloads, and error codes match a live operator (modeled after Phú Quốc Express), while never calling an external ferry company or spending real money.

The diagram below illustrates how UAT isolates real operators while Production connects to all 12 live carriers:

flowchart TB
UAT["UAT Environment<br/>api.ferryvn.net"]
PROD["Production Environment<br/>api.ferry.vn"]
ALLOW{"Operator adapter allowlist<br/>uatexpress only"}
SANDBOX["Simulated UAT Express<br/>Zero-cost book, issue PDF, cancel"]
BLOCK["Real operators on UAT<br/>Booking and issuance blocked"]
LIVE["12 live ferry operators<br/>8 ticketing + 4 schedule lookup"]
UAT --> ALLOW
ALLOW -->|"Select uatexpress"| SANDBOX
ALLOW -->|"Select real operator"| BLOCK
PROD --> LIVE

Practical behavior of UAT Express (uatexpress) during integration testing:

  • Fixed daily routes and schedules: Three round-trip route pairs — UAT Rạch Giá ⇄ UAT Phú Quốc (no harbor fee), UAT Hà Tiên ⇄ UAT Phú Quốc (no harbor fee), and UAT Trần Đề ⇄ UAT Côn Đảo (18,000 VND/ticket harbor fee, matching Phú Quốc Express). Each route runs 4 daily departures (07:00, 09:30, 13:00, 15:30 Vietnam time) from today up to 29 days ahead on vessels UATX1/2/3 - UAT EXPRESS 1/2/3 with ECO and VIP seats.
  • Realistic live behavior: A sold seat becomes unavailable for all callers; seat maps cache for up to 5 minutes. You can exercise real business errors including seat already taken (UnavailableSeats), duplicate identity document within one booking (DuplicateSocialId), passenger already holding a ticket on that departure (SocialIdAlreadyPlacedOrder), and closed departure (VoyageNoLongerAvailable).
  • Ticket PDFs and post-issuance edits: Issuing tickets produces standard one-page-per-ticket boarding pass PDFs (Vietnamese accents are stripped on uatexpress tickets); updating passenger details after issuance regenerates the PDF. Cancellation fees follow your organization’s cloned Phú Quốc Express rules, and cancelled seats are not returned to sale.
  • Test VAT e-invoices: When your organization has electronic invoicing enabled, issuing tickets on UAT generates VAT invoices against MISA meInvoice’s test environment (carrying no tax validity, sending no buyer emails, and using replacement/adjustment workflows rather than direct cancellation, just like Production).
  • Boundaries and data resets: Series tickets are not supported on uatexpress. Real operators still appear in UAT search results (copied from Production), but booking or issuing them on UAT is rejected. UAT is periodically refreshed from Production; after a refresh, all uatexpress bookings and sold seats are cleared so every seat becomes vacant again.

Ticketing capabilities of the 12 Production operators

Section titled “Ticketing capabilities of the 12 Production operators”

On Production (https://api.ferry.vn), Ferry integrates 12 real ferry operators (MaiLinhExpress has been removed), consisting of 8 ticketing-enabled operators and 4 schedule-lookup-only operators:

OperatorSchedule searchAPI ticketingOperational note
PhuQuocExpressSupportedAutomatedDirect API e-ticketing
SuperDongSupportedAutomatedDirect API e-ticketing
GreenLinesSupportedAutomatedDirect API e-ticketing
Lightning68SupportedAutomatedDirect API e-ticketing
HoaBinhShipSupportedAutomatedDirect API e-ticketing
PhuQuyExpressSupportedAutomatedDirect API e-ticketing
ChanKhaLuxurySupportedAutomatedAutomated agency portal e-ticketing
CangSaKySupportedSemi-automatedConnected to operator system with fulfillment handoff
BinhAnHaTienSupportedNot supportedSchedule and fare lookup only
ThanhThoiSupportedNot supportedSchedule and fare lookup only
HangChauTouristSupportedNot supportedSchedule and fare lookup only
SaiGonWaterGoSupportedNot supportedSchedule and fare lookup only

For the 4 schedule-only operators (BinhAnHaTien, ThanhThoi, HangChauTourist, SaiGonWaterGo), calling ticket confirmation returns an unimplemented capability error. Partners should filter out or clearly label voyages operated by these four carriers in their user interface.

Behavioral differences between Production and UAT

Section titled “Behavioral differences between Production and UAT”
AttributeUAT environmentProduction environmentPartner recommendation
Operator adaptersIsolated via OPERATOR_ADAPTER_ALLOWLIST=uatexpress (uatexpress only)Connects to 12 real ferry operators (8 ticketing + 4 schedule lookup)Always test against UAT ... routes of uatexpress on UAT; verify the 8 ticketing operators before Production rollout
Testing costZero real cost with simulated uatexpressCommercial tickets deducting real agency deposit balanceRun full end-to-end tests (including error paths and cancellations) freely on uatexpress
Electronic invoicesIssued on MISA meInvoice test environment (no tax value)Live VAT e-invoices issued and delivered to buyersVerify invoice webhook handling on UAT before enabling live invoicing
Data resets & debt healingPeriodically refreshed from Production; debt healing runs in dry-run modePersistent records; automated live balance and debt reconciliationDo not assume UAT booking IDs persist permanently across environment refreshes
Passenger dataVerbose payload logging enabled for integration debuggingStandard secure production loggingNever submit real customer personal identifiable information (PII) on UAT
API key formatSeparate UAT keys, rejected on ProductionSeparate Production keysKeep UAT and Production keys in isolated server secret stores
MisconceptionRealityCorrect practice
Trying to book live operators (such as SuperDong or PQE) on UATUAT blocks all real operator adapters via OPERATOR_ADAPTER_ALLOWLIST=uatexpressSearch UAT ... piers and book uatexpress voyages on UAT
Sharing one API key across UAT and ProductionEach environment maintains its own independent database and keysStore distinct keys in separate server-side environment variables
Assuming every searchable operator on Production issues tickets via APIAmong the 12 Production operators, 4 support schedule and fare lookup onlyCheck the list of 8 ticketing-supported operators before enabling automated checkout
Submitting real customer identity data on UATUAT enables verbose payload logging for troubleshootingUse synthetic passenger details exclusively during integration testing
Expecting UAT test bookings to remain foreverUAT refreshes periodically from Production, wiping old uatexpress bookingsGenerate fresh test bookings in each integration test run

Each environment hosts its own independent OpenAPI portal. To inspect schemas and test endpoints:

Target environmentDocumentation portal
Inspect schemas and test on ProductionScalar UI — Ferry VN API
Inspect schemas and test on UATScalar UI — Ferry VN UAT
GuideRecommended next reading
Authentication with an API keyHeader format rules, resource scopes, and key management across environments
Getting started: from zero to the first booking10 zero-cost end-to-end steps with uatexpress on UAT
Ticket issuance and order legsDetailed electronic ticket fulfillment workflow across operators
Before you go liveFinal technical verification checklist before transitioning from uatexpress to Production