> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.goautolane.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.goautolane.com/_mcp/server.

# Quickstart

> Make your first API call in under 2 minutes

# Quickstart

Choose the API you want to get started with:

## AV / Ride-Hail Analytics

Make your first analytics API call in under 2 minutes.

### Prerequisites

* An Autolane account with at least one active site
* An API key with `analytics:read` permission ([create one here](https://portal.goautolane.com/))

### 1. Get today's metrics

```bash
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.goautolane.com/avrh/v1/analytics/metrics?siteId=YOUR_SITE_ID&period=today" | jq
```

Example response:

```json
{
  "status": "success",
  "data": {
    "autolane_sessions": {
      "total": 142,
      "change_percentage": 12.5,
      "change_type": "increase"
    },
    "average_occupancy": {
      "percentage": 67.3,
      "change_percentage": 3.1,
      "change_type": "decrease"
    },
    "average_dwell_time": {
      "minutes": 4,
      "seconds": 30,
      "total_seconds": 270,
      "change_percentage": 5.0,
      "change_type": "increase"
    }
  }
}
```

### 2. Check occupancy trends

```bash
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.goautolane.com/avrh/v1/analytics/occupancy-trends?siteId=YOUR_SITE_ID&period=today&granularity=hour" | jq
```

### 3. Explore the API Reference

See the full [API Reference](/av-ride-hail-analytics/api-reference/analytics/) for all available endpoints, query parameters, and response schemas.

### Common query parameters

All analytics endpoints accept these parameters:

| Parameter   | Type     | Default  | Description                            |
| ----------- | -------- | -------- | -------------------------------------- |
| `siteId`    | UUID     | required | Site to query                          |
| `period`    | string   | `today`  | `today`, `week`, or `month`            |
| `startDate` | ISO 8601 | none     | Custom range start (pair with endDate) |
| `endDate`   | ISO 8601 | none     | Custom range end (pair with startDate) |

---

## Direct Delivery

Quote and create your first delivery in under 2 minutes. The flow is two-step: **quote first, then create**.

### Prerequisites

* An Autolane API key with `deliveries:write` permission ([create one here](https://portal.goautolane.com/))
* Your site UUID (the `x-retailer-id` value), available in the [Autolane Portal](https://portal.goautolane.com/) under your store's settings

### 1. Request a quote

```bash
curl -s -X POST https://api.goautolane.com/dd/v1/deliveries/quote \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-retailer-id: a1b2c3d4-e5f6-7890-1234-567890abcdef" \
  -H "Content-Type: application/json" \
  -d '{
    "external_delivery_id": "QUICKSTART-001",
    "customer": {
      "phone": "+15551234567"
    },
    "delivery_address": {
      "street": "123 Main St",
      "city": "Austin",
      "state": "TX",
      "zip": "78701"
    },
    "ready_by": "YOUR_FUTURE_ISO8601_UTC_TIMESTAMP",
    "order_items": [
      { "name": "Widget", "quantity": 1 }
    ]
  }' | jq
```

Example response:

```json
{
  "success": true,
  "data": {
    "external_delivery_id": "QUICKSTART-001",
    "available": true,
    "pickup_eta": "2030-01-01T12:15:00Z",
    "delivery_eta": "2030-01-01T12:30:00Z",
    "delivery_fee_cents": 599,
    "currency": "USD",
    "expires_at": "2030-01-01T11:55:00Z"
  }
}
```

The quote is valid for **5 minutes**. If `available` is `false`, the response includes an `unavailable_reason` (e.g., `OUT_OF_SERVICE_AREA`) and you cannot promote it to a delivery.

### 2. Create the delivery

Use the same `external_delivery_id` to convert the quote into an active delivery:

```bash
curl -s -X POST https://api.goautolane.com/dd/v1/deliveries \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-retailer-id: a1b2c3d4-e5f6-7890-1234-567890abcdef" \
  -H "Content-Type: application/json" \
  -d '{
    "external_delivery_id": "QUICKSTART-001",
    "customer": {
      "first_name": "Jane",
      "last_name": "Doe",
      "email": "jane@example.com"
    }
  }' | jq
```

The locked terms (price, ETAs) carry over from the quote.

### 3. Check delivery status

```bash
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-retailer-id: a1b2c3d4-e5f6-7890-1234-567890abcdef" \
  "https://api.goautolane.com/dd/v1/deliveries/QUICKSTART-001" | jq
```

### 4. Set up webhooks (optional)

Register a webhook to receive real-time delivery status updates instead of polling:

```bash
curl -s -X POST https://api.goautolane.com/dd/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-retailer-id: a1b2c3d4-e5f6-7890-1234-567890abcdef" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhooks/autolane",
    "events": ["pickup_status.changed"]
  }' | jq
```

Save the `secret` from the response. You will need it to [verify webhook signatures](/direct-delivery/api-reference/webhooks/events-verification#verifying-signatures).

### 5. Explore the API Reference

See the full [Direct Delivery API Reference](/direct-delivery/api-reference/) and [Overview](/direct-delivery/overview) for authentication details, the delivery lifecycle, error codes, and webhook documentation.