Build (lock) a train fare

Lock and return a fully-priced train fare. Confirms the price with the provider before booking. The returned fare is valid for a limited time window.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

POST body for /v1/trains/fares/build.

string
required
length ≥ 1

Mercury UUID for the fare to lock (the fareId field emitted by POST /v1/trains/fares). This is the outbound fare in both one-way and round-trip locks; for a round-trip, pair it with inboundFareId.

Mercury UUID for the selected inbound fare (round-trip trains only). When present, Mercury combines fareId (outbound) and this inbound fare into a single round-trip fare. Multi-leg companions for each direction are expanded from the fare-lock cache; body lockSearchFareIds are ignored for round trips. Omit for a one-way / single-leg lock.

array | null

Provider search-fare ids to lock (one per leg). When omitted, Mercury resolves them from the fare-search cache populated by the SSE stream.

Mercury UUID for the outbound search solution (optional lineage context).

string
required

SHA-256 solution key for lineage tracking — the outbound fare's solution key received from the fares stream. Required; omitting it returns HTTP 422.

Responses

401

Missing or invalid authentication

404

Fare not found

410

Fare expired; refresh fare search

422

Invalid fare parameters

503

Train fare provider unavailable

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json