Penerbangan
Create an order (hold) from an offer. Requires an `Idempotency-Key` header.
post/v1/flights/orders
- Memerlukan pengesahan
- Memerlukan Idempotency-Key
Badan permintaanFlightOrderCreateRequest
- offerIdstring
- Passenger[]
- typestring
ADT | CHD | INF.
- genderstring
M | F.
- firstNamestring
- lastNamestring
- dateOfBirthstringboleh null
yyyy-MM-dd.
- nationalitystringboleh null
ISO 3166-1 alpha-2.
- Document
- Contact
- emailstring
- phonestring
E.164 or national with dial code.
- AncillarySelection[]
Extras to add to the order, chosen from GET /v1/flights/offers/{offerId}/ancillaries. Priced and ticketed with the order.
- keystring
The `key` of an option returned by the offer's ancillaries.
- passengerIndexinteger (int32)
0-based index into `passengers` — who the extra is for.
{
"offerId": "string",
"passengers": [
{
"type": "string",
"gender": "string",
"firstName": "string",
"lastName": "string",
"dateOfBirth": "string",
"nationality": "string",
"document": {
"type": "string",
"number": "string",
"issuingCountry": "string",
"expiryDate": "string",
"issueDate": "string"
}
}
],
"contact": {
"email": "string",
"phone": "string"
},
"ancillaries": [
{
"key": "string",
"passengerIndex": 1
}
]
}Respons
201CreatedFlightOrder
- orderIdstring
- bookingReferencestringboleh null
- statusstring
held | ticketed | cancelled | voided | refunded | pending | exchanged | expired | unknown.
- ticketTimeLimitstring (date-time)boleh null
- Money
Money on the wire: decimal string (never a float) + ISO 4217.
- amountstring
- currencystring
- PassengerPricing[]
- typestring
ADT | CHD | INF.
- quantityinteger (int32)
- Money
Money on the wire: decimal string (never a float) + ISO 4217.
- Money
Money on the wire: decimal string (never a float) + ISO 4217.
- Money
Money on the wire: decimal string (never a float) + ISO 4217.
- Tax[]
- Slice[]
- durationMinutesinteger (int32)
- Segment[]
- OrderPassenger[]
- typestring
- firstNamestring
- lastNamestring
- genderstringboleh null
- dateOfBirthstringboleh null
- nationalitystringboleh null
- Ticket[]
- Contact
- emailstring
- phonestring
E.164 or national with dial code.
- priceChangedboolean
- canCancelbooleanboleh null
- 402Payment RequiredButiran masalah RFC 7807
- 409ConflictButiran masalah RFC 7807
Contoh kod
Program lengkap yang menandatangani permintaan mengikut cara gateway mengesahkannya. Gantikan YOUR_KEY_ID dan YOUR_SECRET.
# Sign the request: METHOD \n path+query \n unix time \n nonce \n sha256(body)
KEY_ID="YOUR_KEY_ID"
SECRET="YOUR_SECRET"
BODY='{
"offerId": "string",
"passengers": [
{
"type": "string",
"gender": "string",
"firstName": "string",
"lastName": "string",
"dateOfBirth": "string",
"nationality": "string",
"document": {
"type": "string",
"number": "string",
"issuingCountry": "string",
"expiryDate": "string",
"issueDate": "string"
}
}
],
"contact": {
"email": "string",
"phone": "string"
},
"ancillaries": [
{
"key": "string",
"passengerIndex": 1
}
]
}'
TS=$(date +%s)
NONCE=$(openssl rand -hex 16)
BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 | sed 's/^.* //')
CANON=$(printf 'POST\n/v1/flights/orders\n%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")
SIG=$(printf '%s' "$CANON" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')
curl -X POST "https://api.dubaitrip.com/v1/flights/orders" \
-H "X-API-Key: $KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Nonce: $NONCE" \
-H "X-Signature: $SIG" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d "$BODY"