feat(offer-requests): expose split-ticket itineraries#1165
Open
todor-a wants to merge 1 commit into
Open
Conversation
Adds support for the split-ticket itineraries flow on POST /air/offer_requests: - New body field `include_split_ticket` on `CreateOfferRequest`, which opts a multi-slice offer request into the per-slice fan-out the API performs to find split-ticket candidates. - New `view` query parameter (`'offers' | 'itineraries'`) on `CreateOfferRequestQueryParameters`. When set to `itineraries`, the response is grouped per slice into itineraries and fare brands. - New response types covering the itineraries view: `OfferRequestItinerariesView`, `OfferRequestItinerariesViewSlice`, `Itinerary`, `ItineraryBrand`, `ItineraryOffer` and the `ItineraryOfferType` discriminator (`'single_ticket' | 'split_ticket'`). - `OfferRequests.create` returns a conditional type based on the `view` parameter so itineraries-view callers get the grouped shape and offers-view callers retain the existing typing (including the `return_offers: false` discriminator). See https://duffel.com/docs/guides/selling-split-ticket-itineraries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exposes the split-ticket itineraries flow on
POST /air/offer_requests.CreateOfferRequest.include_split_ticket?: boolean— opts into the per-slice fan-out.CreateOfferRequestQueryParameters.view?: 'offers' | 'itineraries'—itinerariesreturns offers grouped per slice / itinerary / fare brand; required to surface split-ticket candidates.OfferRequestItinerariesView,OfferRequestItinerariesViewSlice,Itinerary,ItineraryBrand,ItineraryOffer,ItineraryOfferType('single_ticket' | 'split_ticket').OfferRequests.createreturns a conditional type soview: 'itineraries'callers get the grouped shape; the existingreturn_offers: falsediscriminator is preserved.Pricing and booking re-use the existing
Offers.get/Orders.createresources.Tests: 3 new specs in
OfferRequests.spec.ts(body forwarding, query forwarding + response parsing, noviewleak when omitted). Full suite 138/138,tsc --noEmitclean, lint clean.Note:
origin/destinationon the itineraries-view slice are typed asPlaceto matchOfferRequestSlice; the guide's abbreviated example shows bare ID strings — worth a check against a live response.