RahalCorporate
OrdersConcepts

Corporate Direct Bookings

Company billing with integrated policy and budget evaluation

Corporate Direct Bookings

Corporate Direct is a special payment provider for business travel where the company is billed directly instead of the employee paying. It integrates with Rahal's policy and budget systems to enforce company travel rules.

How It Works

Unlike consumer payment providers, Corporate Direct:

  1. Bypasses payment processing — No card or wallet payment required
  2. Evaluates policies — Checks company travel policies before booking
  3. Enforces budgets — Reserves and tracks budget consumption
  4. Bills the company — Company receives an invoice for all employee bookings

Booking Flow

Policy Integration

Before a corporate direct order is created, the system evaluates the booking against the user's assigned policy.

Policy Actions

ActionBehavior
ALLOWBooking proceeds without intervention
WARN_AND_ALLOWBooking proceeds, violation logged
REQUIRE_APPROVALCreates a booking request instead
BLOCKBooking rejected with error message

What Gets Checked

  • Flights: Route rules, cabin class, duration tiers, budget limits
  • Hotels: Location rules, star ratings, daily rate limits

Policy violations are logged even for allowed bookings. This data feeds into compliance reporting and analytics.

Blocking Behavior

If any item in the booking is blocked by policy, the entire order is rejected:

ForbiddenException: Booking blocked by company policy:
air item 1: Cabin class FIRST not allowed for this route

Budget Integration

After policy evaluation, the system checks the user's budget allocation.

Budget Reservation Flow

  1. Evaluation: Check if user has sufficient budget
  2. Reservation: Reserve budget amount when order is created
  3. Confirmation: Convert reserved → spent when order finalizes
  4. Release: Release reservation if order fails

Budget Enforcement Modes

ModeOrder CreationBehavior
TRACK_ONLYAllowedBudget tracked but not enforced
WARNAllowedWarning logged, user notified
REQUIRE_APPROVALBlocked → RequestCreates booking request for approval
BLOCKRejectedOrder cannot be created

Currency Conversion

If the booking currency differs from the budget currency, automatic conversion is applied:

Booking: 1,500,000 IQD
Budget Currency: USD
Converted: ~$1,150 USD (at current rate)

Order Creation

When a corporate direct order is created, additional fields are populated:

FieldValue
companyIdUser's company ID
policyIdApplied policy ID (from first item)
providerCORPORATE_DIRECT
paymentIdSame as order ID (no external payment)

Violation Logging

Policy violations are logged for analytics and compliance:

{
  userId: "user123",
  companyId: "company456",
  policyId: "policy789",
  referenceType: "ORDER",
  referenceId: "order_abc",
  serviceType: "FLIGHT",
  violations: [
    { rule: "cabin_class", message: "Business class not allowed" }
  ],
  action: "WARN_AND_ALLOW"
}

Budget violations are also logged:

{
  companyId: "company456",
  userId: "user123",
  budgetId: "budget_xyz",
  budgetPeriodId: "period_q1",
  referenceType: "ORDER",
  referenceId: "order_abc",
  requestedAmount: 1500,
  availableAmount: 1000,
  currency: "USD",
  enforcementMode: "WARN",
  action: "ALLOWED"
}

Error Handling

Policy Block Errors

ForbiddenException: Booking blocked by company policy:
[service type] item [index]: [violation messages]

Budget Block Errors

ForbiddenException: Budget exceeded and booking is blocked

Processing Failures

If reservations fail after order creation:

  1. Budget reservation is released
  2. Order status set to FAILED
  3. Error event logged

Budget Timing Configuration

Companies can configure when budget is reserved via company budget settings:

SettingWhen Budget Reserved
ON_REQUESTWhen order/request is created
ON_APPROVALWhen booking request is approved
ON_CONFIRMATIONWhen reservations are confirmed

For corporate direct bookings (no approval workflow), ON_REQUEST effectively reserves immediately.

Differences from Consumer Orders

AspectConsumer OrderCorporate Direct
PaymentRequired (card/wallet)None
Policy CheckNoYes
Budget CheckNoYes
Company LinkNoYes
InvoiceTo userTo company
Approval WorkflowNoIf policy requires

Admin Visibility

Corporate direct orders are visible in the Travel Zone Dashboard with:

  • Company name (if available)
  • Policy reference
  • Budget transaction history
  • Full event audit trail

Filtering by provider: CORPORATE_DIRECT shows all corporate bookings.

Best Practices

For Administrators

  1. Monitor violations: Review policy violations regularly
  2. Check budget consumption: Track spend against budgets
  3. Review failed orders: Investigate failed corporate orders for patterns

For Finance Teams

  1. Invoice reconciliation: Match orders to company invoices
  2. Budget reports: Generate spend reports by user/department
  3. Refund tracking: Monitor refunds and credits

On this page