Integración de Inventario

Para más información soporte@chileautos.cl

Obtención de Token

Es necesario proveer el token dentro de cada solicitud realizada hacia la Global Inventory API.



    curl --location --request POST 'https://id.s.core.csnglobal.net/connect/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'client_id=464f4235-8052-4832-a5ea-6738021263fe' \
    --data-urlencode 'client_secret=Cen/5ic8fYtGbHMD4lU8VYHZ5/sJsU/N4qrl9V2DIzU=' \
    --data-urlencode 'grant_type=client_credentials'

    fetch('https://id.s.core.csnglobal.net/connect/token', {
    method: 'POST',
    body: new URLSearchParams({
    'client_id': '464f4235-8052-4832-a5ea-6738021263fe',
    'client_secret': 'Cen/5ic8fYtGbHMD4lU8VYHZ5/sJsU/N4qrl9V2DIzU=',
    'grant_type': 'client_credentials'
    }),
    headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
    },
    }).then(response => response.json())
    .then(data => {
    console.log('Success:', data);
    })

    using System;
    using System.Net.Http;
    ...

    async static void GetToken()
    {
    HttpClient client = new HttpClient();
    client.BaseAddress = new Uri("https://id.s.core.csnglobal.net/connect/token");
    var request = new HttpRequestMessage(HttpMethod.Post, "");

    var keyValues = new List<KeyValuePair<string, string>>();
    keyValues.Add(new KeyValuePair<string, string>("client_id", "464f4235-8052-4832-a5ea-6738021263fe"));
    keyValues.Add(new KeyValuePair<string, string>("client_secret", "Cen/5ic8fYtGbHMD4lU8VYHZ5/sJsU/N4qrl9V2DIzU="));
    keyValues.Add(new KeyValuePair<string, string>("grant_type", "client_credentials"));

    request.Content = new FormUrlEncodedContent(keyValues);
    var response = await client.SendAsync(request);

    string result = response.Content.ReadAsStringAsync().Result;
    Console.WriteLine(result);

    }

    $client = new GuzzleHttp\Client();

    $response = $client->request('POST', 'https://id.s.core.csnglobal.net/connect/token', [
    'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded'
    ],
    'form_params' => [
    'client_id' => '464f4235-8052-4832-a5ea-6738021263fe',
    'client_secret' => 'Cen/5ic8fYtGbHMD4lU8VYHZ5/sJsU/N4qrl9V2DIzU=',
    'grant_type' => 'client_credentials',
    ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

Credenciales

Clientid: 464f4235-8052-4832-a5ea-6738021263fe

Secret Key: Cen/5ic8fYtGbHMD4lU8VYHZ5/sJsU/N4qrl9V2DIzU=


{
    "Seller": {
        "Identifier": " 4AA0C7A3-DE66-4F21-91E8-84CA5CD8C6F4"
    },
},

Este Identificador debe ser utilizado en el nodo Seller al momento de gestionar el inventario.

Nombre: Automotora / Concesionaria de prueba

Id: CL-SELLER-99


Estas credenciales son solo para efecto de pruebas. Para obtener credenciales productivas debe contactar soporte@chileautos.cl

El token de acceso de este resultado debe ser usado para todas las solicitudes.

Envío de Inventario

Hemos disponibilizado un servicio que permite la administración del inventario. Con el mismo endpoint es posible publicar y actualizar avisos dentro de nuestro portal.

La API actualmente nos permite publicar vehículos asociados a las categorías Autos,Camionetas y 4x4, asi como Motos y Camiones para diferenciar cada categoría solo deben ajustar los valores en los atributos Recordtype y Type. A continuación, detallamos la información para cada categoría:

Autos


 {
    "Specification": {
        "RecordType": "Autos, camionetas y 4x4"     
    },
    "Type": "Car"
}


Motos


 {
    "Specification": {
        "RecordType": "Motos"     
    },
    "Type": "Bike"
}


Camiones


 {
    "Specification": {
        "RecordType": "Camiones"     
    },
    "Type": "Truck"
}


A continuación, encontraran un ejemplo de cómo se debe enviar un vehículo a publicar:



    curl --location --request POST 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    "PublishingDestinations": [
        {
            "Name": "ChileAutos"
        }
    ],
    "Media": {
        "Photos": [
            {
                "Url": "http://fotos.carplanet.mx/view/img/usedcars/hex99889/5fa300797e5ae/big/big_0.jpg",
                "Order": "1"
            },
            {
                "Url": "http://fotos.carplanet.mx/view/img/usedcars/hex99889/5fa300797e5ae/big/big_1.jpg",
                "Order": "2"
            },
            {
                "Url": "http://fotos.carplanet.mx/view/img/usedcars/hex99889/5fa300797e5ae/big/big_2.jpg",
                "Order": "3"
            }
        ]
    },
    "Seller": {
        "Identifier": "4AA0C7A3-DE66-4F21-91E8-84CA5CD8C6F4"
    },
    "Specification": {
        "RecordType": "Autos, camionetas y 4x4",
        "Make": "Volkswagen",
        "Model": "Polo",
        "ReleaseDate": {
            "Year": 2019
        },
        "Title": "VOLKSWAGEN POLO 2019 DESING SOUND 1.6L L4 105HP TM",
        "ShortTitle": "VOLKSWAGEN POLO 2019",
        "Attributes": [
            {
                "Name": "Color",
                "Group": "Detalles",
                "DisplayName": "Color",
                "Value": "Blanco",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "DoorNumber",
                "Group": "Detalles",
                "DisplayName": "Puertas",
                "Value": "4",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "BodyStyle",
                "Group": "Detalles",
                "Value": "SUV",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "FuelType",
                "Group": "Detalles",
                "Value": "Gas",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "GearType",
                "Group": "Detalles",
                "Value": "Autom\u00e1tica",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "TipoVehiculo",
                "Group": "Detalles",
                "DisplayName": "Tipo Vehiculo",
                "Value": "Autos, Camionetas y 4x4",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "TipoCategoria",
                "Group": "Detalles",
                "DisplayName": "Tipo Categoria",
                "Value": "Camioneta",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Aire Acondicionado",
                "Group": "Equipamiento",
                "DisplayName": "Aire Acondicionado",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Espejos Electricos",
                "Group": "Equipamiento",
                "DisplayName": "Espejos Electricos",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Frenos ABS",
                "Group": "Equipamiento",
                "DisplayName": "Frenos ABS",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Airbag",
                "Group": "Equipamiento",
                "DisplayName": "Airbag",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Cierre Centralizado",
                "Group": "Equipamiento",
                "DisplayName": "Cierre Centralizado",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Catalítico",
                "Group": "Equipamiento",
                "DisplayName": "Catalítico",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Llantas",
                "Group": "Equipamiento",
                "DisplayName": "Llantas",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Alarma",
                "Group": "Equipamiento",
                "DisplayName": "Alarma",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Radio",
                "Group": "Equipamiento",
                "DisplayName": "Radio",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Cilindrada",
                "Group": "Equipamiento",
                "DisplayName": "Cilindrada",
                "Value": "1500",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            }
        ]
    },
    "Identifier": "55253bcc-b1f1-4c43-9c68-70669f6c2076",
    "Type": "Car",
    "ListingType": "Usado",
    "SaleStatus": "In Stock",
   "Registration": {
     "Number": "ABCD12"
    },
    "Description": "",
    
    "ExtendedProperties": [
        {
        "Name": "WhatsApp",
            "Value": "+56990432865"
        }
    ],
    
    "Colours": [
        {
        "Location": "Exterior",
            "Generic": "Grey",
            "Name": "Gris"
        },
        {
        "Location": "Interior",
            "Generic": "Grey",
            "Name": "Gris"
        }
    ],
    "OdometerReadings": [
        {
        "Value": 21968,
            "UnitOfMeasure": "KM"
        }
    ],
    "PriceList": [
        {
        "Currency": "CLP",
        "Amount": 224700
        }
    ]
}'

fetch('http://globalinventorypublicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}', {
    method: 'POST',
    body: {
    "PublishingDestinations": [
        {
            "Name": "ChileAutos"
        }
    ],
    "Media": {
        "Photos": [
            {
                "Url": "http://fotos.carplanet.mx/view/img/usedcars/hex99889/5fa300797e5ae/big/big_0.jpg",
                "Order": "1"
            },
            {
                "Url": "http://fotos.carplanet.mx/view/img/usedcars/hex99889/5fa300797e5ae/big/big_1.jpg",
                "Order": "2"
            },
            {
                "Url": "http://fotos.carplanet.mx/view/img/usedcars/hex99889/5fa300797e5ae/big/big_2.jpg",
                "Order": "3"
            }
        ]
    },
    "Seller": {
        "Identifier": "4AA0C7A3-DE66-4F21-91E8-84CA5CD8C6F4"
    },
    "Specification": {
        "RecordType": "Autos, camionetas y 4x4",
        "Make": "Volkswagen",
        "Model": "Polo",
        "ReleaseDate": {
            "Year": 2019
        },
        "Title": "VOLKSWAGEN POLO 2019 DESING SOUND 1.6L L4 105HP TM",
        "ShortTitle": "VOLKSWAGEN POLO 2019",
        "Attributes": [
            {
                "Name": "Color",
                "Group": "Detalles",
                "DisplayName": "Color",
                "Value": "Blanco",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "DoorNumber",
                "Group": "Detalles",
                "DisplayName": "Puertas",
                "Value": "4",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "BodyStyle",
                "Group": "Detalles",
                "Value": "SUV",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "FuelType",
                "Group": "Detalles",
                "Value": "Gas",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "GearType",
                "Group": "Detalles",
                "Value": "Autom\u00e1tica",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "TipoVehiculo",
                "Group": "Detalles",
                "DisplayName": "Tipo Vehiculo",
                "Value": "Autos, Camionetas y 4x4",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "TipoCategoria",
                "Group": "Detalles",
                "DisplayName": "Tipo Categoria",
                "Value": "Camioneta",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Aire Acondicionado",
                "Group": "Equipamiento",
                "DisplayName": "Aire Acondicionado",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Espejos Electricos",
                "Group": "Equipamiento",
                "DisplayName": "Espejos Electricos",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Frenos ABS",
                "Group": "Equipamiento",
                "DisplayName": "Frenos ABS",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Airbag",
                "Group": "Equipamiento",
                "DisplayName": "Airbag",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Cierre Centralizado",
                "Group": "Equipamiento",
                "DisplayName": "Cierre Centralizado",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Catalítico",
                "Group": "Equipamiento",
                "DisplayName": "Catalítico",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Llantas",
                "Group": "Equipamiento",
                "DisplayName": "Llantas",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Alarma",
                "Group": "Equipamiento",
                "DisplayName": "Alarma",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Radio",
                "Group": "Equipamiento",
                "DisplayName": "Radio",
                "Value": "SI",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            },
            {
                "Name": "Cilindrada",
                "Group": "Equipamiento",
                "DisplayName": "Cilindrada",
                "Value": "1500",
                "DisplayOnDetailsPage": true,
                "IsKeyAttribute": false,
                "IsDeleted": false
            }
        ]
    },
    "Identifier": "55253bcc-b1f1-4c43-9c68-70669f6c2076",
    "Type": "Car",
    "ListingType": "Usado",
    "SaleStatus": "In Stock",
    "Registration": {
        "Number": "ABCD12"
    },
    "Description": "",
    
    "ExtendedProperties": [
        {
        "Name": "WhatsApp",
            "Value": "+56990432865"
        }
    ],
    
    "Colours": [
        {
        "Location": "Exterior",
            "Generic": "Grey",
            "Name": "Gris"
        },
        {
        "Location": "Interior",
            "Generic": "Grey",
            "Name": "Gris"
        }
    ],
    "OdometerReadings": [
        {
        "Value": 21968,
            "UnitOfMeasure": "KM"
        }
    ],
    "PriceList": [
        {
        "Currency": "CLP",
         "Amount": 224700
        }
    ]
},
 headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer {access_token}'
    }
}).then(response => response.json())
.then(data => {
    console.log('Success:', data);
})

using System;
using System.Net.Http;
using Newtonsoft.Json;
...

async static void CreateVehicle()
{

    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/json');

    var vehicle = new Vehicle("property1", "property2", ...);

    var json = JsonConvert.SerializeObject(vehicle);
    var data = new StringContent(json, Encoding.UTF8, "application/json");

    var uri = "http://globalinventorypublicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}";

    var response = await client.PostAsync(uri);

    string result = response.Content.ReadAsStringAsync().Result;
    Console.WriteLine(result);
}

    $client = new GuzzleHttp\Client();

    $response = $client->request('POST', 'http://globalinventorypublicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}', [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {access_token}'
        ],
        'body' => [
            'Identifier' => '6C705713-52E6-447B-9FC2-C3C155EF41D0',
            'Type' => 'CAR',
            'ListingType' => 'USADO',
            'SaleStatus' => 'In Stock',
            'Description' => 'This is just a comment',
            'Key' => 'Value',
            'Key' => 'Value',
            ...
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

InventoryIdentifier es un valor de tipo GUID que debe ser generado por el usuario. Dicho identifier debe ser el mismo que va en el objeto de envío, en el campo Identifier.
Seller Identifier representa el valor para una sucursal. Para obtener un valor productivo debe contactar soporte@chileautos.cl
Registration.Number ó Patente es obligatoria en los avisos correspondientes a la categoría Autos, camionetas y 4x4. Asegúrese de enviar un valor con un formato valido de acuerdo a la normativa de Chile, e incluya todas las letras de la patente en mayúsculas. Ejemplo: XXXX00

Media

Es posible agregar videos a los avisos,para ello solo debes agregar al nodo Media la siguiente información:


"Videos": [
	{
		"Url": "https://myexample.com/file.mp4",
		"Order": 1
	}
]


Los videos deben cumplir con las siguientes especificaciones:

  • Duración: Máximo 60 segundos ó 100 Mb
  • Formato: MP4 ó MOV

Precios (PriceList)

Es posible configurar el precio de un aviso tanto en moneda local (CLP) o en moneda extranjera (USD).

Ejemplo:

Moneda Local

"PriceList": [
    {
      "Currency": "CLP",
      "Amount": 224700
    }
]


Moneda extranjera (USD)

"PriceList": [
    {
      "Currency": "USD",
      "Amount": 430000.0
    }
]


Productos

Es posible agregar productos desde la API, para eso solo debes incluir el nombre de los mismos en el array tags. Para Chileautos, los productos disponbiles son:

  • Premium: El tag que se debe enviar es premium
  • Posición Top: El tag que se debe enviar es topspot
  • Vitrina: El tag que se debe enviar es showcase
"Tags": [
    {
        "Name": "premium"
    },
    {
        "Name": "topspot"
    },
    {
        "Name": "showcase"
    }
]

Para consultar la disponibilidad de los productos deben usar el siguiente endpoint:



    curl --location --request GET 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/customers/{seller_identifier}/products' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Content-Type: application/json' \
    --data-raw ''

    fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/customers/{seller_identifier}/products', {
    method: 'GET',
    headers: {
    'Authorization': 'Bearer {access_token}'
    'Content-Type': 'application/json',
    },
    .then(response => response.json())
    .then(data => {
    console.log('Success:', data);
    })

using System;
using System.Net.Http;
using System.Threading.Tasks;

async static void Search()
{
    //...
    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/json');

    string uri = 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/customers/{seller_identifier}/products';

    HttpResponseMessage response = await client.GetAsync(uri);

    string contentString = await response.Content.ReadAsStringAsync();
    dynamic parsedJson = JsonConvert.DeserializeObject(contentString);
    Console.WriteLine(parsedJson);
}

    $client = new \GuzzleHttp\Client();
    $response = $client->request('GET', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/customers/{seller_identifier}/products', [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization'  => 'Bearer {access_token}'
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

El response de este endpoint nos entrega los detalles de los productos disponibles para el cliente:


    {
        "name": "Aviso Premium",//Nombre del Producto
        "code": "Premium",//código que debo utilizar para agregarlo al aviso
        "quantity": 20,
        "available": 18, // disponibilidad
        "countryCode": "CL",
        "type": "Primary",
        "vertical": null
    }

Estos productos solo se pueden asignar a los avisos si tienen la disponibilidad suficiente. Asegúrese de contratar los mismos antes de enviar la información a la API, de lo contrario recibira un error como respuesta.

WhastApp

Es posible agregar este producto a un aviso a través del nodo ExtendedProperties al momento de publicar. Se debe tener en cuenta la siguiente estructura del número telefónico:

  • Prefijo país: +56
  • Prefijo operadora: 9
  • Nro asignado: 1111111

Ejemplo:


"ExtendedProperties": [
        {
            "Name": "WhatsApp",
            "Value": "+56990432865"
        }
    ]

Estos productos solo se pueden asignar a los avisos si tienen la disponibilidad suficiente. Asegúrese de contratar los mismos antes de enviar la información a la API, de lo contrario recibira un error como respuesta.

Atributos

Para los atributos o especificaciones la informacion debe ser enviada de esta forma


{
    "Name": "Airbag",
    "Group": "Equipamiento",
    "DisplayName": "Airbag",
    "Value": "SI",
    "DisplayOnDetailsPage": true,
    "IsKeyAttribute": false,
    "IsDeleted": false
}


Tomen en cuenta que el campo Group le permite agrupar caracteristicas del vehiculo, y eso se vera reflejado en el sitio de la siguiente forma

Actualización del Aviso

Hemos habilitado un nuevo endpoint que les permitira actualizar algo especifico del aviso sin necesidad de enviar todo la información.



curl --location --request PATCH 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}' \
--header 'accept: */*' \
--header 'Content-Type: application/merge-patch+json' \
--header 'Authorization: Bearer {access_token}' \
--header 'x-seller-identifier: {seller_identifier}' \
--header 'Cookie: csncidcf=69DB9F96-EB3A-49F9-A600-50504FA6627E' \
--data-raw '{

"OdometerReadings":[
      {
         "Value":60000,
         "UnitOfMeasure":"KM"
      }
   ]

}'

fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}', {
    method: 'PATCH',
    body: {
        "OdometerReadings":[
            {
            "Value":60000,
            "UnitOfMeasure":"KM"
            }
        ]},
        headers: {
            'accept': '*/*',
            'Content-Type': 'application/merge-patch+json',
            'Authorization': 'Bearer {access_token}',
            'x-seller-identifier': '{seller_identifier}',
            'Cookie': 'csncidcf=69DB9F96-EB3A-49F9-A600-50504FA6627E'
        }
    }).then(response => response.json())
    .then(data => {
        console.log('Success:', data);
})


using System;
using System.Net.Http;
using Newtonsoft.Json;
...

async static void CreateVehicle()
{

    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/merge-patch+json');
    client.DefaultRequestHeaders.Add("x-seller-identifier", '{seller_identifier}');
    client.DefaultRequestHeaders.Add("Cookie", 'csncidcf=69DB9F96-EB3A-49F9-A600-50504FA6627E');
    client.DefaultRequestHeaders.Add("accept", '*/*');

    var vehicle = new Vehicle("property1", "property2", ...);

    var json = JsonConvert.SerializeObject(vehicle);
    var data = new StringContent(json, Encoding.UTF8, "application/json");

    var uri = "http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}";

    var response = await client.PatchtAsync(uri);

    string result = response.Content.ReadAsStringAsync().Result;
    Console.WriteLine(result);
}

    $client = new GuzzleHttp\Client();

    $response = $client->request('PATCH', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}', [
        'headers' => [
            'accept' => '*/*',
            'Content-Type' => 'application/merge-patch+json',
            'Authorization' => 'Bearer {access_token}',
            'x-seller-identifier' => '{seller_identifier}',
            'Cookie' => 'csncidcf=69DB9F96-EB3A-49F9-A600-50504FA6627E'
        ],
        'body' => [
            'SaleStatus' => 'In Stock',
            'Description' => 'This is just a comment',
            'Key' => 'Value',
            'Key' => 'Value',
            ...
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

Tomen en cuenta que para el uso de estos dos últimos endpoints es necesario enviar en el header el x-seller-identifier que es el identificador de la automotora.

Eliminación del Aviso

Hemos habilitado un endpoint para que la eliminación de los avisos sea mas sencilla.



curl --location --request DELETE 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}' \
--header 'accept: */*' \
--header 'Authorization: Bearer {access_token}' \
--header 'x-seller-identifier: {seller_identifier}' \
--header 'Cookie: csncidcf=69DB9F96-EB3A-49F9-A600-50504FA6627E'

fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}', {
    method: 'DELETE',
        headers: {
            'accept': '*/*',
            'Authorization': 'Bearer {access_token}',
            'x-seller-identifier': '{seller_identifier}',
            'Cookie': 'csncidcf=69DB9F96-EB3A-49F9-A600-50504FA6627E'
        }
    }).then(response => response.json())
    .then(data => {
        console.log('Success:', data);
})


using System;
using System.Net.Http;
using Newtonsoft.Json;
...

async static void CreateVehicle()
{

    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("x-seller-identifier", '{seller_identifier}');
    client.DefaultRequestHeaders.Add("Cookie", 'csncidcf=69DB9F96-EB3A-49F9-A600-50504FA6627E');
    client.DefaultRequestHeaders.Add("accept", '*/*');

    var uri = "http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}";

    var response = await client.DeleteAsync(uri);

    string result = response.Content.ReadAsStringAsync().Result;
    Console.WriteLine(result);
}

    $client = new GuzzleHttp\Client();

    $response = $client->request('DELETE', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}', [
        'headers' => [
            'accept' => '*/*',
            'Authorization' => 'Bearer {access_token}',
            'x-seller-identifier' => '{seller_identifier}',
            'Cookie' => 'csncidcf=69DB9F96-EB3A-49F9-A600-50504FA6627E'
        ]
    ]);

    echo $response->getStatusCode(); // 200

Tomen en cuenta que para el uso de estos dos últimos endpoints es necesario enviar en el header el x-seller-identifier que es el identificador de la automotora.

Obtención de Inventario

Hemos habilitado un endpoint para puedas obtener el inventario de una sucursal especifica.



curl --location --request GET 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/active_items?page=1&limit=100' \
--header 'accept: */*' \
--header 'Content-Type: application/merge-patch+json' \
--header 'Authorization: Bearer {{token}}' \
--header 'x-seller-identifier: {{seller_identifier}}' \
--data-raw ''

fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/active_items?page=1&limit=100', {
    headers: {
        'accept': '*/*',
        'Content-Type': 'application/merge-patch+json',
        'Authorization': 'Bearer {{token}}',
        'x-seller-identifier': '{{seller_identifier}}'
    }
});
})


using System.Net.Http.Headers;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/active_items?page=1&limit=100");

request.Headers.Add("accept", "*/*");
request.Headers.Add("Authorization", "Bearer {{token}}");
request.Headers.Add("x-seller-identifier", "{{seller_identifier}}");

request.Content = new StringContent("");
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/merge-patch+json");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();


 $ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/active_items?page=1&limit=100');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');


$headers = array();
$headers[] = 'Accept: */*';
$headers[] = 'Content-Type: application/merge-patch+json';
$headers[] = 'Authorization: Bearer {{token}}';
$headers[] = 'X-Seller-Identifier: {{seller_identifier}}';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);

Tomen en cuenta que para el uso de este endpoint es necesario enviar en el header el x-seller-identifier que es el identificador de la automotora.

Estructura DTO -
https://github.com/carsales/csn-dto.

  • PublishingDestinations - indica dónde se hará la publicación del aviso. Para Chile, debería ser ChileAutos
  • InventoryIdentifier – GUID único que identifica la publicación
  • SellerIdentifier – GUID del vendedor
  • ListingType – Valores posibles – Nuevo or Usado
  • SaleStatus – Valores posibles – In Stock, Sold o Withdrawn
  • RecordType - Autos, camionetas y 4x4 para Autos
  • Tags – contiene la lista de productos contratados, tales como Premium, VIP, etc.
  • Specifications – los nombres de los atributos aplicables pertenecientes a este listado - https://github.com/carsales/csn-dto/blob/master/docs/car.attributes.json
  • Media -> Photos -> Url - La URL completa de la imágen.

Especificaciones y catálogo de vehículos

Al enviar el inventario, seguidamente los datos deben ser validados con el endpoint de especificaciones previamente gestionado.

  • Makes
  • Models
  • Specification -> Attributes -> BodyStyle
  • Specification -> Attributes -> FuelType
  • Specification -> Attributes -> GearType
  • Colours -> Name

Marcas



    curl --location --request GET 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/makes' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Content-Type: application/json' \
    --data-raw ''

    fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/makes', {
    method: 'GET',
    headers: {
    'Authorization': 'Bearer {access_token}'
    'Content-Type': 'application/json',
    },
    .then(response => response.json())
    .then(data => {
    console.log('Success:', data);
    })

using System;
using System.Net.Http;
using System.Threading.Tasks;

async static void Search()
{
    //...
    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/json');

    string uri = 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/makes';

    HttpResponseMessage response = await client.GetAsync(uri);

    string contentString = await response.Content.ReadAsStringAsync();
    dynamic parsedJson = JsonConvert.DeserializeObject(contentString);
    Console.WriteLine(parsedJson);
}

    $client = new \GuzzleHttp\Client();
    $response = $client->request('GET', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/makes', [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization'  => 'Bearer {access_token}'
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

Modelos



    curl --location --request GET 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/makes/BMW/models' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Content-Type: application/json' \
    --data-raw ''

    fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/makes/BMW/models', {
    method: 'GET',
    headers: {
    'Authorization': 'Bearer {access_token}'
    'Content-Type': 'application/json',
    },
    .then(response => response.json())
    .then(data => {
    console.log('Success:', data);
    })

    using System;
    using System.Net.Http;
    using System.Threading.Tasks;
    using Newtonsoft.Json;

    async static void Search()
    {
    //...
    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/json');

    string uri = 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/makes/BMW/models';

    HttpResponseMessage response = await client.GetAsync(uri);

    string contentString = await response.Content.ReadAsStringAsync();
    dynamic parsedJson = JsonConvert.DeserializeObject(contentString);
    Console.WriteLine(parsedJson);
    }

    $client = new \GuzzleHttp\Client();
    $response = $client->request('GET', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/makes/BMW/models', [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization'  => 'Bearer {access_token}'
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

Carrocería


curl --location --request GET 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/body_types' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Content-Type: application/json' \
    --data-raw ''
fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/body_types', {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer {access_token}'
        'Content-Type': 'application/json',
    },
    .then(response => response.json())
    .then(data => {
        console.log('Success:', data);
    })

using System;
using System.Net.Http;
using System.Threading.Tasks;

async static void Search()
{
    //...
    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/json');

    string uri = 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/body_types';

    HttpResponseMessage response = await client.GetAsync(uri);

    string contentString = await response.Content.ReadAsStringAsync();
    dynamic parsedJson = JsonConvert.DeserializeObject(contentString);
    Console.WriteLine(parsedJson);
}

    $client = new \GuzzleHttp\Client();
    $response = $client->request('GET', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/body_types', [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization'  => 'Bearer {access_token}'
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

Tipos de combustible


curl --location --request GET 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/fuel_types' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Content-Type: application/json' \
    --data-raw ''
fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/fuel_types', {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer {access_token}'
        'Content-Type': 'application/json',
    },
    .then(response => response.json())
    .then(data => {
        console.log('Success:', data);
    })

using System;
using System.Net.Http;
using System.Threading.Tasks;

async static void Search()
{
    //...
    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/json');

    string uri = 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/fuel_types';

    HttpResponseMessage response = await client.GetAsync(uri);

    string contentString = await response.Content.ReadAsStringAsync();
    dynamic parsedJson = JsonConvert.DeserializeObject(contentString);
    Console.WriteLine(parsedJson);
}

    $client = new \GuzzleHttp\Client();
    $response = $client->request('GET', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/fuel_types', [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization'  => 'Bearer {access_token}'
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

Tipos de motor


curl --location --request GET 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/gear_types' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Content-Type: application/json' \
    --data-raw ''

    fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/gear_types', {
        method: 'GET',
        headers: {
        'Authorization': 'Bearer {access_token}'
        'Content-Type': 'application/json',
        },
        .then(response => response.json())
        .then(data => {
        console.log('Success:', data);
    })

using System;
using System.Net.Http;
using System.Threading.Tasks;

async static void Search()
{
    //...
    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/json');

    string uri = 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/gear_types';

    HttpResponseMessage response = await client.GetAsync(uri);

    string contentString = await response.Content.ReadAsStringAsync();
    dynamic parsedJson = JsonConvert.DeserializeObject(contentString);
    Console.WriteLine(parsedJson);
}

    $client = new \GuzzleHttp\Client();
    $response = $client->request('GET', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/gear_types', [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization'  => 'Bearer {access_token}'
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

Colores


curl --location --request GET 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/colours' \
    --header 'Authorization: Bearer {access_token}' \
    --header 'Content-Type: application/json' \
    --data-raw ''
fetch('http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/colours', {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer {access_token}'
        'Content-Type': 'application/json',
    },
    .then(response => response.json())
    .then(data => {
        console.log('Success:', data);
    })

using System;
using System.Net.Http;
using System.Threading.Tasks;

async static void Search()
{
    //...
    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", 'Bearer {access_token}');
    client.DefaultRequestHeaders.Add("Content-Type", 'application/json');

    string uri = 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/colours';

    HttpResponseMessage response = await client.GetAsync(uri);

    string contentString = await response.Content.ReadAsStringAsync();
    dynamic parsedJson = JsonConvert.DeserializeObject(contentString);
    Console.WriteLine(parsedJson);
}

    $client = new \GuzzleHttp\Client();
    $response = $client->request('GET', 'http://globalinventory-publicapi.stg.core.csnglobal.net/v1/specifications/cl/car/colours', [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization'  => 'Bearer {access_token}'
        ]
    ]);

    echo $response->getStatusCode(); // 200
    echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
    echo $response->getBody(); // '{"Key":"Value", ...}'
    var_export($response->json());             // Outputs the JSON decoded data

A través del navegador, visite esta URL para validar si su aviso fue publicado correctamente. Para ello será necesario:

  • Para otorgar acceso, deberá proveer su IP Pública al correo soporte@chileautos.cl.
  • GUID de la publicación que desea validar.
    
        http://ds-integration-ore.s.core.csnglobal.net/detalle/_/{{advert_identifier}}?site=encoauto.chileautos.cl

        // Example

        http://ds-integration-ore.s.core.csnglobal.net/detalle/_/63473424-0689-4DB1-A3BD-6724FEADD8F0?site=encoauto.chileautos.cl
    

Envío de Leads

Sabemos lo importante que es recibir de manera inmediata cada uno de los leads generados en el sitio, es por eso que ofrecemos la opción de  integrarnos con tu sistema mediante el uso de webhooks.

Gracias a los webhooks, podrás recibir notificaciones HTTP en tiempo real sobre los leads que se generen en tus avisos. ¿ Como funciona? Veamos el siguiente diagrama:

Pasos para empezar a recibir notificaciones

  • Creación de un punto de conexión

Es responsabilidad de cada cliente proporcionar un punto de conexión real para que podamos enviar las notificaciones.

Tu punto de conexión debe tener la capacidad de procesar solicitudes HTTPS. Tu servidor debe tener un certificado TLS o SSL válido, correctamente configurado e instalado. No se admiten los certificados autofirmados.

Las notificaciones las enviamos a tu punto de conexión con una solicitud POST con una carga json que contiene toda la información del lead.

La autorización del HTTP POST para eso debes configurar tu punto de conexión con headers personalizados (fijos) específicos o parámetros query strings (fijos).

Ejemplo:


    access_token: 123
    Authorization: Basic abc
  • Configuración del punto de conexión

Una vez hayas finalizado tu desarrollo debes hacernos llegar email a soporte@chileautos.cl con la siguientes información:

1. Url del punto de conexión

2. Headers (en caso de que sea necesario)

3. Lista de agencias que estarán suscriptas a este punto de conexión.

¿Qué información enviamos al punto de conexión?

La estructura de los leads se basa en este DTO carsales/csn-dto en particular esta estructura https://github.com/carsales/csn-dto/blob/master/Csn.Public.Dto/Lead/Lead.cs

Lead.cs


using System;
using System.Collections.Generic;

namespace Csn.Public.Dto
{
    public class Lead
    {
        public Lead()
        {
            Prospect = new Customer();
            Environment = new Environment();
        }

        /* required */
        public Guid Identifier { get; set; }
        /* ISO Short two char country codes, e.g. AU, NZ, US etc. */
        public string CountryCode { get; set; }
        public Customer Seller { get; set; }

        /* coded name provided for the company sending the lead e.g. CARSALES */
        public string Source { get; set; }

        /* 
            Type = [GENERAL, ITEM] 
            
            Should it be expected to have an item attached (ITEM) or not (GENERAL). 
            Note that ServiceRequests handle what services are being enquired on e.g. finance, insurance, service, sales etc.
            Item.ListingType handles whether the item is new, used or demo etc.
        */
        public string Type { get; set; }

        /* Status = [New, Contact, Commitment, Sold, Lost, Duplicate, Unworkable] */
        public string Status { get; set; }  
        
        public Environment Environment { get; set; }
        public Customer Prospect { get; set; }

        public string Comments { get; set; }
        public DateTime CreatedUtc { get; set; }
        public DateTime? ModifiedUtc { get; set; }

        /*
            Labels is replacing Tags, and provides a means to add labels of various types
            Type = [Private, System, Device, User]
            Value is used to denote the actual label itself.
        */
        public List Labels { get; set; }

        /* ServiceRequest.Type = [Finance, Insurance etc] */
        public List ServiceRequests { get; set; }

        public TelephoneCall PhoneCall { get; set; }

        public Vehicle Item { get; set; }
        public Vehicle TradeIn { get; set; }

        public List History { get; set; }
        public Assignment Assignment { get; set; }
        public List ExtendedProperties { get; set; }
    }

    public class Assignment
    {
        public Guid? Identifier { get; set; }
        public string Email { get; set; }
        public string Name { get; set; }
        public DateTime AssignedUtc { get; set; }
    }

    public class HistoryItem
    {
        public Guid? Identifier { get; set; }
        public string Type { get; set; }
        public DateTime CreatedUtc { get; set; }
        public string Note { get; set; }
        public string Status { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
    }

    public class Environment
    {
        /* location name of where the lead was submitted from */
        public string Source { get; set; }

        /* domain name of the site sending the lead */
        public string Url { get; set; }

        /* IP address of the users device submitting the lead - helpful in tracking spam etc. */
        public string IpAddress { get; set; }

        /* an identifier of the session for the user submitting the lead - assists with lead tracking */
        public string SessionId { get; set; }
    }
}


{
  "identifier": "00000000-0000-0000-0000-000000000000",
  "uniqueIdentifier": null,
  "id": 0,
  "country": null,
  "tenant": null,
  "itemId": null,
  "sellerId": null,
  "service": null,
  "leadType": null,
  "requestType": null,
  "itemType": null,
  "environment": {
    "source": null,
    "url": null,
    "ipAddress": null,
    "sessionId": null
  },
  "prospect": {
    "title": null,
    "firstName": null,
    "lastName": null,
    "companyName": null,
    "email": null,
    "suburb": null,
    "state": null,
    "postcode": null,
    "mobilePhone": null,
    "homePhone": null,
    "workPhone": null,
    "identificationNumbers": [
      {
        "type": null,
        "value": null
      }
    ],
    "memberTrackingId": "00000000-0000-0000-0000-000000000000"
  },
  "subscription": {
  "newsletter": false,
  "financeQuote": false,
  "insuranceQuote": false,
  "confirmResponse": false,
  "survey": false
  },
  "tradeIn": {
  "make": null,
  "model": null,
  "year": null,
  "kms": null,
  "detailsUrl": null,
  "colour": null,
  "type": null
},
  "extendedProperties": [
  {
  "name": null,
  "value": null
  }
  ],
  "fraudInfo": {
  "ServerVariables": [
      {
        "Key": null,
        "Value": null      
      }
    ]
  },
  "comments": null,
  "created": "0001-01-01T00:00:00",
  "tags": [null],
  "item": {
  "id": null,
  "make": null,
  "model": null,
  "description": null,
  "year": null,
  "price": null,
  "spotId": null,
  "registrationNumber": null,
  "transmission": null,
  "colour": null,
  "bodyType": null,
  "odometer": null,
  "fuelType": null,
  "detailsUrl": null,
  "identifier": null,
  "photoPath": null,
  "engineDescription": null
},
  "history": [
  {
      "identifier": null,
      "type": null,
      "createdUtc": "0001-01-01T00:00:00",
      "note": null,
      "status": null,
      "name": null,
      "email": null
  }
  ],
  "assignment": {
  "identifier": null,
  "email": null,
  "name": null,
  "assignedUtc": "0001-01-01T00:00:00"
},
  "status": null,
  "labels": [{
      "type": null,
      "value": null
    }
  ],
  "serviceRequests": [
  {
      "type": null,
      "value": null
  }
  ],
  "createdUtc": "0001-01-01T00:00:00",
  "modifiedUtc": null
}


Ejemplo


{
  "identifier": "83ff5b22-5767-4759-bb6b-aab13c28992b",
  "uniqueIdentifier": "448b6a1c-cd6c-44aa-9ff1-f05f150831aa",
  "id": 0,
  "country": "CL",
  "tenant": "chileautos",
  "itemId": "CP-AD-7948621",
  "sellerId": "58d7f9e1-59c1-401f-bf51-9cdf44c4b8b5",
  "service": "chileautos",
  "leadType": "Usado",
  "requestType": null,
  "itemType": "CAR",
  "environment": {
    "source": "chileautos",
    "url": "https://chileautos.cl /vehiculos/detalles/2018-nissan-np300-np-300-xe-2-3-mt-4x2-dsl-dc-e5-jyvj37/CP-AD-7948621/?Cr=1",
    "ipAddress": "181.42.18.41",
    "sessionId": null
  },
  "prospect": {
    "title": "2018 Nissan Np300 NP 300 XE 2.3 MT 4X2 DSL DC E5 JYVJ37",
    "firstName": "Deidy",
    "lastName": "Perez",
    "email": "deidy.perez@carsales.com",
    "suburb": null,
    "state": null,
    "postcode": null,
    "mobilePhone": "+56951063788",
    "homePhone": null,
    "workPhone": null,
    "identificationNumbers": [
      {
        "type": "RUT",
        "value": "11111111-1"
      }
    ],
    "memberTrackingId": "00000000-0000-0000-0000-000000000000"
  },
  "extendedProperties": [
     {
        "name": "TRIGGERSECTION",
        "value": "topright"
      },
      {
        "name": "SellerId",
        "Value": "CL-SELLER-99"
      },
      {
        "name": "NetworkId",
        "value": "CP-AD-7948621"
      }
  ],
  "comments": "Esto es una prueba, no contactar",
  "created": "2022-03-16T22:29:47.902934Z",
  "item": {
    "id": "CP-AD-7948621",
    "make": "Nissan",
    "model": "Np300",
    "description": "2018 Nissan Np300 NP 300 XE 2.3 MT 4X2 DSL DC E5 JYVJ37",
    "year": 2018,
    "price": 30500000,
    "registrationNumber": "ABCD12",
    "transmission": "Manual",
    "colour": "Black",
    "bodyType": "SUV",
    "odometer": 2550,
    "fuelType": "Bencina",
    "detailsUrl": "https://chileautos.cl /vehiculos/detalles/2018-nissan-np300-np-300-xe-2-3-mt-4x2-dsl-dc-e5-jyvj37/CP-AD-7948621/?Cr=1",
    "identifier": "fdea1e50-1108-4842-a6c4-5af1f5903aa0",
    "photoPath": "/cars/dealer/48qcu14si23njjiuxg3rykx23.jpg"
  },
  "status": "New",
  "createdUtc":  "2022-10-04T18:25:12.2",
  "modifiedUtc":  "0001-01-01T00:00:00"
}

Tipos de Leads

Dependiendo de los servicios contratados podrás recibir leads de diferentes fuentes, entre estas fuentes tenemos:

  • Chileautos: Son los leads que provienen de nuestro sitio.

  • WhatsApp: Son los leads generados mediante nuestro servicio de Whatsapp Premium.

Para diferenciar uno de otro solo es necesario validar la información incluida en el campo Source

API Responses

HTTP Status Code 400:

Solicitud inválida

HTTP Status Code 401:

Falla de autenticación / credenciales erróneas

HTTP Status Code 202:

El servidor aceptó y completó la solicitud como se esperaba.

HTTP Status Code 500:

El servidor falló al intentar completar la solicitud debido a un error interno.

HTTP Status Code 503:

El servicio solicitado no está disponible.

Contacto

Para más información, por favor escribir a soporte@chileautos.cl