{"openapi":"3.0.3","info":{"title":"AL-Taj Booking API","description":"NestJS-based booking API for the AL-Taj flight booking platform.\n\nThis service owns user accounts, authentication, flight search & booking, post-booking\noperations (cancellation, reissue, ancillaries), wallet checks, markup, maintenance\nstate, and admin/ops workflows. It is the **only** service that talks to Tripjack.\n\nSee companion docs:\n- `TechArchitecture.md` for service responsibilities and lifecycle diagrams.\n- `TechStack.md` for technology choices.\n- `SECURITY_REVIEW.md` for security requirements.\n- `BOOKING_LIFECYCLE_TEST_PLAN.md` for test scenarios that reference these endpoints.\n","version":"1.0.0-draft","contact":{"name":"AL-Taj Engineering","email":"engineering@altajtours.example"},"license":{"name":"Proprietary"}},"servers":[{"url":"http://localhost:5000","description":"Local dev"},{"url":"https://staging-api.altajtours.example","description":"Staging (Tripjack UAT + Razorpay test)"},{"url":"https://api.altajtours.example","description":"Production"}],"tags":[{"name":"health","description":"Liveness, readiness, maintenance state."},{"name":"auth","description":"Register, login, logout, refresh, password reset."},{"name":"me","description":"Current authenticated user."},{"name":"flights","description":"Search, revalidate, fare rules, seat maps (pre-booking)."},{"name":"bookings","description":"Create, view, confirm-hold, cancel, reissue, ancillaries."},{"name":"admin","description":"Ops/admin workflows. Requires OPS_STAFF or SUPER_ADMIN role."},{"name":"internal","description":"Service-to-service. Not for external callers."}],"security":[{"sessionCookie":[]},{"bearerJwt":[]}],"paths":{"/health":{"get":{"tags":["health"],"summary":"Liveness probe","description":"Returns 200 if the process is alive. No authentication required.","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/health/maintenance":{"get":{"tags":["health"],"summary":"Maintenance state","description":"Returns the active maintenance flag, if any. Public (no authentication) so that\nthe frontend banner can poll it. Refreshed every 60 seconds by the client.\n","security":[],"responses":{"200":{"description":"Maintenance state retrieved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaintenanceState"},"examples":{"clear":{"value":{"blocking":false,"advisory":null,"message":null,"since":null}},"blocking":{"value":{"blocking":true,"advisory":null,"message":"Bookings are temporarily paused. We will be back shortly.","since":"2026-05-25T14:00:00Z"}}}}}}}}},"/auth/register":{"post":{"tags":["auth"],"summary":"Register a new customer","description":"Creates a CUSTOMER user. Sends a welcome email. Sets `altaj_at` + `altaj_rt`\nhttpOnly cookies on success. See ADR-003.\n","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"},"example":{"email":"customer@example.com","password":"SecurePass!2026","name":"Anaya Patel","whatsappNumber":"+919876543210"}}}},"responses":{"201":{"description":"Registered. Cookies set on the response.","headers":{"Set-Cookie":{"schema":{"type":"string"},"description":"Two cookies — `altaj_at` (access token) and `altaj_rt` (refresh token)."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"409":{"description":"Email already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"error":{"code":"EMAIL_EXISTS","message":"An account with this email already exists."},"requestId":"4f6ac482-c2f4-43b3-bdab-0ea32d4f1b24"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Log in","description":"Authenticates a user. Sets `altaj_at` + `altaj_rt` httpOnly cookies. Rate-limited\nto 5 requests / 15 min / IP and 10 requests / hour / user.\n","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"},"example":{"email":"customer@example.com","password":"SecurePass!2026"}}}},"responses":{"200":{"description":"Logged in.","headers":{"Set-Cookie":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"Invalid credentials (does not distinguish bad-password vs unknown-email).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"error":{"code":"AUTH_INVALID_CREDENTIALS","message":"Invalid email or password."},"requestId":"4f6ac482-c2f4-43b3-bdab-0ea32d4f1b24"}}}},"403":{"description":"User deactivated or email unverified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/auth/logout":{"post":{"tags":["auth"],"summary":"Log out","description":"Clears auth cookies and revokes the refresh token server-side.","responses":{"204":{"description":"Logged out."},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh access token","description":"Reads the refresh token from `altaj_rt` cookie, rotates it, returns a new access token\nand sets new cookies. Rate-limited to 30 / hour / user.\n","security":[],"responses":{"200":{"description":"Token refreshed.","headers":{"Set-Cookie":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/auth/password/reset-request":{"post":{"tags":["auth"],"summary":"Request a password reset","description":"Sends a reset link by email. **Always returns 202**, regardless of whether the\nemail exists, to avoid email-enumeration. See SECURITY_REVIEW §4.3.4.\n","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}}}}},"responses":{"202":{"description":"Reset email sent if the address is registered."}}}},"/auth/password/reset":{"post":{"tags":["auth"],"summary":"Complete a password reset","description":"One-time use; link expires in 30 minutes.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","newPassword"],"properties":{"token":{"type":"string","description":"From the reset email."},"newPassword":{"type":"string","format":"password","minLength":12}}}}}},"responses":{"204":{"description":"Password updated."},"410":{"description":"Token expired or already used.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/me":{"get":{"tags":["me"],"summary":"Current user","responses":{"200":{"description":"Current user profile.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/User"},"error":{"type":"object","nullable":true},"requestId":{"type":"string","format":"uuid"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/flights/search":{"post":{"tags":["flights"],"summary":"Search flights","description":"Calls Tripjack `POST /fms/v1/air-search-all` server-side, applies markup, returns\nitineraries with `grossFare` (never `netFare`). Rate-limited 60/min/user.\nSee BOOKING_LIFECYCLE_TEST_PLAN scenarios B1–B24.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlightSearchRequest"},"example":{"tripType":"ONE_WAY","cabinClass":"ECONOMY","passengers":{"adults":1,"children":0,"infants":0},"legs":[{"origin":"DEL","destination":"MAA","departureDate":"2026-07-16"}],"filters":{"directOnly":false,"airlines":[]}}}}},"responses":{"200":{"description":"Search results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlightSearchResponse"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/ProviderError"},"503":{"$ref":"#/components/responses/MaintenanceActive"}}}},"/flights/revalidate":{"post":{"tags":["flights"],"summary":"Revalidate a selected itinerary","description":"Calls Tripjack `POST /fms/v1/review` to confirm price and inventory before booking.\nReturns the canonical `bookingId` to be used in `POST /bookings`.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["priceIds"],"properties":{"priceIds":{"type":"array","items":{"type":"string"},"example":["5-4774531427_0DELMAA6E933~212687954260207"]}}}}}},"responses":{"200":{"description":"Revalidated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevalidateResponse"}}}},"410":{"description":"Inventory lost; search again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"error":{"code":"BOOKING_LCC_INVENTORY_LOST","message":"The selected fare is no longer available. Please search again."},"requestId":"0b1477ea-b813-4bba-8bf6-beee4dd8f2eb"}}}},"502":{"$ref":"#/components/responses/ProviderError"}}}},"/flights/fare-rules":{"post":{"tags":["flights"],"summary":"Get fare rules for an itinerary","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["priceIds"],"properties":{"priceIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Fare rules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FareRulesResponse"}}}}}}},"/flights/seat-map":{"post":{"tags":["flights"],"summary":"Get seat map for a (revalidated) booking","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["bookingId"],"properties":{"bookingId":{"type":"string","example":"TJS109802367467"}}}}}},"responses":{"200":{"description":"Seat map.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatMapResponse"}}}}}}},"/bookings":{"get":{"tags":["bookings"],"summary":"List the current user's bookings","parameters":[{"in":"query","name":"status","schema":{"$ref":"#/components/schemas/BookingStatus"}},{"in":"query","name":"limit","schema":{"type":"integer","default":20,"minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"},"description":"Opaque pagination cursor from a previous response."}],"responses":{"200":{"description":"List of bookings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingListResponse"}}}}}},"post":{"tags":["bookings"],"summary":"Create a new booking","description":"End-to-end booking creation. Caller must supply a verified `paymentTransactionId`\n(obtained via payment-api). Wallet sufficiency is checked before the Tripjack call.\nIdempotent via `Idempotency-Key` header.\n\nSee BOOKING_LIFECYCLE_TEST_PLAN scenarios E1–E16 (happy paths) and F1–F19 (failure paths).\n","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookingRequest"}}}},"responses":{"201":{"description":"Booking accepted; polling started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingResponse"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"402":{"description":"Payment not verified or amount mismatch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency conflict (same key, different body).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"LCC inventory lost; retry candidates exhausted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"$ref":"#/components/responses/ProviderError"},"503":{"$ref":"#/components/responses/MaintenanceActive"}}}},"/bookings/{publicId}":{"get":{"tags":["bookings"],"summary":"Get a booking","parameters":[{"$ref":"#/components/parameters/PublicId"}],"responses":{"200":{"description":"Booking found.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}}}}},"404":{"description":"Not found OR not yours (no existence-leak).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/bookings/{publicId}/confirm-hold":{"post":{"tags":["bookings"],"summary":"Confirm a held booking","description":"Calls Tripjack `POST /oms/v1/air/fare-validate` then `POST /oms/v1/air/confirm-book`.\nRequires the customer to have paid via Razorpay (verified via paymentTransactionId).\n","parameters":[{"$ref":"#/components/parameters/PublicId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paymentTransactionId"],"properties":{"paymentTransactionId":{"type":"integer"}}}}}},"responses":{"202":{"description":"Confirmation accepted; polling started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingResponse"}}}},"410":{"description":"Hold expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Fare changed at fare-validate; user must re-confirm new amount.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/bookings/{publicId}/cancellation-charges":{"get":{"tags":["bookings"],"summary":"Quote cancellation charges","description":"Wraps Tripjack `POST /oms/v1/air/amendment/amendment-charges` with `type: CANCELLATION`.","parameters":[{"$ref":"#/components/parameters/PublicId"}],"responses":{"200":{"description":"Charges quoted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancellationChargesResponse"}}}},"400":{"description":"Non-cancellable fare or already cancelled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/bookings/{publicId}/cancel":{"post":{"tags":["bookings"],"summary":"Submit a cancellation","description":"Submits a Tripjack cancellation amendment and starts polling. Only the booking owner\nor OPS_STAFF/SUPER_ADMIN can cancel.\nSee test scenarios I1–I18.\n","parameters":[{"$ref":"#/components/parameters/PublicId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["remarks"],"properties":{"remarks":{"type":"string","maxLength":256}}}}}},"responses":{"202":{"description":"Cancellation accepted; polling started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendmentResponse"}}}},"404":{"description":"Not found OR not yours."}}}},"/bookings/{publicId}/reissue/search":{"post":{"tags":["bookings"],"summary":"Start a reissue search","parameters":[{"$ref":"#/components/parameters/PublicId"}],"responses":{"202":{"description":"Reissue search started.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"requestId":{"type":"string","example":"1700469938"}}},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}}}}}}}},"/bookings/{publicId}/reissue/options":{"get":{"tags":["bookings"],"summary":"Poll reissue options","parameters":[{"$ref":"#/components/parameters/PublicId"},{"in":"query","name":"requestId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Available reissue options (may still be empty if still searching).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReissueOptionsResponse"}}}}}}},"/bookings/{publicId}/reissue/confirm":{"post":{"tags":["bookings"],"summary":"Confirm reissue","parameters":[{"$ref":"#/components/parameters/PublicId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["priceId"],"properties":{"priceId":{"type":"string"},"paymentTransactionId":{"type":"integer","description":"Required if reissue results in a positive fare difference."}}}}}},"responses":{"202":{"description":"Reissue accepted; polling started."}}}},"/bookings/{publicId}/ancillaries":{"get":{"tags":["bookings"],"summary":"Fetch ancillary catalogue","parameters":[{"$ref":"#/components/parameters/PublicId"}],"responses":{"200":{"description":"Available SSR + seat options.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AncillariesCatalogueResponse"}}}}}},"post":{"tags":["bookings"],"summary":"Add ancillaries","parameters":[{"$ref":"#/components/parameters/PublicId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddAncillariesRequest"}}}},"responses":{"202":{"description":"Ancillary amendment accepted; polling started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendmentResponse"}}}}}}},"/bookings/{publicId}/poll":{"get":{"tags":["bookings"],"summary":"Manually trigger a poll","description":"Used by the frontend during the booking flow to fetch the latest state. Internally\nequivalent to fetching the booking; the name reflects the customer's mental model.\n","parameters":[{"$ref":"#/components/parameters/PublicId"}],"responses":{"200":{"description":"Latest booking state.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}}}}}}}},"/admin/wallet/balance":{"get":{"tags":["admin"],"summary":"Current Tripjack agency wallet balance","description":"Requires OPS_STAFF or SUPER_ADMIN role.","responses":{"200":{"description":"Balance.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"walletBalance":{"type":"number","format":"float","example":4962295.0},"totalBalance":{"type":"number","format":"float","example":4962295.0},"currency":{"type":"string","example":"INR"},"fetchedAt":{"type":"string","format":"date-time"}}},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}}}}},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/admin/maintenance":{"get":{"tags":["admin"],"summary":"Get current maintenance flag (full detail)","responses":{"200":{"description":"Maintenance flag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaintenanceFlag"}}}}}},"post":{"tags":["admin"],"summary":"Set the maintenance flag","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason","severity","message"],"properties":{"reason":{"$ref":"#/components/schemas/MaintenanceReason"},"severity":{"$ref":"#/components/schemas/MaintenanceSeverity"},"message":{"type":"string"}}}}}},"responses":{"201":{"description":"Maintenance flag set."}}},"delete":{"tags":["admin"],"summary":"Clear the maintenance flag","description":"Verifies wallet balance is now sufficient before clearing if reason was WALLET_INSUFFICIENT.","responses":{"204":{"description":"Cleared."},"400":{"description":"Wallet still insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/markup":{"get":{"tags":["admin"],"summary":"Current markup configuration","responses":{"200":{"description":"Active MarkupConfig.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupConfig"}}}}}},"patch":{"tags":["admin"],"summary":"Update markup","description":"Requires SUPER_ADMIN. Writes a MarkupChangeLog row with old + new values + reason.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["percentValue","reason"],"properties":{"percentValue":{"type":"number","format":"float","minimum":0,"maximum":50},"reason":{"type":"string","maxLength":256}}}}}},"responses":{"200":{"description":"Markup updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkupConfig"}}}},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/admin/bookings/stuck":{"get":{"tags":["admin"],"summary":"List STUCK bookings","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","default":50,"minimum":1,"maximum":200}}],"responses":{"200":{"description":"List.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingListResponse"}}}}}}},"/admin/bookings/{publicId}/force-poll":{"post":{"tags":["admin"],"summary":"Force a poll for a STUCK booking","parameters":[{"$ref":"#/components/parameters/PublicId"}],"responses":{"202":{"description":"Poll re-enqueued."}}}},"/internal/payments/verified":{"post":{"tags":["internal"],"summary":"Payment verification callback (from payment-api)","description":"Called by `payment-api` after Razorpay signature verification. Authenticated via an\ninternal service token (`X-Service-Token` header), not the user's JWT. **Not for\nexternal callers.**\n","security":[{"internalServiceToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentVerifiedCallback"}}}},"responses":{"200":{"description":"Acknowledged; PaymentTransaction recorded."},"401":{"description":"Invalid service token."}}}}},"components":{"securitySchemes":{"sessionCookie":{"type":"apiKey","in":"cookie","name":"altaj_at","description":"Default session token. Set on login as `HttpOnly; Secure; SameSite=Strict`.\nSee ADR-003.\n"},"bearerJwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Alternative for non-browser clients. Same JWT as the cookie."},"internalServiceToken":{"type":"apiKey","in":"header","name":"X-Service-Token","description":"Service-to-service. Used by payment-api → altaj-api only."}},"parameters":{"PublicId":{"in":"path","name":"publicId","required":true,"schema":{"type":"string","example":"ALT-FLT-2026-000123"},"description":"Customer-facing booking ID."},"IdempotencyKey":{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","format":"uuid"},"description":"Required on all booking-write endpoints. Replays with the same key return the cached\nresponse (within 24h TTL); replays with different bodies return 409.\n"}},"responses":{"Unauthorized":{"description":"Missing, expired, or invalid auth.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"error":{"code":"AUTH_MISSING_TOKEN","message":"Authentication required."},"requestId":"4f6ac482-c2f4-43b3-bdab-0ea32d4f1b24"}}}},"Forbidden":{"description":"Authenticated but role insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ValidationFailed":{"description":"Request body or parameters failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"error":{"code":"VALIDATION_FAILED","message":"Request validation failed.","details":[{"field":"email","reason":"must be a valid email"}]},"requestId":"4f6ac482-c2f4-43b3-bdab-0ea32d4f1b24"}}}},"RateLimited":{"description":"Too many requests.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry is allowed."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ProviderError":{"description":"Upstream Tripjack error or timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"error":{"code":"BOOKING_PROVIDER_ERROR","message":"We couldn't reach the airline system. Please try again.","providerError":{"provider":"TRIPJACK","errCode":"8038","message":"Seat Selection is Mandatory"}},"requestId":"7730510e-9c7b-4c77-850e-5e75186c9c32"}}}},"MaintenanceActive":{"description":"Wallet kill-switch active or other blocking maintenance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"data":null,"error":{"code":"BOOKING_WALLET_INSUFFICIENT","message":"Bookings are temporarily paused. Please try again later."},"requestId":"4f6ac482-c2f4-43b3-bdab-0ea32d4f1b24"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["data","error","requestId"],"properties":{"data":{"type":"object","nullable":true},"error":{"$ref":"#/components/schemas/ApiError"},"requestId":{"type":"string","format":"uuid"}}},"ApiError":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Internal error code (see TechArchitecture §7.5).","enum":["AUTH_INVALID_CREDENTIALS","AUTH_MISSING_TOKEN","AUTH_INVALID_TOKEN","AUTH_TOKEN_EXPIRED","AUTH_FORBIDDEN","AUTH_INACTIVE","AUTH_EMAIL_UNVERIFIED","EMAIL_EXISTS","PASSWORD_BREACHED","RESET_EXPIRED","RESET_USED","VALIDATION_FAILED","BOOKING_NOT_FOUND","BOOKING_INVALID_STATE","BOOKING_WALLET_INSUFFICIENT","BOOKING_LCC_INVENTORY_LOST","BOOKING_SEAT_REQUIRED","BOOKING_NON_CANCELLABLE","BOOKING_ALREADY_CANCELLED","BOOKING_CANCEL_WINDOW_PASSED","BOOKING_PROVIDER_ERROR","BOOKING_PROVIDER_UNAVAILABLE","BOOKING_PROVIDER_TIMEOUT","PAYMENT_NOT_VERIFIED","PAYMENT_VERIFICATION_FAILED","PAYMENT_AMOUNT_MISMATCH","PAYMENT_BOOKING_MISMATCH","IDEMPOTENCY_CONFLICT","INVALID_AMENDMENT_TYPE","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string","description":"Human-readable; safe to display to end users."},"details":{"description":"Optional per-field validation errors or context.","type":"array","items":{"type":"object"}},"providerError":{"$ref":"#/components/schemas/ProviderErrorDetail"}}},"ProviderErrorDetail":{"type":"object","properties":{"provider":{"type":"string","enum":["TRIPJACK","RAZORPAY"]},"errCode":{"type":"string"},"message":{"type":"string"},"details":{"type":"string"}}},"HealthResponse":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"version":{"type":"string","example":"1.0.0"},"uptime":{"type":"number","example":12345.67}}},"MaintenanceState":{"type":"object","properties":{"blocking":{"type":"boolean"},"advisory":{"type":"boolean","nullable":true},"message":{"type":"string","nullable":true},"since":{"type":"string","format":"date-time","nullable":true}}},"MaintenanceFlag":{"allOf":[{"$ref":"#/components/schemas/MaintenanceState"},{"type":"object","properties":{"reason":{"$ref":"#/components/schemas/MaintenanceReason"},"severity":{"$ref":"#/components/schemas/MaintenanceSeverity"},"createdBy":{"type":"integer","nullable":true}}}]},"MaintenanceReason":{"type":"string","enum":["WALLET_INSUFFICIENT","TRIPJACK_OUTAGE","RAZORPAY_OUTAGE","PLANNED_MAINTENANCE","MANUAL_OVERRIDE"]},"MaintenanceSeverity":{"type":"string","enum":["ADVISORY","BLOCKING"]},"RegisterRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email","maxLength":254},"password":{"type":"string","format":"password","minLength":12},"name":{"type":"string","maxLength":64},"whatsappNumber":{"type":"string","pattern":"^\\+?[0-9]{8,15}$"}}},"LoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"}}},"AuthResponse":{"type":"object","required":["data","error","requestId"],"properties":{"data":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"accessTokenExpiresAt":{"type":"string","format":"date-time"}}},"error":{"type":"object","nullable":true},"requestId":{"type":"string","format":"uuid"}}},"User":{"type":"object","properties":{"id":{"type":"integer"},"email":{"type":"string","format":"email"},"name":{"type":"string","nullable":true},"whatsappNumber":{"type":"string","nullable":true},"role":{"$ref":"#/components/schemas/Role"},"isActive":{"type":"boolean"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"Role":{"type":"string","enum":["SUPER_ADMIN","OPS_STAFF","AGENCY_AGENT","CUSTOMER"]},"FlightSearchRequest":{"type":"object","required":["tripType","cabinClass","passengers","legs"],"properties":{"tripType":{"type":"string","enum":["ONE_WAY","ROUND_TRIP","MULTI_CITY"]},"cabinClass":{"type":"string","enum":["ECONOMY","PREMIUM_ECONOMY","BUSINESS","FIRST"]},"passengers":{"type":"object","properties":{"adults":{"type":"integer","minimum":1,"maximum":9},"children":{"type":"integer","minimum":0,"maximum":8},"infants":{"type":"integer","minimum":0,"maximum":4}}},"legs":{"type":"array","minItems":1,"maxItems":6,"items":{"type":"object","required":["origin","destination","departureDate"],"properties":{"origin":{"type":"string","minLength":3,"maxLength":3,"example":"DEL"},"destination":{"type":"string","minLength":3,"maxLength":3,"example":"MAA"},"departureDate":{"type":"string","format":"date"}}}},"filters":{"type":"object","properties":{"directOnly":{"type":"boolean","default":false},"airlines":{"type":"array","items":{"type":"string"}}}}}},"FlightSearchResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"itineraries":{"type":"array","items":{"$ref":"#/components/schemas/Itinerary"}},"meta":{"type":"object","properties":{"searchId":{"type":"string"},"resultCount":{"type":"integer"},"markupAppliedPercent":{"type":"number","format":"float"}}}}},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}},"Itinerary":{"type":"object","properties":{"priceId":{"type":"string","example":"5-4774531427_0DELMAA6E933~212687954260207"},"grossFare":{"type":"number","format":"float","example":5990.0},"currency":{"type":"string","example":"INR"},"isRefundable":{"type":"boolean"},"airlines":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","example":"6E"},"name":{"type":"string","example":"IndiGo"},"isLcc":{"type":"boolean"}}}},"segments":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}},"totalDurationMinutes":{"type":"integer"},"stops":{"type":"integer"}}},"Segment":{"type":"object","properties":{"segmentNumber":{"type":"integer"},"airlineCode":{"type":"string"},"airlineName":{"type":"string"},"isLcc":{"type":"boolean"},"flightNumber":{"type":"string"},"equipmentType":{"type":"string"},"from":{"type":"object","properties":{"code":{"type":"string","example":"DEL"},"name":{"type":"string","example":"Delhi Indira Gandhi Intl"},"city":{"type":"string","example":"Delhi"},"country":{"type":"string","example":"India"},"terminal":{"type":"string","example":"Terminal 1","nullable":true}}},"to":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"terminal":{"type":"string","nullable":true}}},"departureTime":{"type":"string","format":"date-time"},"arrivalTime":{"type":"string","format":"date-time"},"durationMinutes":{"type":"integer"},"cabinClass":{"type":"string"}}},"RevalidateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"bookingId":{"type":"string","example":"TJS109802367467"},"grossAmount":{"type":"number","format":"float"},"currency":{"type":"string","example":"INR"},"priceChanged":{"type":"boolean"},"delta":{"type":"number","format":"float","nullable":true}}},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}},"FareRulesResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","properties":{"heading":{"type":"string"},"text":{"type":"string"}}}},"baggage":{"type":"object","properties":{"included":{"type":"string","example":"15Kilograms"},"cabin":{"type":"string","example":"7 Kg"}}}}},"error":{"type":"object","nullable":true}}},"SeatMapResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"decks":{"type":"array","items":{"type":"object"}}}},"error":{"type":"object","nullable":true}}},"BookingStatus":{"type":"string","enum":["DRAFT","HOLD","HOLD_EXPIRED","PAYMENT_PENDING","PAYMENT_FAILED","BOOKING_IN_PROGRESS","SUCCESS","FAILED","CANCELLATION_REQUESTED","CANCELLED","REISSUED","STUCK"]},"CreateBookingRequest":{"type":"object","required":["bookingId","travelers","contact","paymentTransactionId"],"properties":{"bookingId":{"type":"string","description":"Tripjack bookingId from /flights/revalidate.","example":"TJS109802367467"},"bookingType":{"type":"string","enum":["INSTANT","HOLD"],"default":"INSTANT"},"travelers":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/TravelerInput"}},"contact":{"type":"object","required":["email","phone"],"properties":{"email":{"type":"string","format":"email"},"phone":{"type":"string","pattern":"^\\+?[0-9]{8,15}$"}}},"paymentTransactionId":{"type":"integer","description":"ID of a verified PaymentTransaction."}}},"TravelerInput":{"type":"object","required":["title","firstName","lastName","paxType","dob"],"properties":{"title":{"type":"string","enum":["Mr","Ms","Mrs","Mstr"],"example":"Mr"},"firstName":{"type":"string","maxLength":64,"example":"Anaya"},"lastName":{"type":"string","maxLength":64,"example":"Patel"},"paxType":{"type":"string","enum":["ADULT","CHILD","INFANT"]},"dob":{"type":"string","format":"date","example":"1990-01-01"},"passportNumber":{"type":"string","nullable":true},"passportExpiry":{"type":"string","format":"date","nullable":true},"nationality":{"type":"string","nullable":true,"example":"IN"}}},"BookingResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}},"BookingListResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Booking"}},"meta":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true}}}}},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}},"Booking":{"type":"object","properties":{"publicId":{"type":"string","example":"ALT-FLT-2026-000123"},"provider":{"type":"string","enum":["TRIPJACK"]},"providerBookingId":{"type":"string","nullable":true,"example":"TJS109802367467"},"providerPnr":{"type":"string","nullable":true,"example":"TESTPNR"},"bookingType":{"type":"string","enum":["INSTANT","HOLD"]},"status":{"$ref":"#/components/schemas/BookingStatus"},"holdExpiresAt":{"type":"string","format":"date-time","nullable":true},"netFare":{"type":"number","format":"float","description":"Visible only to staff."},"markupApplied":{"type":"number","format":"float","description":"Visible only to staff."},"grossFare":{"type":"number","format":"float"},"currency":{"type":"string","example":"INR"},"itinerary":{"$ref":"#/components/schemas/Itinerary"},"passengers":{"type":"array","items":{"$ref":"#/components/schemas/Traveler"}},"contact":{"type":"object","properties":{"email":{"type":"string","format":"email"},"phone":{"type":"string"}}},"createdAt":{"type":"string","format":"date-time"},"bookedAt":{"type":"string","format":"date-time","nullable":true},"cancelledAt":{"type":"string","format":"date-time","nullable":true}}},"Traveler":{"allOf":[{"$ref":"#/components/schemas/TravelerInput"},{"type":"object","properties":{"pnrPerSegment":{"type":"object","additionalProperties":{"type":"string"},"example":{"DEL-HYD":"TESTPNR","HYD-MAA":"TESTPNR"}}}}]},"CancellationChargesResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"charges":{"type":"number","format":"float"},"refundAmount":{"type":"number","format":"float"},"currency":{"type":"string","example":"INR"},"deadline":{"type":"string","format":"date-time","nullable":true}}},"error":{"type":"object","nullable":true}}},"AmendmentResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"amendmentId":{"type":"string","example":"8702367445"},"status":{"type":"string","enum":["REQUESTED","IN_PROGRESS","SUCCESS","FAILED"]}}},"error":{"type":"object","nullable":true},"requestId":{"type":"string"}}},"ReissueOptionsResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"ready":{"type":"boolean"},"options":{"type":"array","items":{"$ref":"#/components/schemas/Itinerary"}}}},"error":{"type":"object","nullable":true}}},"AncillariesCatalogueResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"ssr":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","example":"MEAL_VG"},"description":{"type":"string","example":"Vegetarian meal"},"price":{"type":"number","format":"float"}}}},"seats":{"type":"array","items":{"type":"object","properties":{"segmentNumber":{"type":"integer"},"seatNumber":{"type":"string","example":"14A"},"price":{"type":"number","format":"float"},"available":{"type":"boolean"}}}}}},"error":{"type":"object","nullable":true}}},"AddAncillariesRequest":{"type":"object","properties":{"ssrCodes":{"type":"array","items":{"type":"string"}},"seatSelections":{"type":"array","items":{"type":"object","properties":{"segmentNumber":{"type":"integer"},"passengerIndex":{"type":"integer"},"seatNumber":{"type":"string"}}}}}},"MarkupConfig":{"type":"object","properties":{"id":{"type":"integer"},"channel":{"type":"string","enum":["WEB","MOBILE","AGENT_PORTAL"]},"type":{"type":"string","enum":["FLAT_PERCENT","FIXED_PER_BOOKING","FIXED_PER_PAX","ALGORITHMIC_COMPETITIVE"]},"percentValue":{"type":"number","format":"float","nullable":true},"fixedAmount":{"type":"number","format":"float","nullable":true},"isActive":{"type":"boolean"},"effectiveFrom":{"type":"string","format":"date-time"},"effectiveTo":{"type":"string","format":"date-time","nullable":true}}},"PaymentVerifiedCallback":{"type":"object","required":["razorpayOrderId","razorpayPaymentId","razorpaySignature","amount","currency"],"properties":{"razorpayOrderId":{"type":"string"},"razorpayPaymentId":{"type":"string"},"razorpaySignature":{"type":"string"},"amount":{"type":"number","format":"float"},"currency":{"type":"string","example":"INR"},"bookingDraftPublicId":{"type":"string","nullable":true,"description":"I"}}}}}}