Skip to main content
POST
/
api
/
external
/
v1
/
listings
/
bulk-upsert
curl -X POST "https://www.okasie.be/api/external/v1/listings/bulk-upsert" \
  -H "Authorization: Bearer YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "externalReference": "DEX-0001",
        "dealerProfileId": "84118503-030b-45f3-a867-c77d54d00b4c",
        "status": "active",
        "title": "Jeep Compass 2019",
        "price": 18500,
        "brand": "Jeep",
        "model": "Compass",
        "year": 2019,
        "mileage": 43700,
        "fuelType": "petrol",
        "postalCode": "9000",
        "city": "Gent",
        "province": "Oost-Vlaanderen"
      },
      {
        "externalReference": "DEX-0002",
        "dealerLocationCode": "DEX-GENT",
        "status": "pending",
        "title": "Renault Trafic",
        "price": 26990,
        "brand": "Renault",
        "model": "Trafic",
        "year": 2020,
        "mileage": 65000,
        "fuelType": "diesel",
        "postalCode": "9000",
        "city": "Gent",
        "province": "Oost-Vlaanderen",
        "images": ["https://partner.example/trafic.jpg"]
      }
    ]
  }'
{
  "data": {
    "successCount": 2,
    "errorCount": 0,
    "results": [
      {
        "index": 0,
        "externalReference": "DEX-0001",
        "listingId": "0c52cae7-bcaa-4b37-be0d-1b78c92c5225",
        "status": "active",
        "created": true
      },
      {
        "index": 1,
        "externalReference": "DEX-0002",
        "listingId": "1d63dbf8-cdbb-5c48-cf1e-2c89d93d6336",
        "status": "pending",
        "created": true
      }
    ],
    "errors": []
  }
}

Bulk Create/Update Listings

Upsert up to 100 listings in a single request. Each item is processed independently, allowing partial success.
Requires the write:listings scope. Contact support to enable write access.

Request Body

The request body can be either:
  1. An array of listing objects
  2. An object with an items property containing the array
Each item must include externalReference plus all required listing fields.
items
array
required
Array of listing objects (max 100 items)

Response

data.successCount
integer
Number of successfully processed items
data.errorCount
integer
Number of failed items
data.results
array
Array of successful results
data.errors
array
Array of failed items with error details
curl -X POST "https://www.okasie.be/api/external/v1/listings/bulk-upsert" \
  -H "Authorization: Bearer YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "externalReference": "DEX-0001",
        "dealerProfileId": "84118503-030b-45f3-a867-c77d54d00b4c",
        "status": "active",
        "title": "Jeep Compass 2019",
        "price": 18500,
        "brand": "Jeep",
        "model": "Compass",
        "year": 2019,
        "mileage": 43700,
        "fuelType": "petrol",
        "postalCode": "9000",
        "city": "Gent",
        "province": "Oost-Vlaanderen"
      },
      {
        "externalReference": "DEX-0002",
        "dealerLocationCode": "DEX-GENT",
        "status": "pending",
        "title": "Renault Trafic",
        "price": 26990,
        "brand": "Renault",
        "model": "Trafic",
        "year": 2020,
        "mileage": 65000,
        "fuelType": "diesel",
        "postalCode": "9000",
        "city": "Gent",
        "province": "Oost-Vlaanderen",
        "images": ["https://partner.example/trafic.jpg"]
      }
    ]
  }'
{
  "data": {
    "successCount": 2,
    "errorCount": 0,
    "results": [
      {
        "index": 0,
        "externalReference": "DEX-0001",
        "listingId": "0c52cae7-bcaa-4b37-be0d-1b78c92c5225",
        "status": "active",
        "created": true
      },
      {
        "index": 1,
        "externalReference": "DEX-0002",
        "listingId": "1d63dbf8-cdbb-5c48-cf1e-2c89d93d6336",
        "status": "pending",
        "created": true
      }
    ],
    "errors": []
  }
}

Error Responses

StatusCodeDescription
400EMPTY_PAYLOADNo items provided
400TOO_MANY_ITEMSMore than 100 items
400INVALID_JSONInvalid JSON body
For large imports, split your data into batches of 100 items and process them sequentially with a small delay between batches.