Uçuşlar
Cancel: a held order is released; a ticketed order is voided inside the void window, else refunded.
post/v1/flights/orders/{orderId}/cancel
- Autentifikasiya tələb olunur
- Idempotency-Key tələb olunur
Parametrlər
| Ad | Yer | Tip | Təsvir |
|---|---|---|---|
| orderId* | yol | string |
Sorğunun gövdəsiCancelRequest
- reasonstringnull ola bilər
Nümunə
{
"reason": "string"
}Cavablar
200OKFlightOrder
- orderIdstring
- bookingReferencestringnull ola bilər
- statusstring
held | ticketed | cancelled | voided | refunded | pending | exchanged | expired | unknown.
- ticketTimeLimitstring (date-time)null ola bilər
- 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 ola bilər
- dateOfBirthstringnull ola bilər
- nationalitystringnull ola bilər
- Ticket[]
- Contact
- emailstring
- phonestring
E.164 or national with dial code.
- priceChangedboolean
- canCancelbooleannull ola bilər
Kod nümunələri
Sorğunu şlüzün yoxladığı qaydada imzalayan tam proqramlar. YOUR_KEY_ID və YOUR_SECRET dəyərlərini əvəz edin.
# Sign the request: METHOD \n path+query \n unix time \n nonce \n sha256(body)
KEY_ID="YOUR_KEY_ID"
SECRET="YOUR_SECRET"
BODY='{
"reason": "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/cancel\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/cancel" \
-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"