5-minute quick start
RideClaw Open Platform Quick Start
Run your first travel transaction in 5 steps: register an app, get your key, search flights, create an order and pay.
01
Register and create an app
Open the developer console, create an app and get your Sandbox API Key and Secret.
02
Set auth headers
Every request needs X-App-Key, X-Timestamp, X-Nonce and an HMAC-SHA256 signature.
03
Search flights
Call /open/v1/flight/search to get flight options and search_offer_id.
04
Price and book
Use the search_offer_id to call pricing, then create_flight_order to create the order.
05
Pay and poll
Use create_payment or the checkout link to pay, then query_payment_status to poll.
import { RideClaw } from "@rideclaw/sdk";
const rideclaw = new RideClaw({
apiKey: process.env.RIDECLAW_API_KEY,
baseURL: "https://api.longxiachuxing.com/open/v1",
});
async function main() {
// 1. 搜索航班
const search = await rideclaw.flight.search({
trip_mode: "domestic",
trip_type: "oneway",
from_code: "SZX",
to_code: "SHA",
depart_date: "2026-06-20",
passengers: { adult: 1 },
});
console.log(search.flights[0]);
// 2. 验价
const pricing = await rideclaw.flight.pricing({
search_offer_id: search.flights[0].cabins[0].search_offer_id,
passengers: [{ type: "adult", name: "张三", id_type: "ID_CARD", id_number: "...", phone: "..." }],
});
// 3. 创建订单
const order = await rideclaw.flight.createOrder({
offer_id: pricing.offer_id,
idempotency_key: "demo_001",
contact: { name: "张三", phone: "13800138000" },
passengers: [{ type: "adult", name: "张三", id_type: "ID_CARD", id_number: "...", phone: "..." }],
});
console.log(order.system_no, order.checkout_url);
}Next steps
- Read the authentication docs to learn HMAC signing and Bearer Token auth.
- Check the MCP Server docs to expose search/book tools to your AI agent.
- View API call logs and error overview in the developer console.