Letovi
Exchange step 1: search replacement itineraries for a ticketed order. Offers come back in the search shape and expire the same way.
post/v1/flights/orders/{orderId}/exchange/search
- Zahtijeva autentifikaciju
Parametri
| Naziv | Mjesto | Tip | Opis |
|---|---|---|---|
| orderId* | putanja | string |
Tijelo zahtjevaExchangeSearchRequest
- FlightSlice[]
- originstring
IATA airport or city code.
- destinationstring
- departureDatestring
yyyy-MM-dd.
- PassengerCounts
- adultsinteger (int32)
- childreninteger (int32)
- infantsinteger (int32)
- couponNointeger (int32)može biti null
Coupon of the ticket being replaced (1-based). Default 1.
Primjer
{
"slices": [
{
"origin": "string",
"destination": "string",
"departureDate": "string"
}
],
"passengers": {
"adults": 1,
"children": 1,
"infants": 1
},
"couponNo": 1
}Odgovori
200OKFlightSearchResponse
- searchIdstring
- statusstring
in_progress | complete.
- cursorinteger (int32)
- suppliersDoneinteger (int32)
- supplierCountinteger (int32)
- FlightOffer[]
- offerIdstring
- expiresAtstring (date-time)
UTC ISO-8601; the offer must be priced/booked before this.
- validatingCarrierstringmože biti null
- Slice[]
- PassengerPricing[]
- 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.
- refundablebooleanmože biti null
- passportRequiredboolean
- selfTransferboolean
- charterboolean
- tripTypestringmože biti null
- 400Bad RequestPojedinosti problema prema RFC 7807
- 404Not FoundPojedinosti problema prema RFC 7807
Primjeri koda
Cjeloviti programi koji potpisuju zahtjev onako kako ga gateway provjerava. Zamijenite YOUR_KEY_ID i 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='{
"slices": [
{
"origin": "string",
"destination": "string",
"departureDate": "string"
}
],
"passengers": {
"adults": 1,
"children": 1,
"infants": 1
},
"couponNo": 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/ZnVWRmFQNlNQQlE5V0N2bHZnPT0/exchange/search\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/ZnVWRmFQNlNQQlE5V0N2bHZnPT0/exchange/search" \
-H "X-API-Key: $KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Nonce: $NONCE" \
-H "X-Signature: $SIG" \
-H "Content-Type: application/json" \
-d "$BODY"