Skip to content

Environments

5 min read

Ferry provides two runtime environments: Production for real customer operations and UAT for partner integration testing. This page explains the differences between the two environments, essential testing cautions, and the list of ferry operators supporting automated electronic ticket issuance.

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
UATSystem integration testingProvided in writing by Ferry/docs on the UAT domain

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.
  • Confirming UAT base URL: Because testing infrastructure hostnames may be adjusted, partners must obtain the confirmed official base URL in writing from Ferry technical operations.

The most critical principle for partners: Ferry does not maintain a mock sandbox environment. The UAT environment is a live secondary system connected directly to live ferry operator ticketing engines.

The diagram below illustrates the order flow between the test environment and ferry operators:

flowchart TB
PROD["Production Environment<br/>api.ferry.vn"]
UAT["UAT Environment<br/>Integration testing"]
CHECK{"Ticket confirmation call<br/>confirmToIssue"}
PROD --> CHECK
UAT --> CHECK
CHECK -->|"Confirm"| REAL["Call operator booking gate<br/>Real ticket created"]
REAL --> MONEY["Real money deducted from agency deposit"]
CHECK -->|"Booking creation only"| SAFE["Temporary seat hold<br/>No charges incurred"]

Practical implications when testing on UAT:

  • Real tickets and real money: Every ticket confirmation call (POST /api/v1/bookings/confirmToIssue/:id) on UAT places a real ticket order in the operator’s system and deducts funds from your agency deposit account.
  • CangSaKy operator exception: CangSaKy connects directly to operator systems and always creates real tickets regardless of test-blocking configurations. Test bookings on CangSaKy always incur charges immediately.
  • Cancellation procedures: Cancelling test tickets requires following the standard operator cancellation workflow and incurs applicable operator cancellation penalties.
  • Safe testing approach: During initial development, partners should stop at the tentative booking creation step (POST /api/v1/bookings) to verify data shapes safely. Only confirm ticket issuance when test voyages and associated costs have been agreed upon with Ferry.

The Ferry platform connects to 13 ferry operators for schedule and fare lookups. However, automated e-ticket issuance capabilities differ across operators:

OperatorSchedule searchAutomated API ticketingOperational note
ChanKhaLuxurySupportedSupportedDirect API e-ticketing
GreenlinesSupportedSupportedDirect API e-ticketing
HoaBinhShipSupportedSupportedDirect API e-ticketing
Lightning68SupportedSupportedDirect API e-ticketing
MaiLinhExpressSupportedSupportedDirect API e-ticketing
PhuQuocExpressSupportedSupportedDirect API e-ticketing
PhuQuyExpressSupportedSupportedDirect API e-ticketing
SuperDongSupportedSupportedDirect API e-ticketing
CangSaKySupportedSupportedDirect operator connection
BinhAnHaTienSupportedNot supportedInquiries only
ThanhThoiSupportedNot supportedInquiries only
HangChauTouristSupportedNot supportedInquiries only
SaiGonWaterGoSupportedNot supportedInquiries only

For the 4 operators without automated ticketing, ticket confirmation calls will return an unsupported method error. Partners should filter or display clear notices on their user interface for sailings operated by these carriers.

Behavioral differences between Production and UAT

Section titled “Behavioral differences between Production and UAT”
AttributeUAT environmentProduction environmentPartner recommendation
Testing dataDetailed payload logging enabled for debuggingStandard secure production loggingNever submit real passenger personal identifiable data (PII) on UAT
Operator connectionsLogin for 11 operators may be temporarily disabledAll contracted operators connectedNotify Ferry in advance if you require a specific operator unblocked on UAT (avoids empty voyage search results)
Debt healingDebt reconciliation process runs in dry-run modeAutomatically reconciles and offsets balancesDiscrepancies on UAT after testing will not automatically self-heal
API key formatKey string configured per environment, looks similar to ProdKey string configured for ProductionMaintain separate environment variable stores to prevent accidental crossover
Test ticket issuanceReal tickets issued; select low-cost sailingsCommercial customer ticketingOnly run ticket confirmation tests under mutual supervision and agreed costs
Persist auth on ScalarDoes not persist keys across page reloadsDoes not persist keys across page reloadsRe-paste API key into Authorize button after reloading browser
MisconceptionRealityCorrect practice
Assuming UAT is a free mock sandboxUAT issues real tickets on operator systemsDo not attach automated regression test suites to ticket confirmation calls
Sharing one API key across UAT and ProductionEach environment has its own independent database and keysMaintain distinct keys in separate server-side environment configurations
Assuming all searchable voyages can be ticketed via API4 operators support schedule and fare queries onlyVerify operator ticketing capabilities before presenting booking flows to users
Submitting real customer identity data on UATUAT enables verbose payload loggingUse synthetic passenger details during integration testing
Voyage search on UAT returning empty means no sailingsOperator login might be disabled on UATContact Ferry to unblock the required operator for testing

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 UATOpen /docs on your assigned UAT domain
GuideRecommended next reading
Authentication with an API keyHeader format rules and key management across environments
Getting started: from zero to the first booking10 safe testing steps in the UAT environment
Ticket issuance and ordersDetailed electronic ticket fulfillment workflow with operators
Before going liveFinal technical verification checklist before transitioning to Production