Skip to content

Ticket issuance and order legs

7 min read

Confirming ticket issuance is the step that turns a tentative booking into valid electronic tickets on the ferry operator’s booking engine. Prior to this step, the operator has no record of the order and the passenger has no guaranteed seat; once completed, tickets are issued and passengers are clear to board.

PrerequisiteBusiness contextReference
Valid API keyAll ticket confirmation and file retrieval calls require partner authentication (bookings:write)Authentication with an API key
Requested booking with complete passenger infoOrder sits in Requested status (2) with all required passenger fields populatedThe booking flow
Adequate available balanceAccount balance or credit limit across the org hierarchy must cover the NET ratePayments and balances
Verified operator capabilityConfirm target operator supports API ticketing (uatexpress on UAT, 8 operators on Production)See operator capabilities list below
Webhook endpoint configuredRegister event URLs to receive immediate issuance notificationsWebhooks

Zero-cost ticket issuance testing on UAT: On UAT (https://api.ferryvn.net), all real ferry operators are isolated via OPERATOR_ADAPTER_ALLOWLIST=uatexpress. Select voyages operated by UAT Express (uatexpress) to test confirmation, boarding pass PDF downloads, and test VAT e-invoices at zero cost; see Environments.

The diagram below illustrates the sequence of actions that occur when confirming ticket issuance:

sequenceDiagram
autonumber
participant P as "Your system"
participant API as "Ferry API"
participant MONEY as "Balance check"
participant OP as "Operator"
participant WH as "Webhook"
P->>API: "Confirm issuance (POST /bookings/confirmToIssue/{id})"
API->>API: "Verify 5 req/60s per-booking cap, 600s lock, passenger info"
API->>MONEY: "Check balance and credit limits"
alt Insufficient funds
MONEY-->>API: "Insufficient balance"
API-->>P: "HTTP 422 insufficient balance"
else Sufficient funds
MONEY-->>API: "Hold funds at partner NET rate"
API->>OP: "Submit ticket order to operator"
alt Operator issues tickets successfully
OP-->>API: "Return electronic ticket identifiers"
API->>WH: "Dispatch booking.issuedTicket"
API-->>P: "Booking transitions to Issued (10)"
else Operator rejects or encounters error
OP-->>API: "Report issuance error"
API->>MONEY: "Release held funds"
API->>WH: "Dispatch booking.issuedTicketError"
API-->>P: "Booking transitions to Issue Error (6)"
end
end

The table below summarizes the actions at each step:

StepYour systemFerry APIPartner takeaway
1Call confirm ticket issuanceChecks rate limit (max 5 calls/60s per IP + bookingId) and passenger completenessIncomplete passenger info is rejected immediately with code 120145
2Await execution lockSecures a 600-second lock on the bookingConcurrent calls return HTTP 422 processing (120100)
3Await balance check and holdTemporarily reserves funds based on partner NET rateInsufficient credit at any ancestor tier halts issuance
4Await operator communicationInvokes operator engine to issue ticketsProcessing latency varies by operator on Production
5Receive response or poll statusAdvances booking to status 10 upon completionUse periodic polling as your final verification checkpoint
6Download electronic ticketsServes issued operator ticket PDFsDeliver finalized e-tickets to passengers

The per-booking lock prevents concurrent issuance processes, but it is not an idempotency key for the entire call. There is no advance notification of lock expiry. If balance checks fail, funds already held are released; after issuance failure, refund timing is not guaranteed. Background reconciliation skips bookings already at status 10, so finalizing that state is safe to repeat.

The flowchart below outlines how to verify issuance outcomes accurately:

flowchart TD
A["Call ticket confirmation endpoint"] --> B{"Response outcome"}
B -- "Success" --> C["Booking transitions to status 10"]
B -- "Error reported" --> D["Inspect error code to retry or abort"]
B -- "Timeout / Processing" --> E["Switch to periodic verification"]
E --> F["Receive ticket issued webhook event"]
E --> G["Poll booking details API"]
F --> G
G --> H{"Booking status"}
H -- "Status 10 (Issued)" --> C
H -- "Other status" --> I["Await background reconciliation or contact Ferry"]
C --> J["Download tickets and deliver to passenger"]

Coordinating Webhooks and Polling:

  • Webhooks as signals: Webhooks are HMAC-signed and retried up to 3 times on transient errors, enabling fast UI updates. However, deliveries can still be delayed or drop after the final attempt.
  • Polling as the source of truth: Calling the booking detail API (GET /bookings/{id}) is the authoritative verification. When the status is 10 (Issued), tickets are confirmed on the carrier system.
  • Automated background reconciliation: If communication drops while the operator is processing, Ferry’s background worker reconciles with the operator and updates the order status within a few minutes.

Complete passenger information required before issuance

Section titled “Complete passenger information required before issuance”

Calling POST /bookings/confirmToIssue/{id} on a booking with missing required passenger details is rejected immediately with HTTP 422 and error code 120145 (PassengerInfoIncomplete), before holding balance or contacting the operator. Do not retry confirmation blindly on 120145; ensure complete passenger details are present first.

Partial issuance failures on multi-leg bookings

Section titled “Partial issuance failures on multi-leg bookings”

On round-trip or multi-leg bookings, one leg may issue successfully while a subsequent leg is rejected by the operator:

  • The booking does not transition to status 10; it retains an error state.
  • Your balance is partially debited for the leg that issued successfully, while the failed leg amount is refunded.
  • Resolution procedure: Inspect individual leg orders inside the booking (GET /bookings/{id}) to identify issued legs, then contact Ferry with the booking code. Do not create replacement bookings or retry confirmation to repair a partial failure: confirmation reruns the entire chain, not just the missing leg.

Ferry recalculates all fare components at the moment ticket confirmation is called rather than locking in search-time prices. If operator tariffs or addition rules have changed, the actual debited amount will reflect the latest recalculation. See Ticket pricing and multi-level markup.

On the partner integration tier, you cannot create or confirm orders directly via the Orders API group. The entire order lifecycle must be driven through the Bookings group. The Orders group is provided solely to inspect details of individual leg orders.

Partners also have no dedicated standalone invoice read API, despite receiving events such as invoice.created, invoice.updated, invoice.published, and invoice.failed (with lookup metadata attached to the order once published). Do not design an invoice event handler that calls a standalone partner invoice endpoint; see Webhooks.

Eight ticketing operators, four schedule-only operators

Section titled “Eight ticketing operators, four schedule-only operators”

Among the 12 real ferry operators connected to Ferry on Production (MaiLinhExpress has been removed):

  • 8 operators support ticket issuance: Seven fully automated operators (PhuQuocExpress, SuperDong, GreenLines, Lightning68, HoaBinhShip, PhuQuyExpress, ChanKhaLuxury) plus CangSaKy (connected to the operator system with semi-automated handoff). Some carriers can take 5–8 minutes to finish; automated issuance does not guarantee sub-second responses.
  • 4 operators support schedule and fare lookup only: Binh An Ha Tien (BinhAnHaTien), Thanh Thoi (ThanhThoi), Hang Chau Tourist (HangChauTourist), and Saigon WaterGo (SaiGonWaterGo). Bookings for these 4 operators can be created on Production, but confirming ticket issuance returns an unimplemented error. Filter out these carriers or arrange manual booking through Ferry operations.

On the UAT environment, only simulated uatexpress accepts bookings and ticket issuance; attempting to issue tickets on real operators in UAT is rejected.

If a booking’s ticket file encountered an initial download glitch or a passenger needs another copy, call the ticket re-download endpoint (GET /bookings/download-ticket/{id}). This applies only to bookings that have already issued tickets, returning the issued ticket files without creating new orders or incurring charges.

SymptomProbable causeRecommended actionRetry safe
HTTP 422 code 120145 (PassengerInfoIncomplete)Booking is missing required passenger detailsEnsure complete, valid passenger details are provided before issuingDo not retry until completed
HTTP 422 code 120100 reported as processing600-second lock currently held for this bookingWait several minutes and poll booking statusYes, after waiting
Exceeded 5 calls/60s cap (429 or 120140)Repeated confirmation attempts on the same bookingIdWait out the 60-second window and inspect booking status firstYes, after 60 seconds
Insufficient balance errorPartner account or an upstream parent lacks creditTop up balance or request credit increase from parentYes, after funding
Unimplemented connector or UAT blocked operatorVoyage belongs to the 4 lookup-only operators (Prod) or a real operator on UATSwitch to uatexpress on UAT; use Ferry operations on ProductionDo not retry via API
Request hangs without respondingOperator engine connection slow (takes 5–8 minutes)Do not abort; switch to periodic status pollingDo not issue new call
Booking failed but balance partially debitedPartial issuance failure on a multi-leg bookingInspect individual leg orders and contact Ferry supportDo not create duplicate

To inspect exact request schemas and test calls directly, open the Scalar UI under the relevant tags:

CapabilityScalar tag
Confirm ticket issuance and re-download ticket filesBookings
Inspect list and details of individual leg ordersOrders
View passenger details linked to ticketsCustomers

For instructions on configuring your API key in Scalar, see API Reference.

PageRelated topic
The booking flowBooking lifecycle and payment timers
Payments and balancesBalance deduction mechanics and credit limits
WebhooksReal-time event notifications for ticket issuance
Cancellation and refundsTicket cancellation procedures and refund terms
EnvironmentsThe uatexpress UAT sandbox and 12 Production operators