항공
Create an order (hold) from an offer. Requires an `Idempotency-Key` header.
post/v1/flights/orders
- 인증 필요
- Idempotency-Key 필요
요청 본문FlightOrderCreateRequest
- offerIdstring
- Passenger[]
- typestring
ADT | CHD | INF.
- genderstring
M | F.
- firstNamestring
- lastNamestring
- dateOfBirthstringnull 허용
yyyy-MM-dd.
- nationalitystringnull 허용
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
}
]
}응답
201CreatedFlightOrder
- orderIdstring
- bookingReferencestringnull 허용
- statusstring
held | ticketed | cancelled | voided | refunded | pending | exchanged | expired | unknown.
- ticketTimeLimitstring (date-time)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
- genderstringnull 허용
- dateOfBirthstringnull 허용
- nationalitystringnull 허용
- Ticket[]
- Contact
- emailstring
- phonestring
E.164 or national with dial code.
- priceChangedboolean
- canCancelbooleannull 허용
- 402Payment RequiredRFC 7807 문제 세부 정보
- 409ConflictRFC 7807 문제 세부 정보
코드 예제
게이트웨이가 검증하는 방식 그대로 요청에 서명하는 완전한 프로그램입니다. YOUR_KEY_ID와 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"