● Travel Never Stops. Neither Do We. 365 Days a Year.

Bus API Cancellations and Refunds

Plan bus booking cancellations with supplier-specific seat and lead-passenger rules, status tracking, cancellation fees and refund reconciliation.

Coach service representative speaking with a passenger at the terminal

A reliable bus api cancellation workflow separates eligibility checks, supplier cancellation, refund authorization, payment movement, and reconciliation. The customer may request one seat, but the operator may only permit cancellation of the complete ticket. A refund estimate is not proof that seats were released, and a supplier confirmation is not proof that money reached the customer's card.

This implementation guide uses a fictional three-seat booking to show how a travel platform should validate selections, handle restrictive policies, execute safely, and explain the final amount. All booking identifiers, prices, timestamps, states, and responses in the worked example are illustrative, not TravelTech365 customer history, production telemetry, or statements about a named supplier's commercial terms.

Separate the decisions before changing a booking

Cancellation is not one transaction. The application first determines what the traveler wants, then whether that request is permitted, then what the supplier will return. Only after an accepted cancellation should its payment service attempt a refund or another approved remedy. Keeping these decisions separate prevents a successful quote screen from being mistaken for a completed cancellation.

The implementation needs distinct records for the booking, selected ticket seats, cancellation attempt, supplier response, merchant refund obligation, and payment transaction. Each record should retain its own status and identifiers. Otherwise, a delayed processor response can overwrite a valid supplier result, or a support agent can confuse a non-refundable convenience charge with an operator cancellation penalty.

  • Eligibility: Does the operator permit this ticket, passenger set, journey leg, and request time to be cancelled?
  • Quotation: What amount, deductions, method, and validity apply to the exact selection?
  • Execution: Did the supplier accept and record cancellation for those same seats?
  • Disbursement: Has the platform instructed the appropriate payment channel to return the approved amount?
  • Settlement: Do supplier statements, processor transactions, and internal liabilities agree?

Read supplier documentation without overgeneralizing

eTravelSmart documents preview and execution separately

The official eTravelSmart bus API integration documentation distinguishes a pre-cancellation confirmation operation, cancelTicketConfirmation, from the execution operation, cancelTicket. Both accept a ticket number and a list of seat numbers. Its preview response describes cancellation eligibility, partial-cancellation eligibility, charges, and refund amounts. The execution call follows confirmation. This is useful evidence for a two-stage adapter, not a guarantee that every provider implements identical behavior.

The same documentation shows partialCancellationAllowed in bus availability details. Treat it as a capability signal for the selected service and recheck against the booked ticket or supplier quote where supported. A search response can be stale, while a ticket-specific restriction can be more precise. The example below uses a normalized field; it does not assert that all vendors expose the same spelling or response shape.

TekTravels illustrates policy data and cancellation requests

The official TekTravels bus API documentation shows search-result fields such as PartialCancellationAllowed and cancellation-policy entries with charges and time ranges. Its navigation also identifies bus cancellation through change-request submission and retrieval. Developers should map those concepts to their own adapter rather than assuming the same endpoint sequence or payloads as eTravelSmart.

Busbud describes the retail experience, not a universal API rule

The official Busbud account cancellation support article describes choosing a trip, then a specific leg or passenger when the operator permits it. It also identifies differences by ticket type, timing, and operator policy, and describes possible original-payment refunds, credits, or vouchers. This is retail-support evidence only. It does not specify an integration contract, an entitlement to partial cancellation, or refund timing for another platform.

Define a fictional booking and its financial boundaries

Assume a single fictional ticket DEMO-BUS-316 covers three occupied seats on one journey: 8A belongs to the lead passenger, 8B to a companion, and 8C to another companion. The traveler first requests cancellation of 8B only. This request is one selected seat, not an instruction to cancel the entire booking. The booking reference and roles are invented solely for implementation testing.

For 8B alone, assume an illustrative base fare of 40 currency units and tax of 4, all charged to the original card. The quoted operator cancellation fee is 11. Therefore the seat-related card refund is 40 + 4 − 11 = 33. A distinct merchant booking fee of 3 was also charged and is retained under the fictional disclosed terms. Show that fee separately; do not silently subtract it from the supplier's calculated refund.

Illustrative 8B checkout and cancellation calculation; one seat, currency units, not a supplier tariff
Component Amount Treatment
Seat base fare 40 Included in refundable seat consideration
Seat tax 4 Assumed refundable in this illustration only
Operator cancellation fee 11 Deducted from the seat amount
Original-card seat refund 33 40 + 4 − 11; subject to supplier confirmation
Separate booking fee 3 Retained independently under disclosed example terms
Original 8B-related charge 47 44 seat amount + 3 booking fee
Amount not refunded 14 11 operator fee + 3 retained booking fee

This arithmetic is valid only because the example explicitly assumes the entire tax portion is part of the refundable calculation. A real operator might treat taxes, service fees, commissions, discounts, vouchers, or cancellation taxes differently. Record the supplier's returned basis and approved amount rather than deriving a final refund solely from a policy percentage.

Model selected seats, partial permissions, and lead-passenger dependencies

Store passenger identity separately from seat labels, because seat assignments can change and vendors can represent a passenger using a ticket-line identifier rather than a seat number. Preserve original seat-to-passenger mappings for cancellation auditing. Before quoting, confirm that every requested item belongs to the ticket, remains active, and is not already included in an open cancellation attempt.

For the first request, the normalized selection is exactly ["8B"]. Never construct the execution payload by selecting all seats from the ticket after the customer has chosen only one. When a supplier supports passenger-specific cancellation, preserve the supplier identifiers in addition to user-facing labels. Match those identifiers again immediately before submission.

Block partial requests when the operator prohibits them

In a test branch where partialCancellationAllowed is false, a request for 8B alone must not proceed to cancellation execution. Show a clear explanation that this supplier does not permit the requested partial change, and, if supported, offer a separate full-ticket quote. Do not silently upgrade the selected seat to all three seats. A full-ticket alternative requires new visible scope and fresh customer consent.

When the flag is true, that only allows the platform to attempt the relevant eligibility or quote operation. Other rules may still reject the request. A valid implementation treats capability, booking policy, time window, and quote acceptance as separate gates.

Treat the lead passenger rule as conditional

Seat 8A is the lead passenger. Some contractual or technical arrangements may require the lead to remain attached to a partial booking, may require transferring a lead designation, or may allow the lead seat to be cancelled normally. There is no justified universal prohibition on cancelling a lead passenger. The adapter must follow the applicable operator rule, and if no reliable rule is available it must obtain clarification rather than invent a restriction.

For this fictional branch, assume the operator explicitly requires 8A to remain while 8B or 8C is retained. A selection of 8A alone is therefore blocked pending a permitted alternative. In another valid configuration, the supplier may accept 8A and reassign 8B as lead. The application should support both behaviors as configuration-backed outcomes, never hardcoded assumptions about bus travel generally.

Service employee checking seating inside an intercity coach

Work through each cancellation branch before building the endpoint

The following branch matrix is a filled fictional test fixture. It deliberately changes individual supplier permissions while keeping the same three-seat booking. Each row is a separate scenario, not a sequence of actual passenger requests. Expected results describe platform decisions, not confirmed vendor behavior.

Illustrative branch matrix for DEMO-BUS-316; scope is one fictional ticket and independent test conditions
Scenario Selected seats Given rule or event Expected platform action Customer-visible result
A: allowed partial 8B Partial allowed; quote approved for 33 Request explicit consent, then execute 8B only 8B cancellation pending supplier confirmation
B: partial blocked 8B partialCancellationAllowed=false Do not send execution; optionally offer new full-ticket quote Single-seat cancellation unavailable
C: conditional lead 8A This test operator requires lead to remain Block or obtain authorized lead reassignment Alternative review required
D: multiple companions 8B, 8C Partial allowed; new supplier quote required Quote both exact seats; never reuse 8B-only price Combined amount shown before approval
E: full ticket 8A, 8B, 8C Full cancellation permitted Quote and execute whole selection after consent All three seats affected
F: quote expired 8B Provider validity elapsed or amount changed Obtain fresh quote and consent; do not execute stale amount Updated refund details requested
G: response uncertain 8B Execution timed out after submission Freeze duplicate execution; reconcile supplier state Request being verified, not yet final
H: already cancelled 8B Supplier shows same seat previously cancelled Associate existing result with original attempt No second refund or repeat cancellation

Build a quote contract that explains exactly what can change

Create an internal quote response containing the local booking ID, supplier ticket reference, requested passenger and seat identifiers, eligibility flags, currency, fare basis, applicable deductions, gross refundable amount, separately retained merchant fees, expected payment method, and quote expiry when provided. Record the raw supplier response securely for later support and financial investigations.

For example, the 8B confirmation screen can say: “Cancel seat 8B; expected refund 33 to the original card; operator cancellation charge 11; merchant booking fee 3 retained.” This is a proposed outcome, not final settlement. Display any condition that might change the amount and block execution if the user does not approve the current quote.

When the provider supplies an explicit expiry, persist the timestamp with its timezone or normalized instant. Before execution, ensure it remains valid, considering the provider's clock and any expiry semantics. When no expiry is documented, use a conservative local refresh policy, clearly labeled as an internal safeguard rather than a vendor guarantee. A newly retrieved quote supersedes the old consent if material amounts or selected seats change.

Avoid currency and rounding errors

Use decimal money types or integer minor units based on the currency's precision. Never use binary floating-point values for settlement comparisons. Do not assume all currencies have two decimal places. Store the displayed currency and the settlement currency independently when payment and supplier accounts differ; foreign-exchange differences require their own treatment rather than being concealed in cancellation charges.

Use a server-side cancellation service rather than permitting a browser to call supplier credentials directly. Start with a read-only verification of booking ownership, channel, active state, travel date, seat selection, and permissible action. Then invoke the supplier-specific pre-cancel or quote operation if available. A quote-only response must not change the local ticket to cancelled.

Persist an immutable consent record containing the shown amount, selected seats, disclosed retained fees, quote reference or fingerprint, policy version, and acceptance time. If the supplier has no stable quote identifier, fingerprint normalized commercial fields and the exact seat selection. This fingerprint is internal audit evidence, not a substitute for supplier-side authorization.

At execution, obtain a concurrency lock on the ticket or the affected ticket lines, verify that the accepted quote matches the intended operation, and create an attempt with a unique idempotency key. A database constraint should prevent simultaneous active attempts for overlapping seats. A separate attempt can be made after reconciliation or explicit failure, but only after the previous attempt's outcome is known.

Illustrative orchestration pseudocode

The following is platform-side pseudocode, not the request format of eTravelSmart, TekTravels, or Busbud. Supplier adapters translate its normalized operations into supported vendor calls.

function requestCancellation(ticketId, selectedSeats, consentId):
  assertAuthorizedCustomer(ticketId)
  selection = canonicalizeAndValidate(selectedSeats)
  withLock(ticketId):
    ticket = loadCurrentTicket(ticketId)
    rejectIfInactiveOrOverlappingAttempt(ticket, selection)
    quote = loadAcceptedQuote(consentId)
    assertSameTicketAndSeats(quote, ticket, selection)
    assertEligibleAndUnexpired(quote)
    attempt = createUniqueAttempt(ticket, selection, quote)
  try:
    response = supplierAdapter.executeCancellation(attempt)
  catch transportUncertainty:
    markOutcomeUnknown(attempt)
    enqueueReadOnlySupplierVerification(attempt)
    return status("verification_pending")
  if response.provesCancellationFor(selection):
    recordSupplierConfirmation(attempt, response)
    authorizeRefundObligation(attempt, response)
    enqueuePaymentRefund(attempt)
    return status("supplier_confirmed")
  if response.provesDefinitiveRejection():
    markRejectedWithoutRefund(attempt, response)
    return status("rejected")
  markOutcomeUnknown(attempt)
  enqueueReadOnlySupplierVerification(attempt)
  return status("verification_pending")

The pseudocode deliberately does not issue a second supplier cancellation from the uncertainty handler. If a provider offers an idempotency token, pass a stable token supported by its contract. If it does not, platform-side deduplication plus read-only retrieval and escalation are mandatory safeguards; a repeated network request might otherwise cancel another portion or create conflicting records.

Resolve uncertain outcomes rather than guessing

A timeout means the client did not receive a conclusive response. It does not mean the supplier failed to process the cancellation. The request may have reached the supplier, executed, and lost its response on the return path. Blind retries are especially dangerous when the vendor does not promise idempotent cancellation execution.

Mark the attempt OUTCOME_UNKNOWN, stop new overlapping requests, and retrieve booking details or cancellation status through a supported read operation. Compare supplier ticket reference, requested seats, per-seat cancellation status, cancellation time, and any transaction reference. If the result cannot be verified programmatically, send it to an operations queue with the raw correlation ID and timestamp.

Reconciliation may reveal that 8B was cancelled, remained active, or acquired an inconsistent status. In the first case, record the confirmed result and proceed to payment. In the second, allow a new quote only after establishing that the original operation did not execute. In the third, escalate; never manufacture success or failure from a generic HTTP code.

Deduplicate across customer clicks and workers

Use the same local attempt ID across button double-clicks, browser refreshes, queue redelivery, and internal retry logic. Persist a unique key derived from booking identity, canonical selected-seat set, operation version, and accepted consent. Do not base the key solely on a transient browser session, which cannot protect a server worker restart.

Distinguish a repeat status lookup from a new execution request. Lookup can be repeated within provider limits; execution requires proof that repetition is safe. Expiring a user interface request does not clear an unresolved supplier-side attempt. Operational tooling must expose the lock owner, age, and safe override procedure.

Keep cancellation confirmation separate from card refund

A supplier may confirm cancellation while the merchant still owes the traveler 33. Track SUPPLIER_CONFIRMED independently from REFUND_SUBMITTED, REFUND_SUCCEEDED, and REFUND_FAILED. The local booking can show seat 8B cancelled while the money section correctly says “refund processing.” This distinction makes support messages accurate and prevents prematurely closing accounting cases.

Only the party entitled and technically able to refund the original transaction should initiate the card refund. For merchant-of-record flows, this may be the travel platform's payment integration; in another commercial arrangement, the supplier, consolidator, or payment facilitator may control disbursement. Confirm ownership contractually rather than building two systems that each refund the same amount.

In the illustrative merchant-controlled card flow, issue 33 against the original payment transaction associated with 8B. Keep the retained booking fee 3 as a distinct accounting component and retain the operator cancellation charge 11 as a separate deduction category. Record processor refund identifiers and actual processing states. Do not claim arrival in the customer's bank based on API acceptance alone.

Reconcile one filled settlement from original charge to refund

The settlement illustration assumes the platform collected 47 for 8B-related items, the operator accepted cancellation and an 11 fee, and the merchant is responsible for returning 33 to the original card. It does not assert when a supplier transfers money to the merchant or how their contract nets commission. Those are separate reconciliation events that must be matched to actual statements.

Illustrative 8B settlement ledger; scope is the customer-facing gross charge and refund, not provider commission or bank settlement
Ledger stage Customer card flow Open position Evidence to retain
Original seat fare and tax 47 total collected including fee 44 seat consideration; 3 separate merchant fee Order lines and original processor charge
Supplier quote for 8B 0 additional movement Proposed seat refund 33; fee 11 Selected seats, quote, consent and validity
Supplier cancellation confirmed 0 additional movement Refund obligation 33; not yet paid Supplier cancellation reference and 8B status
Processor refund submitted 33 refund instruction Customer repayment in progress Refund ID, original charge link and amount
Processor refund succeeded 33 returned through card channel Customer-facing refund obligation cleared Processor final state and settlement entry
Final customer-facing net 14 retained from original 47 11 operator fee; 3 merchant booking fee Fee ledger, tax basis and customer statement
Supplier-to-merchant reconciliation No new customer card movement Match supplier credit or net settlement separately Supplier statement, adjustment and accounting entry

The table intentionally separates a supplier's commercial credit from the customer's card refund. If the supplier records a credit of 33 but the processor rejects the refund, the platform still has an unresolved customer liability. If the processor returns 33 and the supplier ledger is missing a corresponding adjustment, the customer may be settled while the platform has an outstanding supplier reconciliation item.

Notify the customer without overstating completion

Use event-driven notifications that reflect the state actually reached. At quote time, show the requested seats, anticipated refund, deductions, payment destination, and expiry. After the user confirms, acknowledge receipt of the cancellation request. After supplier confirmation, say which seats were cancelled and whether the refund has been initiated. After processor completion, send the final refund status with the amount and transaction reference when available.

For the example, a supplier-confirmed message might read: “Seat 8B has been cancelled. We have initiated a refund of 33 to your original card. The operator cancellation fee is 11, and the separate booking fee of 3 remains retained.” The phrase “initiated” must only be used once the payment request was actually submitted; before then say the refund is being prepared.

Never message passengers in 8A and 8C as though their tickets were cancelled when the operation covered only 8B. However, notify the booking contact of any itinerary, manifest, or lead-passenger implications where appropriate. Mask payment identifiers, minimize personal data, and ensure support transcripts do not expose supplier credentials or complete card details.

Build operational visibility and safe support controls

Log structured events for quote requested, quote received, consent accepted, execution submitted, supplier outcome recorded, refund obligation created, refund submitted, processor outcome recorded, and reconciliation completed. Attach correlation identifiers and timestamps to each event. Avoid storing raw sensitive personal information in general-purpose logs; keep restricted supplier payloads in an access-controlled audit store with appropriate retention policies.

Operations screens should display the current authoritative ticket state beside the pending financial state. Allow agents to retrieve supplier details, request a fresh quote when safe, record vendor case references, and escalate mismatched results. A manual override must require a reason, actor, timestamp, and approval appropriate to the financial risk. It should not simply set REFUND_SUCCEEDED without payment evidence.

Test the contract and failure paths before release

Contract tests should verify the actual provider's permitted seat identifiers, request authentication, response success semantics, policy fields, rate limits, booking retrieval, cancellation endpoint behavior, and refund reporting arrangements. A successful sample response copied from documentation is not proof that production credentials support the same operator or inventory. Obtain provider-approved test cases for eligible, ineligible, partial, and expired requests.

Exercise the three-seat fixture with 8B allowed, 8B disallowed, the conditional lead restriction for 8A, both companions selected, and all seats selected. Then simulate quote expiry, changed fees, a cancellation response arriving after a timeout, an already-cancelled seat, refund rejection, webhook duplication, and missing supplier settlement. Confirm that only the selected seats change and only one card refund obligation is created.

Verification and handoff checklist

  • Confirm the provider contract and operator-specific partial-cancellation, time-window, passenger, and lead-passenger rules.
  • Verify exact seat selection, supplier ticket identifiers, and the blocked partialCancellationAllowed=false branch.
  • Check that preview never executes cancellation and that consent covers current seats, amount, fees, and quote expiry.
  • Validate 8B's illustrative arithmetic: fare 40, tax 4, operator charge 11, card refund 33, and separately retained booking fee 3.
  • Prove duplicate clicks, worker retries, and uncertain supplier responses cannot trigger an unsafe second execution.
  • Verify booking retrieval or manual investigation resolves an unknown result before a new cancellation attempt is permitted.
  • Confirm supplier cancellation evidence is stored separately from refund authorization, processor submission, and payout outcome.
  • Match the original payment, one refund obligation, processor records, supplier adjustments, and final fee ledger.
  • Review customer messages for accurate seat scope, refund method, charge disclosure, and non-promissory processing status.
  • Hand over provider field mappings, test fixtures, failure runbooks, audit retention rules, escalation owners, and sign-off records.