API Reference

List calendar events

Returns calendar events (appointments, surgeries, vaccinations, checkups, emergencies, sales) for the clinic associated with your API key. ### Timezone `start_at` and `end_at` are always UTC ISO 8601. When displaying to end users, convert to the clinic's configured timezone (returned in the `Patient` owner's locale settings, not on the event itself). ### Date Range Both `start_date` and `end_date` are optional. If omitted, the default window is **today through 30 days ahead**. Max allowed range is 90 days per request. ### Event Types & Status Machine - **Types:** `APPOINTMENT`, `SURGERY`, `VACCINATION`, `CHECKUP`, `EMERGENCY`, `SALE` - **Status flow:** `SCHEDULED → CHECKED_IN → IN_PROGRESS → PENDING_CHECKOUT → CLOSED` (or `CANCELLED`)

GET
/api/v1/calendar/events

Authorization

ApiKeyAuth
X-API-Key<token>

API key issued from the Vetigen Developer Portal. Pass as X-API-Key: YOUR_API_KEY.

In: header

Query Parameters

start_date?string

Inclusive lower bound (UTC).

Formatdate-time
end_date?string

Exclusive upper bound (UTC). Max 90 days after start_date.

Formatdate-time
type?string

Filter by event type.

Value in"APPOINTMENT" | "SURGERY" | "VACCINATION" | "CHECKUP" | "EMERGENCY" | "SALE"
status?string

Filter by event status.

Value in"SCHEDULED" | "CHECKED_IN" | "IN_PROGRESS" | "PENDING_CHECKOUT" | "CLOSED" | "CANCELLED"

Response Body

application/json

application/json

application/json

application/json

application/json

curl -H "X-API-Key: $VETIGEN_API_KEY" \  "https://api.vetigen.com/api/v1/calendar/events?start_date=2026-04-15T00:00:00Z&end_date=2026-04-22T00:00:00Z&type=APPOINTMENT"
[
  {
    "fp": "calevt_01JABC...",
    "title": "Vaccination — Boncuk",
    "type": "VACCINATION",
    "status": "SCHEDULED",
    "start_at": "2026-04-15T09:30:00.000Z",
    "end_at": "2026-04-15T10:00:00.000Z",
    "patient_fp": "patient_01JABC...",
    "assigned_user_fp": "user_01JABC..."
  }
]
{
  "success": false,
  "error": {
    "code": "CALENDAR.INVALID_RANGE",
    "message": "Date range must not exceed 90 days.",
    "severity": "error"
  }
}
{
  "success": false,
  "error": {
    "code": "AUTH.UNAUTHORIZED",
    "message": "Authentication required.",
    "severity": "error"
  }
}
{
  "success": false,
  "error": {
    "code": "API_KEY.RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Please retry after the specified time.",
    "severity": "error"
  }
}
{
  "success": false,
  "error": {
    "code": "PATIENT.NOT_FOUND",
    "message": "Patient with fingerprint patient_01JABC does not exist.",
    "severity": "error",
    "details": {}
  }
}

Get patient

Returns full details of a single patient by fingerprint. ### Multi-Clinic Visibility This endpoint succeeds if the API key's clinic has an active `CustomerClinicConnection` to the patient — **even if another clinic originally created the record**. Ownership of medical records within the patient is determined by `performed_by_clinic_fp` on each record. ### What This Returns Only the patient entity itself. Related medical records (SOAP, vaccines, medications, diagnostics) are fetched separately from their respective endpoints.

List inventory items

Returns a paginated list of inventory items for the clinic associated with your API key. ### Clinic-Scoped Unlike patients and medical records, inventory is **clinic-specific** — each clinic maintains its own stock. The `clinic_fp` is inferred from your API key and never accepted as a parameter. ### Pricing & Currency - `unit_price_cents` is an integer in the smallest currency unit (e.g. kurus for TRY, cents for USD). Divide by 100 for display. - `currency` uses ISO 4217 codes. Clinics may operate in TRY, USD, EUR, or GBP. ### Virtual Items `is_virtual: true` marks items that don't track physical stock — consultation fees, procedures, service charges. Stock operations (reserve, decrement, return) fail silently on virtual items. ### Stock Allocation Strategy When items are consumed through sales or treatments, allocation follows: - **Medications & vaccines:** FEFO (First Expiry, First Out) — batches with nearest `expiry_date` used first - **Other categories:** FIFO (First In, First Out) — oldest batches first