Technical Documentation

API Reference

The Auto Glass REST API is a versioned HTTP JSON API served at https://api.autoglass.io/v1. All requests must include an Authorization: Bearer <token> header unless marked Public. All responses are application/json.

Base URL: Production: https://api.autoglass.io/v1 · Staging: https://api-staging.autoglass.io/v1 · All HTTPS only · TLS 1.3

Authentication

The API uses JWT Bearer tokens for authentication. Tokens are issued by the Auth Service and expire after 15 minutes. Refresh tokens are valid for 30 days and stored HTTP-only.

POST /v1/auth/login
Content-Type: application/json

{ "email": "user@example.com", "password": "•••••••••" }

→ 200 OK
{
  "accessToken":  "eyJhbGci...",
  "refreshToken": "eyJhbGci...",
  "expiresIn":    900,
  "user": { "id": "usr_01J...", "name": "Jane Smith", "role": "dispatcher" }
}

Request / Response Conventions

ConventionDetail
ID formatKSUID-based prefixed strings e.g. bkg_01J9X..., wko_01J9X...
TimestampsISO 8601 UTC, e.g. 2025-06-15T09:30:00Z
Money/AmountsIntegers in cents (e.g. 15000 = $150.00 USD)
PaginationCursor-based: ?cursor=<id>&limit=25
Error format{ error: string, code: string, field?: string}
IdempotencyPOST endpoints accept Idempotency-Key header (UUID)

HTTP Status Codes

CodeMeaning
200Success with body
201Resource created
204Success, no body
400Validation error — check error.field
401Missing or expired JWT
403Authenticated but insufficient role
404Resource not found
409Conflict (e.g. booking slot taken)
422Business rule violation (e.g. booking window passed)
429Rate limited — retry after Retry-After header
503Downstream service unavailable (circuit open)

Rate Limits

TierLimitWindow
Anonymous / Public30 requestsper minute per IP
Authenticated Customer120 requestsper minute per user
Technician / Dispatcher300 requestsper minute per user
Admin / Service Account2,000 requestsper minute

Endpoint Reference

POST/v1/auth/loginAuth: Public
Authenticate user, return JWT access + refresh tokens
Body: { email, password }
Response: { accessToken, refreshToken, user }
POST/v1/auth/refreshAuth: Public
Exchange a refresh token for a new access token
Body: { refreshToken }
Response: { accessToken }
GET/v1/vehicles/decode/:vinAuth: Bearer
Decode a 17-character VIN via NHTSA + DataOne to retrieve year, make, model, trim, ADAS features, glass codes
Body: -
Response: { vin, year, make, model, adasFeatures[], glassIds[] }
POST/v1/quotesAuth: Bearer
Generate a real-time glass replacement quote with NAGS pricing, ADAS surcharge, and mobile fee
Body: { vin, serviceType, zipCode, insuranceId? }
Response: { quoteId, lineItems[], total, adasRequired, validUntil }
GET/v1/quotes/:idAuth: Bearer
Retrieve a previously generated quote by ID
Body: -
Response: Quote object
POST/v1/bookingsAuth: Bearer
Convert an accepted quote into a confirmed booking with scheduled appointment
Body: { quoteId, appointmentSlot, location, paymentMethodId }
Response: { bookingId, confirmationCode, technicianId, eta }
GET/v1/bookings/:idAuth: Bearer
Retrieve booking details including real-time technician ETA
Body: -
Response: Booking object with live ETA
PATCH/v1/bookings/:id/cancelAuth: Bearer
Cancel a booking (refund if > 2 hours before appointment)
Body: { reason }
Response: { status, refundAmount }
GET/v1/dispatch/available-slotsAuth: Bearer
Return available appointment slots for a zip code in the next 14 days
Body: -
Response: { slots[] }
POST/v1/work-ordersAuth: Technician
Create a work order for an assigned booking (triggered by Dispatch Engine)
Body: { bookingId, technicianId, partsChecklist[] }
Response: WorkOrder object
PATCH/v1/work-orders/:id/completeAuth: Technician
Mark work order complete, upload photos, attach calibration certificate
Body: { photos[], calibrationCertUrl?, signatureDataUrl }
Response: { invoiceId, status }
POST/v1/insurance/claimsAuth: Bearer
Submit an insurance claim for a completed work order via EDI
Body: { workOrderId, policyNumber, insurerId }
Response: { claimId, claimStatus, expectedReimbursement }
GET/v1/insurance/claims/:idAuth: Bearer
Check status of a submitted insurance claim
Body: -
Response: { claimId, status, adjudicationNotes, reimbursedAmount }
POST/v1/payments/intentAuth: Bearer
Create a Stripe Payment Intent for customer co-pay or direct payment
Body: { bookingId, amount, currency }
Response: { clientSecret, paymentIntentId }
POST/v1/inventory/parts/scanAuth: Technician
Barcode scan a part to log it against a work order and decrement van stock
Body: { barcode, workOrderId }
Response: { partId, partName, qty, vanStockRemaining }
POST/v1/calibration/sessionsAuth: Technician
Log ADAS calibration session with target type, results, and pass/fail status
Body: { workOrderId, calibrationType, targetData, passedCalibration }
Response: { sessionId, certificateUrl }
GET/v1/technicians/:id/locationAuth: Dispatcher
Get real-time GPS location of a technician (Redis Geo)
Body: -
Response: { lat, lng, speed, updatedAt }

Webhooks

Configure webhook endpoints in the Admin Portal. All events POST to your URL with a X-AutoGlass-Signature HMAC-SHA256 header for verification.

EventTrigger
booking.createdNew booking confirmed
booking.cancelledBooking cancelled by customer or ops
technician.en_routeTechnician departed for appointment
work_order.completedTechnician marked job complete
invoice.issuedInvoice PDF generated
payment.succeededPayment captured successfully
claim.approvedInsurance claim adjudicated and approved
claim.rejectedInsurance claim denied with reason code