Developer & Agent API

JOYRYDE API

Browse vehicles, create bookings, and integrate with Joyryde programmatically. Designed for developers and AI agents alike.

Base URL https://joy-ryde-platform-v2-production.up.railway.app
🔒

Authentication

Public endpoints (vehicles, contact, leads, ask) require no authentication. Booking management and admin endpoints require a bearer token via the Authorization: Bearer <token> header. The /api/checkout/* endpoints are public but create Stripe sessions server-side.

AI Agent Access

Joyryde is built agent-first. Every endpoint returns structured JSON. AI agents can discover our API via these dedicated resources.

Agent Discovery

AI agents and LLMs can discover Joyryde's capabilities through these machine-readable files:

  • /llms.txt — Plain-text summary of Joyryde's services, endpoints, and capabilities for LLM context windows
  • /api-docs — Full OpenAPI 3.0 specification (JSON) documenting every endpoint, parameter, and response schema
  • POST /api/ask — Natural language query endpoint. Send a plain English question, get structured JSON back. Agents can use this before learning our API schema.
POST /api/ask Natural language query for AI agents

Accepts a plain English question and returns structured JSON with the answer or a pointer to the right endpoint. This is the primary entry point for AI agents that haven't learned the API schema yet.

Request Body
FieldTypeRequiredDescription
querystringYesPlain English question (e.g., "What SUVs do you have available next week?")
{
  "query": "What vehicles do you have for long-term rental?"
}
200 OK
{
  "received_query": "What vehicles do you have for long-term rental?",
  "status": "nl_processing_not_yet_implemented",
  "suggestion": "Use structured endpoints directly",
  "available_endpoints": {
    "vehicles": "GET /api/vehicles",
    "availability": "GET /api/availability?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD",
    "booking": "POST /api/bookings"
  },
  "docs": "https://joy-ryde.com/api-docs"
}
GET /health Health check

Returns current service status, version, and environment. Use this to verify the API is online before making other calls.

200 OK
{
  "status": "ok",
  "service": "Joyryde API",
  "version": "1.0.0",
  "environment": "production",
  "timestamp": "2026-03-09T12:00:00.000Z"
}

Vehicles

Browse the Joyryde fleet. Vehicle data is sourced live from our master fleet spreadsheet with a 15-minute cache. Eight categories for short-term, two for long-term.

GET /api/vehicles List vehicle categories with live fleet counts

Returns all vehicle categories with real-time availability counts from the live fleet inventory. Use the type query parameter to filter by rental type.

Query Parameters
ParamTypeRequiredDescription
typestringNoFilter by rental type. long-term short-term
200 OK
{
  "vehicles": [
    {
      "name": "Economy Sedan",
      "slug": "economy-sedan",
      "image": "/Vehicles/compact.png",
      "description": "Fuel-efficient sedans perfect for rideshare driving",
      "rental_types": ["short-term", "long-term"],
      "available_count": 12
    }
  ],
  "total_listed": 44,
  "source": "google_sheets",
  "rental_type_filter": "all"
}
GET /api/vehicles/:slug Get single vehicle category by slug

Returns detailed information for a single vehicle category.

Path Parameters
ParamTypeRequiredDescription
slugstringYesVehicle category slug. Valid: economy-sedan midsize-sedan compact-suv midsize-suv truck jeep van specialty
200 OK 404 Not Found

Bookings

Create and manage vehicle rental bookings. All new bookings start as pending_approval and require owner approval before confirmation.

POST /api/bookings Submit a new booking

Creates a new rental booking. Returns a reference number (e.g., JR-123456) for tracking.

Rate limited: 20 requests per 15 minutes
Request Body
FieldTypeRequiredDescription
bookingTypestringYesstandard (short-term) or gig (long-term)
firstNamestringYesRenter's first name
lastNamestringYesRenter's last name
emailstringYesRenter's email address
phonestringYesRenter's phone number
vehicleClassstringNoVehicle category name (e.g., "Economy Sedan")
pickupDatestringNoISO 8601 date (YYYY-MM-DD)
returnDatestringNoISO 8601 date (YYYY-MM-DD)
totalAmountnumberNoTotal rental amount in USD
200 OK
{
  "success": true,
  "refNumber": "JR-849201",
  "bookingId": 42,
  "status": "pending"
}
GET /api/bookings List all bookings (admin)

Returns a paginated list of all bookings. Supports filtering by status and type.

Query Parameters
ParamTypeRequiredDescription
statusstringNopending confirmed active returned cancelled
typestringNostandard gig
limitintegerNoResults per page (default: 50)
offsetintegerNoPagination offset (default: 0)
GET /api/bookings/:ref Get booking by reference number

Look up a specific booking by its Joyryde reference number (e.g., JR-123456).

Path Parameters
ParamTypeRequiredDescription
refstringYesBooking reference number (e.g., JR-849201)
200 OK 404 Not Found
PATCH /api/bookings/:ref/status Update booking status

Update the status of an existing booking.

Request Body
FieldTypeRequiredDescription
statusstringYespending confirmed active returned cancelled

Checkout

Payment and enrollment endpoints. Long-term uses a 2-phase Stripe enrollment (protection fee + weekly subscription). Short-term collects a 20% reservation deposit.

POST /api/checkout/long-term Initialize long-term enrollment checkout

Creates a Stripe checkout session for long-term rental enrollment. Collects an $849 protection fee and saves the card for weekly subscription billing.

Request Body
FieldTypeRequiredDescription
firstNamestringYesDriver's first name
lastNamestringYesDriver's last name
emailstringYesDriver's email
phonestringYesDriver's phone
vehicleClassstringYesEconomy Sedan Midsize Sedan
pickupDatestringYesISO 8601 date
rentalTermstringNoCommitment length. 3 6 12 months
insuranceTierstringNobasic ($0/wk) standard (+$29/wk) zero (+$49/wk)
typedSignaturestringNoE-signature for rental agreement
200 OK
{
  "success": true,
  "refNumber": "JR-849201",
  "checkoutUrl": "https://checkout.stripe.com/c/pay/...",
  "sessionId": "cs_live_..."
}
POST /api/checkout/short-term Initialize short-term booking payment

Creates a Stripe payment intent for a short-term rental. Collects 20% as a reservation deposit; the remaining 80% is collected at check-in.

Request Body
FieldTypeRequiredDescription
firstNamestringYesRenter's first name
lastNamestringYesRenter's last name
emailstringYesRenter's email
phonestringYesRenter's phone
vehicleClassstringYesVehicle category name
pickupDatestringYesISO 8601 date
returnDatestringYesISO 8601 date
totalAmountnumberYesTotal rental amount in USD
200 OK
{
  "success": true,
  "refNumber": "JR-849201",
  "clientSecret": "pi_...secret_...",
  "reservationAmount": "59.80",
  "totalAmount": "299.00",
  "remainingAmount": "239.20"
}
GET /api/checkout/success Verify booking after payment

Verify that a booking's payment completed successfully. Called after Stripe redirect.

Query Parameters
ParamTypeRequiredDescription
refstringYesBooking reference number

Contact

Submit inquiries and messages to the Joyryde team.

POST /api/contact Submit contact form message
Rate limited: 10 requests per hour
Request Body
FieldTypeRequiredDescription
namestringYesSender's full name
emailstringYesSender's email address
phonestringNoSender's phone number
messagestringNoMessage body
sourcestringNoWhere the contact came from (default: "website")

Leads

Capture leads and manage newsletter subscriptions. Leads are scored automatically and enter nurture email sequences based on contact preference.

POST /api/leads Capture lead from form

Captures a lead with automatic scoring. The lead enters a nurture sequence based on their contact preference.

Rate limited: 20 requests per 15 minutes
Request Body
FieldTypeRequiredDescription
contact_preferencestringYesnewsletter email text call
namestringNoLead's name
emailstringNoLead's email (required for newsletter/email preference)
phonestringNoLead's phone (required for text/call preference)
monthly_milesnumberNoMonthly miles driven (from calculator)
car_paymentnumberNoCurrent monthly car payment (from calculator)
utm_sourcestringNoUTM source parameter
utm_mediumstringNoUTM medium parameter
utm_campaignstringNoUTM campaign parameter
200 OK
{
  "success": true,
  "leadId": 17
}
POST /api/leads/unsubscribe Unsubscribe from newsletter

Unsubscribe an email address from the newsletter using a CAN-SPAM compliant token.

Request Body
FieldTypeRequiredDescription
tokenstringYesUnsubscribe token (from email link)
POST /api/leads/resubscribe Resubscribe to newsletter

Re-subscribe a previously unsubscribed email using their token.

Request Body
FieldTypeRequiredDescription
tokenstringYesUnsubscribe token

AI Chat

AI-powered financial advisor for comparing car ownership vs. renting. Powered by Claude Haiku with per-IP and global daily cost caps.

POST /api/smart/chat AI financial advisor chatbot

Send a conversation to the AI advisor. It specializes in comparing car ownership/lease costs against renting, with a focus on total cost of ownership for gig economy drivers.

Request Body
FieldTypeRequiredDescription
messagesarrayYesArray of message objects with role (user or assistant) and content (string, max 2000 chars)
{
  "messages": [
    { "role": "user", "content": "I drive Uber 40 hours a week. Is it cheaper to rent or buy?" }
  ]
}
200 OK
{
  "content": "Great question! Let's break down the numbers...",
  "usage": {
    "input_tokens": 142,
    "output_tokens": 387
  }
}

General Notes

For Developers & Integrators

  • All responses are JSON with Content-Type: application/json
  • All dates use ISO 8601 format (YYYY-MM-DD)
  • All prices are in USD
  • Rate limits return 429 Too Many Requests with a retry message
  • Booking reference numbers follow the pattern JR-XXXXXX
  • CORS is enabled for joy-ryde.com and Vercel preview deployments
  • The OpenAPI 3.0 spec is available at /api-docs
  • For AI agents: start with /llms.txt for a plain-text overview, or POST to /api/ask with a natural language query