Skip to main content

Overview

The MRI integration uses the MRI MIX REST API with HTTP Basic Auth over HTTPS. This reference documents our internal service layer that wraps the MRI API.
This documentation is for developers building on or extending the integration.

Authentication

HTTP Basic Auth over HTTPS

// Every API request uses HTTP Basic Auth
GET https://{your-mri-server}/MIXApi/properties

Authorization: Basic {base64(clientId:password)}
X-MRI-Database: {databaseName}
X-MRI-User: {userName}
X-MRI-PartnerKey: {partnerKey}

Required Credentials

CredentialDescription
Client IDYour MRI API client identifier
Database NameThe MRI database to connect to
User NameMRI API user name
Partner KeyMRI partner integration key
PasswordMRI API password
Base URLYour MRI server URL (e.g., https://your-server.mrisoftware.com/MIXApi)
All credentials are encrypted in Supabase Vault. Never store them in plain text or expose them to the frontend.

Service Configuration

interface MRIConfig {
  baseUrl: string;           // MRI server MIX API base URL
  clientId: string;          // MRI client ID
  databaseName: string;      // MRI database name
  userName: string;          // MRI user name
  partnerKey: string;        // MRI partner key
  password: string;          // MRI password (encrypted in Vault)
  environment: 'sandbox' | 'production';
}

interface MRIServiceConfig {
  rateLimiting: {
    requestsPerMinute: 60;
    requestsPerHour: 1000;
    burstLimit: 10;
  };
  retry: {
    maxRetries: 3;
    baseDelay: 1000;
    maxDelay: 10000;
    backoffMultiplier: 2;
  };
  timeout: {
    connectionTimeout: 10000;
    requestTimeout: 30000;
  };
}

API Endpoints

Properties

propertyId
string
required
The MRI property identifier
// List all properties
GET /api/v1/properties?page={page}&limit={limit}

// Get single property
GET /api/v1/properties/{propertyId}

// Get units for property
GET /api/v1/properties/{propertyId}/units

Tenancies

// List tenancies for property
GET /api/v1/properties/{propertyId}/tenancies

// Get single tenancy
GET /api/v1/tenancies/{tenancyId}

Contacts

// List all contacts
GET /api/v1/contacts?type={contactType}

// Get single contact
GET /api/v1/contacts/{contactId}
Contact Types: tenant, owner, director, agent, supplier

Financial

// List transactions
GET /api/v1/properties/{propertyId}/transactions
    ?start_date={date}&end_date={date}&page={page}&limit={limit}

// List budgets
GET /api/v1/properties/{propertyId}/budgets?year={year}

// List invoices
GET /api/v1/properties/{propertyId}/invoices?status={status}

Maintenance

// List work orders
GET /api/v1/properties/{propertyId}/work-orders?status={status}

// Get single work order
GET /api/v1/work-orders/{workOrderId}

Documents

// List documents
GET /api/v1/properties/{propertyId}/documents?category={category}

// Get document metadata
GET /api/v1/documents/{documentId}

// Download document
GET /api/v1/documents/{documentId}/download

Response Format

All API responses follow this structure:
interface MRIApiResponse<T> {
  success: boolean;
  data?: T;
  error?: string;
  pagination?: {
    page: number;
    limit: number;
    total: number;
    hasMore: boolean;
  };
}

Rate Limiting

The integration implements automatic rate limiting:
  • 60 requests/minute sustained rate
  • 1000 requests/hour hourly limit
  • 10 request burst for short spikes
When rate limited, requests queue and retry with exponential backoff.

Error Codes

CodeMeaningAction
401UnauthorizedToken expired, will auto-refresh
403ForbiddenCheck API permissions
404Not FoundResource doesn’t exist in MRI
429Rate LimitedWait and retry (automatic)
500Server ErrorRetry with backoff