> ## Documentation Index
> Fetch the complete documentation index at: https://okasie.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Publish your first car in a few minutes

## Prerequisites

> [!TIP]
>
> An API secret with the `write:listings` scope (contact [info@okasie.be](mailto:info@okasie.be))

> [!TIP]
>
> At least one dealer linked to your key by Okasie, and its Dealer ID, for example `OK-00148` (see [Dealer access](https://okasie.mintlify.site/authentication.md#dealer-access))

## Step 1: Check your key and dealers

```bash theme={null}
curl "https://www.okasie.be/api/external/v1/locations" \
  -H "Authorization: Bearer YOUR_API_SECRET"
```

A `200` response with the dealer in `data` (its Dealer ID in `locationCode`) means you are ready. An empty `data` array means no dealer is linked to your key yet; `401` means the secret is wrong.

```json theme={null}
{
  "data": [
    {
      "id": "7f7f7f7f-7f7f-407f-a7f7-7f7f7f7f7f7f",
      "locationCode": "OK-00148",
      "displayName": "Example Cars BV",
      "city": "Gent",
      "stats": {"activeListings": 0, "totalListings": 0, "avgActivePrevMonth": null}
    }
  ],
  "meta": {"total": 1}
}
```

## Step 2: Publish a car

Choose your own reference for the car (here `DV-123456`) and `PUT` it. `title`, the dealer, `postalCode` and `city` are always required; `price` is required for an active car.

```bash cURL theme={null}
curl -X PUT "https://www.okasie.be/api/external/v1/listings/DV-123456" \
  -H "Authorization: Bearer YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "dealerLocationCode": "OK-00148",
    "status": "active",
    "title": "Volkswagen Golf 1.5 TSI Life",
    "price": 21950,
    "brand": "Volkswagen",
    "model": "Golf",
    "year": 2022,
    "mileage": 38500,
    "fuelType": "Benzine",
    "transmission": "Automaat",
    "postalCode": "9000",
    "city": "Gent",
    "images": ["https://images.example.com/dv/123456/1.jpg"]
  }'
```

```javascript Node.js theme={null}
const response = await fetch(
  "https://www.okasie.be/api/external/v1/listings/DV-123456",
  {
    method: "PUT",
    headers: {
      Authorization: `Bearer ${process.env.PARTNER_SECRET}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      dealerLocationCode: "OK-00148",
      status: "active",
      title: "Volkswagen Golf 1.5 TSI Life",
      price: 21950,
      brand: "Volkswagen",
      model: "Golf",
      year: 2022,
      mileage: 38500,
      fuelType: "Benzine",
      transmission: "Automaat",
      postalCode: "9000",
      city: "Gent",
      images: ["https://images.example.com/dv/123456/1.jpg"],
    }),
  }
);
console.log(await response.json());
```

```python Python theme={null}
import os
import requests

response = requests.put(
    "https://www.okasie.be/api/external/v1/listings/DV-123456",
    headers={"Authorization": f"Bearer {os.getenv('PARTNER_SECRET')}"},
    json={
        "dealerLocationCode": "OK-00148",
        "status": "active",
        "title": "Volkswagen Golf 1.5 TSI Life",
        "price": 21950,
        "brand": "Volkswagen",
        "model": "Golf",
        "year": 2022,
        "mileage": 38500,
        "fuelType": "Benzine",
        "transmission": "Automaat",
        "postalCode": "9000",
        "city": "Gent",
        "images": ["https://images.example.com/dv/123456/1.jpg"],
    },
)
print(response.json())
```

The response is HTTP `200`:

```json theme={null}
{
  "data": {
    "listingId": "0c52cae7-bcaa-4b37-be0d-1b78c92c5225",
    "externalReference": "DV-123456",
    "status": "active",
    "listingUrl": "https://www.okasie.be/aanbod/volkswagen-golf-1-5-tsi-life--0c52cae7-bcaa-4b37-be0d-1b78c92c5225",
    "created": true
  }
}
```

`listingUrl` is the car's public page. If a photo could not be downloaded, `warnings.skippedImages` says which and why.

## Step 3: Update it

Send the same `PUT` again with the **complete** car and the changed values. Fields you leave out are cleared, except `images` and `features`, which stay when you leave them out. The response now has `"created": false`.

## Step 4: Take it offline

When the car is sold or withdrawn:

```bash theme={null}
curl -X DELETE "https://www.okasie.be/api/external/v1/listings/DV-123456" \
  -H "Authorization: Bearer YOUR_API_SECRET"
```

The listing is marked sold and goes offline about an hour later (60 to 75 minutes).

## Next steps

> [card] [All fields](https://okasie.mintlify.site/api-reference/listings/upsert.md)
>
> Every field with its format and allowed values

> [card] [Error Handling](https://okasie.mintlify.site/errors.md)
>
> Every error code

> [card] [Bulk Operations](https://okasie.mintlify.site/api-reference/listings/bulk-upsert.md)
>
> Up to 100 cars per request

> [card] [Incremental Sync](https://okasie.mintlify.site/guides/incremental-sync.md)
>
> Keeping Okasie in line with your stock


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.