Renta Docs

TypeScript Types

All exported types and interfaces from the @renta/sdk package.

The Renta SDK exports TypeScript types for all resources, inputs, and responses. All types are available from the package root.

Importing Types

import type {
  // Fleet & Inventory
  FleetItem,
  FleetCategory,
  FleetItemListParams,
  Location,
  CreateLocationInput,

  // Bookings & Customers
  Booking,
  BookingStatus,
  BookingAdjustment,
  CreateBookingInput,
  Customer,
  CreateCustomerInput,
  Review,
  CreateReviewInput,

  // Add-ons
  Addon,
  CreateAddonInput,

  // Coupons
  Coupon,
  CouponValidation,

  // Pricing
  PricingBreakdown,
  PricingRule,
  CreatePricingRuleInput,

  // Documents & Waivers
  DocumentTemplate,
  DocumentSession,
  DocumentSignee,
  CreateDocumentSessionInput,
  WaiverTemplate,
  WaiverSignResult,

  // Tenant & Settings
  Tenant,
  UpdateTenantInput,
  Settings,
  UpdateSettingsInput,

  // Maintenance
  MaintenanceLog,
  MaintenanceLogListParams,
  CreateMaintenanceLogInput,

  // Fleet Photos
  FleetPhotoUploadResult,
  FleetPhotoDeleteResult,

  // Payments & Deposits
  PaymentIntent,
  DepositHold,

  // Calendar
  CalendarFeed,
  CreateCalendarFeedInput,

  // Availability
  AvailabilityResult,

  // Webhooks
  WebhookEvent,
  WebhookEventType,
  Webhook,

  // Storefront
  ShopProfile,
  StorefrontInventoryResult,
  StorefrontBookInput,

  // Common
  PaginationParams,
  DeleteResult,

  // Config
  RentaConfig,
  RentaLogger,
} from '@renta/sdk';

Storefront types are also available from the storefront entry point:

import type {
  ShopProfile,
  StorefrontInventoryParams,
  StorefrontBookInput,
} from '@renta/sdk/storefront';

Key Types

FleetItem

interface FleetItem {
  id: string;
  category_id: string;
  name: string;
  slug: string;
  description: string | null;
  skill_level: string | null;
  status: 'available' | 'maintenance' | 'retired';
  photos: Array<{ url: string }>;
  price_half_day: number;
  price_full_day: number;
  price_multi_day: number | null;
  price_weekly: number | null;
  deposit_amount: number | null;
  sort_order: number;

  // Available to all key types
  live: boolean;
  sku: string | null;
  specs: Record<string, string> | null;
  inventory_count: number;

  // Secret key only
  deposit_hold_timing: string | null;
  deposit_hold_duration: string | null;
  deposit_auto_release: boolean;
  min_duration: number | null;
  max_duration: number | null;
  buffer_hours: number;
  same_day_booking: boolean;
  notice_hours: number;
  inspection_required: boolean;
  meta_title: string | null;
  units_in_maintenance: number;
}

Booking

interface Booking {
  id: string;
  status: BookingStatus;
  customer_id: string;
  customer: {
    id: string;
    name: string;
    email: string;
    phone: string | null;
  } | null;
  pickup_date: string;
  return_date: string;
  pickup_location_id: string | null;
  half_day: boolean;
  subtotal: number;
  tax_amount: number;
  discount_amount: number;
  total: number;
  amount_paid: number;
  amount_owed: number;
  coupon_id: string | null;
  notes: string | null;
  line_items: BookingLineItem[];
  addons: BookingAddon[];
  adjustments: BookingAdjustment[];
  created_at: string;
  updated_at: string;
}

interface BookingAdjustment {
  id: string;
  type: 'dollar' | 'percent';
  amount: number;
  description: string | null;
  created_at: string;
}

type BookingStatus = 'pending' | 'confirmed' | 'active' | 'completed' | 'cancelled';

Customer

interface Customer {
  id: string;
  name: string;
  email: string;
  phone: string | null;
  total_bookings: number;
  total_spent: number;
  avg_order_value: number;
  first_visit: string | null;
  last_visit: string | null;
  tags: string[];
  flags: string[];
  notes: string | null;
  created_at: string;
}

PricingBreakdown

interface PricingBreakdown {
  base_price: number;
  discount_amount: number;
  seasonal_adjustment: number;
  addon_total: number;
  package_savings: number;
  coupon_discount: number;
  subtotal: number;
  tax: number;
  total: number;
  deposit_hold_amount: number;
  renta_fee_amount: number;
  breakdown: {
    days: number;
    half_day: boolean;
    rate_per_day: number;
    multi_day_discount: number;
    seasonal_rules_applied: Array<{
      rule_id: string;
      type: string;
      adjustment_type: 'dollar' | 'percent';
      adjustment_value: number;
    }>;
    coupon: {
      code: string;
      discount_type: 'percent' | 'fixed';
      discount_value: number;
    } | null;
    addons: Array<{
      addon_id: string;
      name: string;
      quantity: number;
      unit_price: number;
      total: number;
    }>;
  };
}

WebhookEvent

interface WebhookEvent {
  id: string;
  type: WebhookEventType;
  data: Record<string, unknown>;
  tenant_id: string;
  created_at: string;
}

type WebhookEventType =
  | 'booking.created'
  | 'booking.confirmed'
  | 'booking.cancelled'
  | 'booking.completed'
  | 'booking.extended'
  | 'payment.received'
  | 'deposit.held'
  | 'deposit.captured'
  | 'deposit.released'
  | 'customer.created'
  | 'customer.updated'
  | 'fleet.updated'
  | 'waiver.signed';

Location

interface Location {
  id: string;
  name: string;
  address: string | null;
  city: string | null;
  state: string | null;
  zip: string | null;
  lat: number | null;
  lng: number | null;
  phone: string | null;
  hours: Record<string, unknown> | null;
  sort_order: number;
  created_at: string;
  updated_at: string;
}

Review

interface Review {
  id: string;
  booking_id: string;
  customer_id: string;
  rating: number;          // 1-5
  text: string | null;
  status: 'pending' | 'approved' | 'hidden';  // secret key only
  admin_response: string | null;               // secret key only
  created_at: string;
  updated_at: string;
}

PricingRule

interface PricingRule {
  id: string;
  fleet_item_id: string | null;
  type: 'seasonal' | 'multi_day';
  start_date: string | null;
  end_date: string | null;
  days_threshold: number | null;
  adjustment_type: 'dollar' | 'percent';
  adjustment_value: number;
  priority: number;
  active: boolean;
  created_at: string;
  updated_at: string;
}

DocumentTemplate

interface DocumentTemplate {
  id: string;
  name: string;
  type: 'rich_text' | 'pdf_upload';
  content: Record<string, unknown> | null;
  fields: unknown[];
  signee_roles: string[];
  merge_fields_used: string[];
  reminder_hours: number | null;
  is_template: boolean;
  created_at: string;
  updated_at: string;
}

DocumentSession

interface DocumentSession {
  id: string;
  template_id: string;
  booking_id: string | null;
  name: string;
  status: 'draft' | 'sent' | 'partially_signed' | 'completed' | 'voided';
  signees: DocumentSignee[];
  sent_at: string | null;
  completed_at: string | null;
  voided_at: string | null;
  created_at: string;
}

interface DocumentSignee {
  id: string;
  session_id: string;
  customer_id: string | null;
  role: string;
  name: string;
  email: string | null;
  status: 'pending' | 'signed' | 'voided';
  signed_at: string | null;
}

CalendarFeed

interface CalendarFeed {
  id: string;
  name: string;
  token: string;
  fleet_item_ids: string[] | null;
  include_cancelled: boolean;
  created_at: string;
  updated_at: string;
}

Tenant

interface Tenant {
  id: string;            // UUID
  slug: string;
  name: string;
  email: string | null;
  phone: string | null;
  address_line1: string | null;
  address_line2: string | null;
  city: string | null;
  state: string | null;
  zip: string | null;
  brand_settings: Record<string, unknown> | null;
  subscription_tier: string | null;
  created_at: string;    // ISO 8601
  updated_at: string;    // ISO 8601
}

interface UpdateTenantInput {
  name?: string;
  slug?: string;
  email?: string;
  phone?: string;
  address_line1?: string;
  address_line2?: string;
  city?: string;
  state?: string;
  zip?: string;
  brand_settings?: Record<string, unknown>;
}

Settings

interface Settings {
  name: string;
  brand_settings: Record<string, unknown> | null;
  email: string | null;
  phone: string | null;
  address_line1: string | null;
  address_line2: string | null;
  city: string | null;
  state: string | null;
  zip: string | null;
  tenant_settings: Record<string, unknown>;
}

interface UpdateSettingsInput {
  name?: string;
  brand_settings?: Record<string, unknown>;
  email?: string;
  phone?: string;
  address_line1?: string;
  address_line2?: string;
  city?: string;
  state?: string;
  zip?: string;
}

MaintenanceLog

interface MaintenanceLog {
  id: string;              // UUID
  schedule_id: string | null;
  fleet_item_id: string;   // UUID
  description: string;
  notes: string | null;
  cost: number;            // cents
  performed_by: string | null;
  performed_at: string;    // ISO 8601
  meter_reading: number | null;
  rental_count_at: number | null;
  created_at: string;      // ISO 8601
}

interface CreateMaintenanceLogInput {
  fleet_item_id: string;
  description: string;
  cost: number;
  performed_at: string;
  notes?: string;
  performed_by?: string;
  meter_reading?: number;
  rental_count_at?: number;
  schedule_id?: string;
}

FleetPhotoUploadResult

interface FleetPhotoUploadResult {
  url: string;   // Public URL of the uploaded photo
  path: string;  // Storage path (use for deletion)
}

interface FleetPhotoDeleteResult {
  deleted: true;
  path: string;
}

All monetary values in type definitions are number (representing cents). Always divide by 100 for display: (amount / 100).toFixed(2).