Chapter 13.4 — Refund Workflow
Context
A refund is the orchestrated sequence that reverses some or all of a sold service, accounting for supplier-side refundability, customer-side payback, commission recall, and tax adjustments. Text definition in Chapter 4.3.
Roles
| Role | Involvement |
|---|---|
| Customer | Requests; receives payback |
| Agent | Initiates; communicates with customer |
| Approver | Approves above-threshold refunds |
| Accountant | Confirms payback path; posts JE |
| Supplier | Confirms refundability; provides refund amount |
| System | Computes quote; posts JE; triggers payback |
Pre-conditions
- Original booking in
ISSUEDorPARTIALLY_USEDstate. - Permission
refund.create.partneron the agent. - Customer is the original payer (or successor by assignment).
Sequence — Standard voluntary refund
sequenceDiagram
autonumber
actor Cust as Customer
actor Ag as Agent
actor Apr as Approver
actor Acc as Accountant
participant API as travoBooks API
participant DB as MySQL
participant Sup as Supplier (GDS / NDC)
participant GW as Gateway
Cust->>Ag: Request refund — booking TVB-2026-000123
Ag->>API: POST /refunds/quote {booking_id, scope}
API->>Sup: Refund-quote query (fare rules, penalty)
Sup-->>API: Refundable: BDT 54,300; penalty BDT 11,100
API->>DB: INSERT refund_quotes (state=QUOTED)
API-->>Ag: Quote details + breakdown
Ag->>Cust: Communicate net payback
Cust->>Ag: Approve
Ag->>API: POST /refunds (quote_id)
API->>API: Check refund threshold
alt Over threshold
API->>DB: state=PENDING_APPROVAL
API->>Apr: Notify
Apr->>API: Approve
API->>DB: state=APPROVED
else Within threshold
API->>DB: state=APPROVED (auto)
end
API->>Sup: Refund_Process
alt Supplier accepts
Sup-->>API: Confirmation + supplier_refund_ref
API->>DB: BEGIN TX
API->>DB: INSERT journal_entries (reversal + penalty retention)
API->>DB: UPDATE booking_tickets state=REFUNDED
API->>DB: UPDATE refund state=PAYBACK_PENDING
API->>DB: Commission recall (Dr 4011 / Cr 1109)
API->>DB: COMMIT
else Supplier rejects
Sup-->>API: Rejection reason
API->>DB: state=SUPPLIER_REJECTED
API->>Ag: Notify with reason
end
Acc->>API: Initiate payback (gateway reversal / wire / customer credit)
alt Gateway path
API->>GW: Refund payment_intent
GW-->>API: refund.succeeded webhook (async)
API->>DB: state=COMPLETED
else Bank transfer
Acc->>API: Confirm wire executed
API->>DB: state=COMPLETED
else Customer credit
API->>DB: Increase customer_credit_balance
API->>DB: state=COMPLETED
end
API->>Cust: Email refund confirmation + receipt
State machine
stateDiagram-v2
[*] --> REQUESTED
REQUESTED --> QUOTED: Supplier quote
QUOTED --> APPROVED: Within threshold (auto)
QUOTED --> PENDING_APPROVAL: Over threshold
PENDING_APPROVAL --> APPROVED: Approver OK
PENDING_APPROVAL --> REJECTED: Approver declines
APPROVED --> SUPPLIER_PROCESSING: Refund_Process
SUPPLIER_PROCESSING --> SUPPLIER_APPROVED
SUPPLIER_PROCESSING --> SUPPLIER_REJECTED
SUPPLIER_APPROVED --> PAYBACK_PENDING
PAYBACK_PENDING --> COMPLETED
SUPPLIER_REJECTED --> [*]
REJECTED --> [*]
COMPLETED --> [*]
Decision points
flowchart TD
A[Refund request received] --> B[Fare rules check]
B --> C{Refundable?}
C -->|No| D[NON_REFUNDABLE — tax/unused portion only]
C -->|Yes| E[Quote: gross - penalty - fees]
D --> F[Tax-only quote]
E --> G{Service-date passed?}
F --> G
G -->|No| H[Reverse deferred — no P&L impact for recognised portion]
G -->|Yes| I[Reverse recognised — current period revenue reduction]
H --> J[Process payback]
I --> J
J --> K{Original payment method}
K -->|Gateway| L[Gateway reversal]
K -->|Bank wire| M[Outgoing wire]
K -->|Cash| N[Cash refund — drawer]
K -->|Customer credit| O[Add to wallet]
L --> P[Mark COMPLETED]
M --> P
N --> P
O --> P
Refund types
| Type | Code | Treatment |
|---|---|---|
| Voluntary full | VOL_FULL |
Full refund less penalty |
| Voluntary partial | VOL_PARTIAL |
Per-segment / per-pax partial |
| Involuntary (carrier-caused) | INVOL |
Full refund, no penalty; carrier reimburses |
| Tax-only | TAX_ONLY |
For non-refundable fares — only taxes |
| No-show | NO_SHOW |
Usually no refund; tax-only at best |
| Schedule-change refund | SKCHG |
Treated like involuntary |
| Goodwill waiver | WAIVER |
Operator-discretion; requires approval |
Financial side-effects
For a typical voluntary full refund of an EK round-trip BDT 65,400 with BDT 7,200 commission:
Pre-service-date:
Reverse customer-side:
Debit 2011 BSP Payable EK 58,300 (refundable to supplier side; less penalty)
Debit 4031 Service Fee Revenue 1,000 (if non-refundable to customer)
Credit 1101 AR — Customer 54,300 (net of penalty)
Credit 4041 Cancellation Fee Revenue 5,000 (penalty kept)
(Plus tax line reversal)
Commission recall:
Debit 2031 Deferred Air Revenue 7,200
Credit 1109 Commission Receivable 7,200
Post-service-date (recognised commission):
Commission recall affects current-period:
Debit 4011 Air Base Commission 7,200
Credit 1109 Commission Receivable 7,200
Cross-references
- Chapter 4.3 — Refunds & Cancellations (text)
- Chapter 5.2 — Journals & Ledger
- Chapter 5.7 — Deferred Revenue
- Chapter 5.8 — Commission Accounting (recall)
- Chapter 7.1 — GDS (refund endpoint)