Vehicles (Inventory)

A Vehicle must have an Organization and Location.

A Vehicle instance resource represents a vehicle within your Organization. Once a Vehicle is created within autoZnetwork, it will be acessible through all products offered to your Organization.

The inventory list resource represents all of the vehicles that you have created on your account within autoZnetwork. You can POST to inventory to create a new vehicle or modify an existing vehicle.

Properties

PropertyTypeDescription
idIntegerThe ID of the Vehicle that is assigned to the Vehicle.
activeBooleanIdentifies if the Vehicle is currently activated.
statusStringIdentifies the retail status of the Vehicle.
title_statusStringIdentifies the title status of the Vehicle.
typeStringIdentifies the vehicle as Used, New, or Certified.
stockStringThe stock number of the Vehicle.
vinStringThe VIN of the Vehicle.
nameStringAssociated name assigned by autoZnetwork for the Vehicle.
slugStringURL friendly identifier of the name of the Vehicle.
priceObjectAn array of prices for the vehicle. (selling, internet, retail)
yearStringThe year the Vehicle was manufactured.
makeStringThe manufacturer of the Vehicle (Free Text).
modelStringThe model of the Vehicle (Free Text).
trimStringThe trim of the Vehicle (Free Text).
body_styleStringThe normalized Body Style of the Vehicle.
exteriorObjectObject of exterior details for the vehicle.
exterior.colorStringFriendly exterior color identifier.
exterior.manufacturer_colorStringThe exterior color provided by the manufacturer.
interiorObjectObject of interior details for the vehicle.
interior.typeStringThe material/upholestry in the vehicle.
interior.colorStringFriendly interior color identifier.
interior.manufacturer_colorStringThe interior color provided by the manufacturer.
odometerObjectObject of odometer for the vehicle.
odometer.valueIntegerThe number of miles or kilometers on the odometer.
odometer.unitStringThe unit of measurement on the odometer.
imageStringFirst image of the vehicle.
ownersIntegerNumber of owners of the Vehicle (Free Text).
doorsIntegerNumber of doors on the Vehicle (Free Text).
seatsIntegerNumber of seats in the Vehicle (Free Text).
drivetrainStringDrivetrain for the Vehicle (Free Text).
transmissionObjectTransmission details for the Vehicle.
transmission.nameStringName of the transmission (Free Text).
transmission.typeStringThe type of transmission (Free Text).
transmission.speedIntegerSpeed of the transmission (Free Text).
engine.nameStringName of the engine (Free Text).
engineObjectEngine details for the Vehicle.
engine.nameStringName of the engine (Free Text).
engine.displacementFloatThe displacement of the engine (Free Text).
engine.cylindersIntegerThe cylinders of the engine (Free Text).
descriptionStringThe description of the Vehicle.
optionsArrayArray of Options attached the Vehicle (Free Text).
stocked_in_atDateTimeDateTime the Vehicle was stocked into the DMS.
sold_atDateTimeDateTime the Vehicle was marked as sold.
created_atDateTimeDateTime the Vehicle was created.
updated_atDateTimeDateTime the Vehicle was last updated.

Relationships

RelationshipDescription
OrganizationThe Organization the Vehicle belongs to.
LocationThe Location assigned to the Vehicle. Must belong to the Organization.
ImagesThe images attached to the vehicle (See Inventory Image CDN for advanced customization in your inventory request).

List all the vehicles in inventory

GET https://api.autoznetwork.com/v1/inventory

CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"

curl https://api.autoznetwork.com/v1/inventory \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json'
PHP
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';

$autoZnetwork = new AutozNetwork($apiToken);

$vehicles = $autoznetwork
              ->withOrganization($organizationId)
              ->inventory()
              ->get();

print($vehicles)

Add a vehicle to inventory

When adding images to a vehicle, autoZnetwork will queue the image processing asynchronously. The initial 201 response will not contain the images as we pull are processing in the background.

POST Request: https://api.autoznetwork.com/v1/inventory

CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
AUTOZNETWORK_LOCATION_ID="your location id"

curl https://api.autoznetwork.com/v1/inventory \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "location_id": "\'$AUTOZNETWORK_LOCATION_ID'\",
    "active": true,
    "stock": "12345",
    "vin": "123456789ABCDEFGH",
    "url": "https://www.yourwebsite.com/vdp/12345",
    "make": "Ford",
    "model": "F-150",
    "trim": "XLT SVT Raptor 4x4",
    "miles": 5000,
    "type": "Used",
    "year": "2015",
    "price": {
      "selling": 19999,
      "internet": 18999,
      "msrp": 21999
    },
    "options": "Cruise Control,Bluetooth,Keyless Entry",
    "images: "https://cdn.com/image.jpg,https://cdn.com/image2.jpg,https://cdn.com/image3.jpg"
  }'
PHP
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = 'your organization id';
$locationId = 'your location id'

$autoZnetwork = new AutozNetwork($apiToken);

$vehicle = $autoznetwork
            ->withOrganization($organizationId)
            ->inventory()
            ->create([
              'location_id' => $locationId,
              'stock' => '123456',
              'vin' => 'ABCDEFG123456789',
              'make' => 'Ford',
              'model' => 'F-150',
              'trim' => 'XLT SVT Raptor 4x4',
            ]);

print($vehicle)

Parameters

A Vehicle must have stock number or a VIN as an identifier.
ParameterTypeDescription
location_idIntegerRequired The Location identifier the Vehicles belongs to, accesible in your account profile.
stockStringRequired The stock number of the Vehicle.
vinStringRequired The vin of the Vehicle.
makeStringThe make of the Vehicle.
modelStringThe model of the Vehicle.
trimStringThe trim of the Vehicle.
priceInteger, Double, ArrayThe price of the Vehicle. If an integer or Double is passed autoZnetwork defaults to the "selling" price.
milesIntegerThe miles of the Vehicle.
typeStringThe class of the Vehicle: New, Used, Certified.
yearIntegerThe year of the Vehicle.
urlStringThe URL of the Vehicle VDP on your website.
body_styleStringThe body style of the Vehicle: Truck, Coupe, Sedan, SUV, Convertible, Hatchback, Minivan-Van, Wagon, Limousine, RV, Motorcycle, Snowmobile, ATV-Quad, Trailer, PWC, Other.
body_typeStringThe body type of the Vehicle: TBD.
fuelStringThe fuel used by the Vehicle: Biodiesel, Diesel, Electric, FFV-Ethanol, Gas, Hybrid-Electric, Other, CNG.
exterior_colorStringThe exterior color of the Vehicle: Black, Blue, Brown, Burgundy, Gold, Gray, Green, Orange, Purple, Red, Silver, Tan, Teal, White, Yellow, Khaki, Beige, Slate, Pewter, Charcoal.
interior_colorStringThe interior color of the Vehicle: Black, Blue, Brown, Burgundy, Gold, Gray, Green, Orange, Purple, Red, Silver, Tan, Teal, White, Yellow, Khaki, Beige, Slate, Pewter, Charcoal.
interior_typeStringThe interior type of the Vehicle: Leather, Cloth, Vinyl.
title_statusStringThe title status of the Vehicle: Clear, Salvage, Rebuilt, Parts Only.
tonnageStringThe tonnage of the Vehicle: Quarter Ton, Half Ton, Three Quarter Ton, One Ton, One and a Half Ton, Two Ton.
transmission_typeStringThe transmission type of the Vehicle: Manual, Automatic.
transmission_speedStringThe transmission speed of the Vehicle: 4 Speed, 5 Speed, 6 Speed, 7 Speed.
drive_typeStringThe drive type of the Vehicle: FWD, RWD, 4x4, AWD.
liftedBooleanWhether the Vehicle is lifted.
loweredBooleanWhether the Vehicle is lowered.
doorsDoubleThe amount of doors on the Vehicle.
seatsIntegerThe amount of seats in the Vehicle.
engine_displacementDoubleThe engine displacement of the Vehicle.
engine_cylindersIntegerThe engine cylinders of the the Vehicle.
optionsStringVehicle options separated by commas.
imagesStringVehicle images URLs separated by commas.

Response

JSON
{
  "id": 5000,
  "stock": "12345",
  "vin": "ABCDEFG123456789",
  "name": "2018 Ford F-150 XLT SVT Raptor 4x4",
  "year": "2018",
  "make": "Ford",
  "model": "F-150",
  "trim": "XLT SVT Raptor 4x4",
  "price": {
    "selling": 19999,
    "internet": 18999,
    "msrp": 21999
  },
  "created_at": "2020-07-29 16:08:30",
  "updated_at": "2020-07-29 16:08:30",
  "organization": {
      "id": 11,
      "name": "Your Awesome Dealership",
      "createdAt": "2020-06-30 17:25:40",
      "updatedAt": "2020-07-02 19:53:58"
  },
}

Mark a vehicle as Sold

POST Request: https://api.autoznetwork.com/v1/inventory/{inventory_id}/sold

CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"

curl -X POST https://api.autoznetwork.com/v1/inventory/{inventory_id}/sold \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json' \
PHP
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = 'your organization id';

$vehicle = $autoznetwork
              ->withOrganization($organizationId)
              ->inventory($inventoryId)
              ->markAsSold();

print($vehicle)

Mark a vehicle as In Stock (Not Sold)

POST Request: https://api.autoznetwork.com/v1/inventory/{inventory_id}/in-stock

CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"

curl -X POST https://api.autoznetwork.com/v1/inventory/{inventory_id}/in-stock \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json' \
PHP
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = 'your organization id';

$autoZnetwork = new AutozNetwork($apiToken);

$vehicle = $autoznetwork
              ->withOrganization($organizationId)
              ->inventory($inventoryId)
              ->markAsInStock();

print($vehicle)