Hoppa till innehållet

Flyg

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

  • Kräver autentisering

Parametrar

NamnPlatsTypBeskrivning
orderId*sökvägstring

Anropets innehållExchangeSearchRequest

  • FlightSlice[]
    • originstring

      IATA airport or city code.

    • destinationstring
    • departureDatestring

      yyyy-MM-dd.

  • PassengerCounts
    • adultsinteger (int32)
    • childreninteger (int32)
    • infantsinteger (int32)
  • couponNointeger (int32)kan vara null

    Coupon of the ticket being replaced (1-based). Default 1.

Exempel
{
  "slices": [
    {
      "origin": "string",
      "destination": "string",
      "departureDate": "string"
    }
  ],
  "passengers": {
    "adults": 1,
    "children": 1,
    "infants": 1
  },
  "couponNo": 1
}

Svar

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.

    • validatingCarrierstringkan vara 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.

    • refundablebooleankan vara null
    • passportRequiredboolean
    • selfTransferboolean
    • charterboolean
    • tripTypestringkan vara null
  • 400Bad RequestProblemdetaljer enligt RFC 7807
  • 404Not FoundProblemdetaljer enligt RFC 7807

Kodexempel

Kompletta program som signerar anropet på det sätt som gatewayen verifierar det. Ersätt YOUR_KEY_ID och 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"