Saltar al contenido

Vuelos

Exchange step 2: what exchanging the listed tickets onto an offer would cost. No side effects.

post/v1/flights/orders/{orderId}/exchange/quote

  • Requiere autenticación

Parámetros

NombreUbicaciónTipoDescripción
orderId*rutastring

Cuerpo de la solicitudExchangeRequest

  • offerIdstring
  • ticketNumbersstring[]

    E-ticket numbers to exchange. Every ticket listed must belong to the order.

  • couponNumbersinteger (int32)[]admite null

    Coupon numbers (1-based) being replaced, one per slice of the new itinerary. Default [1].

  • Contact
    • emailstring
    • phonestring

      E.164 or national with dial code.

  • remarkstringadmite null
Ejemplo
{
  "offerId": "string",
  "ticketNumbers": [
    "string"
  ],
  "couponNumbers": [
    1
  ],
  "contact": {
    "email": "string",
    "phone": "string"
  },
  "remark": "string"
}

Respuestas

200OKFlightOrder

  • orderIdstring
  • bookingReferencestringadmite null
  • statusstring

    held | ticketed | cancelled | voided | refunded | pending | exchanged | expired | unknown.

  • ticketTimeLimitstring (date-time)admite 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
    • genderstringadmite null
    • dateOfBirthstringadmite null
    • nationalitystringadmite null
    • Ticket[]
  • Contact
    • emailstring
    • phonestring

      E.164 or national with dial code.

  • priceChangedboolean
  • canCancelbooleanadmite null
  • 400Bad RequestDetalles del problema según RFC 7807
  • 404Not FoundDetalles del problema según RFC 7807

Ejemplos de código

Programas completos que firman la solicitud tal como la verifica la pasarela. Sustituya YOUR_KEY_ID y 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",
  "ticketNumbers": [
    "string"
  ],
  "couponNumbers": [
    1
  ],
  "contact": {
    "email": "string",
    "phone": "string"
  },
  "remark": "string"
}'
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/quote\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/quote" \
  -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"