GraphQL API

Endpoint, authentication, and the custom Travel Agent queries and mutations.

GraphQL is served at /api/graphql. The checked-in schema.graphql is the reference for a revision.

Authentication

Sessions use the keystonejs-session cookie. Sign in with authenticateUserWithPassword. Each operator operation checks the caller's role flags on the server. See Roles and permissions. Public operations use no session.

The custom operations return a JSON value (TravelJSON). Operator mutations take one input object. Every operator mutation requires idempotencyKey inside input.

Public queries

QueryArgumentsReturns
publicDestinationsnoneDestination name, slug, country, specialty
publicDestinationslugOne destination
viewProposaltokenTrip title, intro, options with items. Moves sent to viewed
viewItinerarytokenTrip title, dates, days, items
viewInvoicetokenNumber, status, totals, due date, lines, trip title and code
lookupBookingemail, codeTrip number, title, status, dates, invoice status and amounts. Needs both
redirectToInitnoneTrue while there are no users

Public mutations

MutationArgumentsPurpose
submitInquiryinputCreate an inquiry with status new
acceptProposaltoken, optionId, name, idempotencyKeyAccept an option and create components
payInvoicetoken, idempotencyKeyCreate a Stripe payment intent and return its client secret
confirmInvoicePaymenttoken, paymentIntentIdCheck the intent with Stripe and record the payment

Operator mutations

Each takes input and needs the flag shown. Replays with the same key return the stored result.

MutationFlagInput highlights
createTripFromInquirycanManageTripsinquiryId, optional title
buildProposalcanManageTripstripId, introNote, options with items
sendProposalcanManageTripsproposalId. Returns the link token once
bookComponentcanManageTripscomponentId, netCostCents, confirmationNumber, optional commissionBps, paymentModel
cancelComponentcanManageTripscomponentId; optional refundCents, paymentId, reason, approvalId
shareItinerarycanManageTripstripId. Returns the link token once
transitionTripcanManageTripstripId, status
sweepTripDatescanManageTripsMoves trips by date
generatePaymentSchedulecanManagePaymentstripId
issueClientInvoicecanManagePaymentstripId, lines, optional dueAt. Returns the link token once
recordClientPaymentcanManagePaymentsinvoiceId, amountCents, method (check, wire, cash), reference
recordSupplierPaymentcanManagePaymentscomponentId, amountCents, method, reference
postClientFundsEntrycanManagePaymentstripId, entryType (only transfer_planning_fee), amountCents
reverseEntrycanManagePaymentsentryId, reason (only transfer_planning_fee entries)
recordCommissionReceiptcanManageCommissionssupplierId, amountCents, reference, allocations (each componentId, amountCents, and approvalId plus reason for an over-payment)
writeOffCommissioncanManageCommissionscomponentId, reason, approvalId
refundClientPaymentcanIssueRefundspaymentId, amountCents, reason, optional approvalId

Approval mutations

MutationArgumentsPurpose
requestManagerApprovalactionType, targetId, amountCents, reasonRequest an approval. Returns its id
decideManagerApprovalapprovalId, decision (approved or rejected)Decide as a different user with canManageSettings

Setup mutations

ensureTravelOnboardingPhase (phase, template) and setOnboardingStatus (status) need canManageOnboarding.

Reads

Use the generated list queries (trips, tripComponents, clientInvoices, and so on) with an explicit field selection. They return only what the caller's role allows. The dashboard uses them for every page.

Errors

Operations throw a plain message for expected failures, such as "Client balance must be zero before this status". See Troubleshooting.

On this page