> 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.

# Create a delivery from a quote

POST https://api.goautolane.com/dd/v1/deliveries
Content-Type: application/json

Promotes a non-expired, available, unconsumed quote (matched by `external_delivery_id`) into an active delivery.

Reference: https://docs.goautolane.com/direct-delivery/api-reference/deliveries/create

## Authentication

- `Authorization` header (bearer token, required) — Autolane Platform API key. Org-scoped with granular permissions. Deliveries endpoints additionally require an `x-retailer-id` header containing the site UUID from the Autolane Portal; webhooks endpoints do not.

## Request

### Headers

- `x-retailer-id` (string, required) — Site ID (UUID) from the Autolane Portal identifying the store location

### Body (application/json)

This endpoint expects an object.

- `external_delivery_id` (string, required)
- `customer` (DdV1DeliveriesPostRequestBodyContentApplicationJsonSchemaCustomer, optional)

## Response

### 201

Delivery created

- `success` (boolean, required)
- `data` (DdV1DeliveriesPostResponsesContentApplicationJsonSchemaData, required)

## Errors

### 400 Bad Request Error

Validation error

- `error` (string, required)
- `code` (enum, required)
  - Allowed values: `VALIDATION_ERROR`
- `details` (list of ValidationErrorResponseDetailsItems, required) — Zod validation error details

### 401 Unauthorized Error

Invalid API key

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 403 Forbidden Error

Missing permission

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 404 Not Found Error

Quote not found

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 409 Conflict Error

Quote already consumed

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 410 Gone Error

Quote expired

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

### 422 Unprocessable Entity Error

Quote not available

- `error` (string, required) — Human-readable error message
- `code` (string, optional) — Machine-readable error code
- `details` (any, optional) — Additional error context

## Types

### DdV1DeliveriesPostRequestBodyContentApplicationJsonSchemaCustomer

- `email` (string, optional)
- `first_name` (string, optional)
- `last_name` (string, optional)

### DdV1DeliveriesPostResponsesContentApplicationJsonSchemaData

- `external_delivery_id` (string, required)
- `status` (enum, required)
  - Allowed values: `SCHEDULED`, `ASSIGNED`, `EN_ROUTE_TO_STORE`, `ARRIVED_AT_STORE`, `WAITING_FOR_LOAD`, `LOADED`, `EN_ROUTE_TO_CUSTOMER`, `ARRIVED_AT_CUSTOMER`, `COMPLETED`, `FAILED`, `CANCELLED`, `RETURN_IN_PROGRESS`, `RETURN_ARRIVED`, `RETURNED`, `EXPIRED`
- `ready_by` (string, required)
- `pickup_eta` (string, required)
- `delivery_eta` (string, required)
- `delivery_fee_cents` (double, required)
- `currency` (enum, required)
  - Allowed values: `USD`
- `delivery_address` (DdV1DeliveriesPostResponsesContentApplicationJsonSchemaDataDeliveryAddress, required)
- `customer` (DdV1DeliveriesPostResponsesContentApplicationJsonSchemaDataCustomer, required)
- `pickup_instructions` (string, required, nullable)
- `dropoff_instructions` (string, required, nullable)
- `stall_id` (string, optional, nullable) — Stall the vehicle is parked in at the store. Present only for sites with stall reporting enabled, on `ARRIVED_AT_STORE`, `WAITING_FOR_LOAD`, `LOADED`, and, unchanged, on `RETURN_IN_PROGRESS`, `RETURN_ARRIVED`, and `RETURNED`; omitted otherwise. `null` when no stall was recorded for the arrival. Same value the `pickup_status.changed` webhook carries.
- `return_reason` (enum, optional) — Why the delivery is being returned. Present on `RETURN_IN_PROGRESS`, `RETURN_ARRIVED`, and `RETURNED`; omitted otherwise. `null` when the cancel carried no `cancellation_reason`. This is the normalized output value; the inbound `cancellation_reason` on the cancel request accepts any value and unrecognized ones are recorded as `OTHER`.
  - Allowed values: `CUSTOMER_CANCELLED`, `COLD_CHAIN_EXPIRED`, `OTHER`
- `return_stall_id` (string, optional, nullable) — Stall the vehicle is parked in for the return handback. Present only for sites with stall reporting enabled, on `RETURN_IN_PROGRESS`, `RETURN_ARRIVED`, and `RETURNED`; omitted otherwise. `null` until the vehicle checks in at the store. Separate from `stall_id`, which keeps the value the order was loaded from.
- `return_fee_cents` (double, optional, nullable) — Flat return fee in cents, fixed when the return started. Present on `RETURNED`; omitted otherwise. `null` when no fee is set for the store.

### ValidationErrorResponseDetailsItems

- `path` (list of string, required)
- `message` (string, required)

### DdV1DeliveriesPostResponsesContentApplicationJsonSchemaDataDeliveryAddress

- `street` (string, required)
- `city` (string, required)
- `state` (string, required)
- `zip` (string, required)
- `unit` (string, optional)

### DdV1DeliveriesPostResponsesContentApplicationJsonSchemaDataCustomer

- `phone` (string, required)

## Examples

**Request**

```json
{
  "external_delivery_id": "string"
}
```

**Response**

```json
{
  "success": true,
  "data": {
    "external_delivery_id": "string",
    "status": "SCHEDULED",
    "ready_by": "string",
    "pickup_eta": "string",
    "delivery_eta": "string",
    "delivery_fee_cents": 1.1,
    "currency": "USD",
    "delivery_address": {
      "street": "string",
      "city": "string",
      "state": "string",
      "zip": "string",
      "unit": "string"
    },
    "customer": {
      "phone": "string"
    },
    "pickup_instructions": "string",
    "dropoff_instructions": "string",
    "stall_id": "A4",
    "return_reason": "COLD_CHAIN_EXPIRED",
    "return_stall_id": "B21",
    "return_fee_cents": 500
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.goautolane.com/dd/v1/deliveries"

payload = { "external_delivery_id": "string" }
headers = {
    "x-retailer-id": "x-retailer-id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.goautolane.com/dd/v1/deliveries';
const options = {
  method: 'POST',
  headers: {
    'x-retailer-id': 'x-retailer-id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"external_delivery_id":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.goautolane.com/dd/v1/deliveries"

	payload := strings.NewReader("{\n  \"external_delivery_id\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-retailer-id", "x-retailer-id")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.goautolane.com/dd/v1/deliveries")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-retailer-id"] = 'x-retailer-id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"external_delivery_id\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.goautolane.com/dd/v1/deliveries")
  .header("x-retailer-id", "x-retailer-id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"external_delivery_id\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.goautolane.com/dd/v1/deliveries', [
  'body' => '{
  "external_delivery_id": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'x-retailer-id' => 'x-retailer-id',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.goautolane.com/dd/v1/deliveries");
var request = new RestRequest(Method.POST);
request.AddHeader("x-retailer-id", "x-retailer-id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"external_delivery_id\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-retailer-id": "x-retailer-id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["external_delivery_id": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.goautolane.com/dd/v1/deliveries")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```