- Developers
- Environments
Environments
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.
Comparing the two environments
Section titled “Comparing the two environments”Partner systems interact with Ferry across two distinct environments configured as follows:
| Environment | Primary purpose | Base URL | OpenAPI documentation |
|---|---|---|---|
| Production | Live commercial operations | https://api.ferry.vn | https://api.ferry.vn/docs |
| UAT | End-to-end integration testing with uatexpress | https://api.ferryvn.net | https://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/apiprefix). Opening/docson 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.
The uatexpress sandbox on UAT
Section titled “The uatexpress sandbox on UAT”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 --> LIVEPractical 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), andUAT 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:30Vietnam time) from today up to 29 days ahead on vesselsUATX1/2/3 - UAT EXPRESS 1/2/3with 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
uatexpresstickets); 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, alluatexpressbookings 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:
| Operator | Schedule search | API ticketing | Operational note |
|---|---|---|---|
| PhuQuocExpress | Supported | Automated | Direct API e-ticketing |
| SuperDong | Supported | Automated | Direct API e-ticketing |
| GreenLines | Supported | Automated | Direct API e-ticketing |
| Lightning68 | Supported | Automated | Direct API e-ticketing |
| HoaBinhShip | Supported | Automated | Direct API e-ticketing |
| PhuQuyExpress | Supported | Automated | Direct API e-ticketing |
| ChanKhaLuxury | Supported | Automated | Automated agency portal e-ticketing |
| CangSaKy | Supported | Semi-automated | Connected to operator system with fulfillment handoff |
| BinhAnHaTien | Supported | Not supported | Schedule and fare lookup only |
| ThanhThoi | Supported | Not supported | Schedule and fare lookup only |
| HangChauTourist | Supported | Not supported | Schedule and fare lookup only |
| SaiGonWaterGo | Supported | Not supported | Schedule 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”| Attribute | UAT environment | Production environment | Partner recommendation |
|---|---|---|---|
| Operator adapters | Isolated 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 cost | Zero real cost with simulated uatexpress | Commercial tickets deducting real agency deposit balance | Run full end-to-end tests (including error paths and cancellations) freely on uatexpress |
| Electronic invoices | Issued on MISA meInvoice test environment (no tax value) | Live VAT e-invoices issued and delivered to buyers | Verify invoice webhook handling on UAT before enabling live invoicing |
| Data resets & debt healing | Periodically refreshed from Production; debt healing runs in dry-run mode | Persistent records; automated live balance and debt reconciliation | Do not assume UAT booking IDs persist permanently across environment refreshes |
| Passenger data | Verbose payload logging enabled for integration debugging | Standard secure production logging | Never submit real customer personal identifiable information (PII) on UAT |
| API key format | Separate UAT keys, rejected on Production | Separate Production keys | Keep UAT and Production keys in isolated server secret stores |
Common misconceptions
Section titled “Common misconceptions”| Misconception | Reality | Correct practice |
|---|---|---|
| Trying to book live operators (such as SuperDong or PQE) on UAT | UAT blocks all real operator adapters via OPERATOR_ADAPTER_ALLOWLIST=uatexpress | Search UAT ... piers and book uatexpress voyages on UAT |
| Sharing one API key across UAT and Production | Each environment maintains its own independent database and keys | Store distinct keys in separate server-side environment variables |
| Assuming every searchable operator on Production issues tickets via API | Among the 12 Production operators, 4 support schedule and fare lookup only | Check the list of 8 ticketing-supported operators before enabling automated checkout |
| Submitting real customer identity data on UAT | UAT enables verbose payload logging for troubleshooting | Use synthetic passenger details exclusively during integration testing |
| Expecting UAT test bookings to remain forever | UAT refreshes periodically from Production, wiping old uatexpress bookings | Generate fresh test bookings in each integration test run |
Where to look in Scalar
Section titled “Where to look in Scalar”Each environment hosts its own independent OpenAPI portal. To inspect schemas and test endpoints:
| Target environment | Documentation portal |
|---|---|
| Inspect schemas and test on Production | Scalar UI — Ferry VN API |
| Inspect schemas and test on UAT | Scalar UI — Ferry VN UAT |
Read next
Section titled “Read next”| Guide | Recommended next reading |
|---|---|
| Authentication with an API key | Header format rules, resource scopes, and key management across environments |
| Getting started: from zero to the first booking | 10 zero-cost end-to-end steps with uatexpress on UAT |
| Ticket issuance and order legs | Detailed electronic ticket fulfillment workflow across operators |
| Before you go live | Final technical verification checklist before transitioning from uatexpress to Production |