Integración de Inventario
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
Clientid: 464f4235-8052-4832-a5ea-6738021263fe
Secret Key: Cen/5ic8fYtGbHMD4lU8VYHZ5/sJsU/N4qrl9V2DIzU=
{
"Seller": {
"Identifier": " 05e8ed1b-1355-4486-a6a2-a043959edff9"
},
},
Este Identificador debe ser utilizado en el nodo Seller al momento de gestionar el inventario.
Nombre: Automotora / Concesionaria de prueba
Id: CL-SELLER-1344
El token de acceso de este resultado debe ser usado para todas las solicitudes.
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.
A continuación, encontraran un ejemplo completo de cómo se debe enviar un vehículo (auto para este caso) 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": ""
}
],
"Media": {
"Photos": [
{
"Url": "http://fotos.autos.cl/view/img/usedcars/hex99889/5fa300797e5ae/big/big_0.jpg",
"Order": "1"
},
{
"Url": "http://fotos.autos.cl/view/img/usedcars/hex99889/5fa300797e5ae/big/big_1.jpg",
"Order": "2"
},
{
"Url": "http://fotos.autos.cl/view/img/usedcars/hex99889/5fa300797e5ae/big/big_2.jpg",
"Order": "3"
}
]
},
"Seller": {
"Identifier": "05e8ed1b-1355-4486-a6a2-a043959edff9"
},
"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://globalinventory-publicapi.stg.core.csnglobal.net/v1/vehicles/{InventoryIdentifier}', {
method: 'POST',
body: {
"PublishingDestinations": [
{
"Name": ""
}
],
"Media": {
"Photos": [
{
"Url": "http://fotos.autos.cl/view/img/usedcars/hex99889/5fa300797e5ae/big/big_0.jpg",
"Order": "1"
},
{
"Url": "http://fotos.autos.cl/view/img/usedcars/hex99889/5fa300797e5ae/big/big_1.jpg",
"Order": "2"
},
{
"Url": "http://fotos.autos.cl/view/img/usedcars/hex99889/5fa300797e5ae/big/big_2.jpg",
"Order": "3"
}
]
},
"Seller": {
"Identifier": "05e8ed1b-1355-4486-a6a2-a043959edff9"
},
"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://globalinventory-publicapi.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://globalinventory-publicapi.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
"Registration":{
"Number":"GLDX45"
}
La API actualmente nos permite publicar vehículos asociados a las categorías
Para diferenciar cada categoría solo deben ajustar los valores en los atributos Recordtype y Type, así como los Attributes necesarios dentro de las Specifications. A continuación, mostramos ejemplos para cada categoría:
En en ejemplo de envío de inventario pueden ver todos los atributos necesarios para publicar un auto.
{
"Specification": {
"RecordType": "Autos, camionetas y 4x4"
},
"Type": "Car"
}
{
"Specification":{
"RecordType":"Motos",
"Make":"Ducati",
"Model":"Multistrada",
"ReleaseDate":{
"Year":2020
},
"Title":"DUCATI Multistrada 950 S",
"ShortTitle":"DUCATI Multistrada 950 S",
"Attributes": [
{
"DisplayName": "Color",
"Group": "Detalles",
"Name": "Color",
"Value": "Azul",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Group": "Detalles",
"Name": "BodyStyle",
"Value": "Sport calle - urbanas",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Group": "Detalles",
"Name": "FuelType",
"Value": "Bencina",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Group": "Detalles",
"Name": "GenericGearType",
"Value": "Manual",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"DisplayName": "Cilindrada",
"Group": "Equipamiento",
"Name": "Cilindrada",
"Value": "1800",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"DisplayName": "Tipo Vehiculo",
"Group": "Detalles",
"Name": "TipoVehiculo",
"Value": "Tour",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
}
]
},
"Identifier":"3596889a-7f54-41d0-8716-97acf57ca332",
"Type":"Bike",
}
{
"Specification": {
"RecordType": "Camiones",
"Make": "Maxus",
"Model": "V80",
"ReleaseDate": {
"Year": 2023
},
"Title": "2023 Maxus V80",
"ShortTitle": "2023 Maxus V80",
"Attributes": [
{
"Name": "Color",
"Group": "Detalles",
"DisplayName": "Color",
"Value": "Blanco",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Name": "DoorNumber",
"Group": "Detalles",
"DisplayName": "Puertas",
"Value": "2",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Name": "BodyStyle",
"Group": "Detalles",
"Value": "Camión",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Name": "FuelType",
"Group": "Detalles",
"Value": "Diesel",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Name": "GearType",
"Group": "Detalles",
"Value": "Manual",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Name": "TipoVehiculo",
"Group": "Detalles",
"DisplayName": "Tipo Vehiculo",
"Value": "Camión",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
{
"Name": "TipoCategoria",
"Group": "Detalles",
"DisplayName": "Tipo Categoria",
"Value": "Camiones",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
},
]
},
"Identifier": "b4d888b6-5046-4e85-b6d9-98cc859fdc20",
"Type": "TRUCK",
}
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:
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
}
]
Es posible agregar productos desde la API, para eso solo debes incluir los tags correspondientes.
Para Chileautos, los productos disponbiles son los siguientes:
Existen productos con renovación mensual automática (recurrentes) y productos de un solo uso (one shot)
Para diferenciar el tipo de productos es necesario utilizar la propiedad Value del objeto Tag, como se indica en los siguientes ejemplos.
"Tags": [
{
"Name": "premium",
"Value": "oneshot" // Para oneshot
},
{
"Name": "premium" // Producto reutilizable solo disponible para Premium
},
{
"Name": "topspot",
"Value": "oneshot" // Para oneshot
},
{
"Name": "topspot",
"Value": "recurrente" // Para producto con renovación mensual
},
{
"Name": "showcase",
"Value": "oneshot" // Para oneshot"
},
{
"Name": "showcase",
"Value": "recurrente" // Para producto con renovación mensual
},
{
"Name": "certified.ads",
"Value": "oneshot" // Para oneshot
},
{
"Name": "certified.ads",
"Value": "recurrente" // Para producto con renovación mensual
},
{
"Name": "fb-price-tag",
"Value": "oneshot" // Para oneshot
},
{
"Name": "fb-price-tag",
"Value": "recurrente" // Para producto con renovación mensual
},
{
"Name": "descuentosonline",
"Value": "oneshot" // Solo esta opción está disponible para este producto
}
]
Para el caso del producto Sale (Descuentos Online) es necesario enviar en la lista de precios tanto el precio original como el precio rebajado. El monto mínimo de la rebaja debe ser equivalente al 10%, como se muestra en el siguiente ejemplo, todos los datos son obligatorios y el precio de rebaja debe ir en primer lugar.
"PriceList": [
{
"Type": "Sale",
"Currency": "CLP",
"Amount": 27000000
},
{
"Type": "WAS",
"Currency": "CLP",
"Amount": 30000000
},
]
Es importante cumplir con el formato antes señalado, de lo contrario la API responderá con un mensaje de error y el vehículo no será publicado.
Solo se podrán agregar productos contratados y vigentes, 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": "TopSpot", // Nombre del Producto
"code": "TopSpot", // Código que debo utilizar para agregarlo al aviso
"quantity": 20, // Cantidad total de productos contratados
"lastUpdated": "02/14/2025 16:52:51",
"available": 12, // Cantidad disponible de productos para utilizar
"countryCode": "CL",
"type": "Secondary",
"vertical": null,
"isRecurrent": true, // Indica si el producto es recurrente
"isOneshot": false // Indica si el producto es One Shot
},
{
"name": "Premium",
"code": "Premium",
"quantity": 30,
"lastUpdated": "02/14/2025 16:00:51",
"available": 18,
"countryCode": "CL",
"type": "Primary",
"vertical": null,
"isRecurrent": false,
"isOneshot": true
}
En el ejemplo anterior tenemos los productos TopSpot Recurrente (isRecurrent = true) y Premium One Shot (inOneShot = true)
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:
Ejemplo:
"ExtendedProperties": [
{
"Name": "WhatsApp",
"Value": "+56990432865"
}
]
Para los atributos o especificaciones la información debe ser enviada de esta forma
{
"Name": "Airbag",
"Group": "Equipamiento",
"DisplayName": "Airbag",
"Value": "SI",
"DisplayOnDetailsPage": true,
"IsKeyAttribute": false,
"IsDeleted": false
}
Existe un endpoint que permite actualizar algo específico del aviso sin necesidad de enviar toda 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
Si el dato que se desea modificar está dentro de una lista, es necesario enviar la lista completa desde su nodo padre, por ejemplo si se quiere cambiar el tipo de transmisión (GearType) del vehículo el payload debe ser como el siguiente:
{
"Specification":{
"Attributes":[
{
"Name":"Color",
"FeatureGroup":"Detalles",
"DisplayName":"Color",
"Value":"Blanco",
"DisplayOnDetailsPage":true,
"IsKeyAttribute":false,
"IsDeleted":false
},
{
"Name":"DoorNumber",
"FeatureGroup":"Detalles",
"DisplayName":"Puertas",
"Value":"4",
"DisplayOnDetailsPage":true,
"IsKeyAttribute":false,
"IsDeleted":false
},
{
"Name":"BodyStyle",
"FeatureGroup":"Detalles",
"Value":"SUV",
"DisplayOnDetailsPage":true,
"IsKeyAttribute":false,
"IsDeleted":false
},
{
"Name":"FuelType",
"FeatureGroup":"Detalles",
"Value":"Gas",
"DisplayOnDetailsPage":true,
"IsKeyAttribute":false,
"IsDeleted":false
},
{
"Name":"GearType",
"FeatureGroup":"Detalles",
"Value":"Manual",
"DisplayOnDetailsPage":true,
"IsKeyAttribute":false,
"IsDeleted":false
},
{
"Name":"TipoVehiculo",
"FeatureGroup":"Detalles",
"DisplayName":"Tipo Vehiculo",
"Value":"Autos, Camionetas y 4x4",
"DisplayOnDetailsPage":true,
"IsKeyAttribute":false,
"IsDeleted":false
},
{
"Name":"TipoCategoria",
"FeatureGroup":"Detalles",
"DisplayName":"Tipo Categoria",
"Value":"Camioneta",
"DisplayOnDetailsPage":true,
"IsKeyAttribute":false,
"IsDeleted":false
},
....
]
}
¡Atención! Si se desean eliminar los productos asignados, basta con enviar la propiedad Tags vacía "Tags":[] , como en el siguiente ejemplo:
{
"Tags": []
}
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
Hemos habilitado un endpoint para puedas obtener el inventario de una sucursal específica.
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);
Al enviar el inventario, seguidamente los datos deben ser validados con el endpoint de especificaciones previamente gestionado.
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
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
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
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
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
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:
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
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. ¿ Cómo funciona? Veamos el siguiente diagrama:
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.
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
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",
"Seller": {
"Identifier": "00000000-0000-0000-0000-000000000000",
"Type": null,
"Name": null,
"Email": null,
"Addresses": [
{
"Line1": null,
"Line2": null,
"Suburb": null,
"State": null,
"Country": null,
"CountryCode": null
}
],
"PhoneNumbers": [
{
"Type": null,
"Number": null
},
{
"Type": null,
"Number": null
}
]
},
"Source": null,
"Type": null,
"Status": null,
"Environment": {
"Source": null,
"IpAddress": null
},
"Prospect": {
"Identifier": "00000000-0000-0000-0000-000000000000",
"Type": null,
"Name": null,
"Email": null,
"Addresses": [],
"PhoneNumbers": [
{
"Type": null,
"Number": null
},
{
"Type": null,
"Number": null
}
],
"Identification": [
{
"Type": null,
"Value": null
},
{
"Type": null,
"Value": null
}
]
},
"CreatedUtc": "0001-01-01T00:00:00",
"Labels": [
{
"Type": null,
"Value": null
},
{
"Type": null,
"Value": null
},
{
"Type": null,
"Value": null
}
],
"Item": {
"Type": null,
"Identifier": "00000000-0000-0000-0000-000000000000",
"ListingType": null,
"SaleStatus": null,
"Registration": {
"Number": null
},
"Identification": [
{
"Type": null,
"Value": null
}
],
"OdometerReadings": [
{
"Value": null
}
],
"Seller": {
"Identifier": "00000000-0000-0000-0000-000000000000"
},
"Specification": {
"Make": null,
"Model": null,
"ReleaseDate": {
"Year": null
},
"Title": null
},
"Media": {
"Photos": [
{
"Url": null
}
],
"Videos": [],
"Links": [
{
"Type": null,
"Url": null
}
]
},
"ComplianceDate": {},
"BuildDate": {},
"Warranty": {},
"PriceList": [
{
"Currency": null,
"Amount": null
}
],
"ExtendedProperties": [
{
"Name": null,
"Value": nnll
},
{
"Name": null,
"Value": null
},
{
"Name": null,
"Value": null
}
]
},
"ExtendedProperties": []
}
{
"Identifier": "83ff5b22-5767-4759-bb6b-aab13c28992b",
"Seller": {
"Identifier": "448b6a1c-cd6c-44aa-9ff1-f05f150831aa",
"Type": "Seller",
"Name": "Automotora Ejemplo",
"Email": "autos@ejemplo.cl",
"Addresses": [
{
"Line1": "Av. Vitacura 10001",
"Line2": "",
"Suburb": "Vitacura",
"State": "Santiago",
"Country": "Chile",
"CountryCode": "CL"
}
],
"PhoneNumbers": [
{
"Type": "Work",
"Number": "9984429490"
},
{
"Type": "Home",
"Number": "9984429490"
}
]
},
"Source": "chileautos",
"Type": "Usado",
"Status": "New",
"Environment": {
"Source": "desktop.chileautos",
"IpAddress": "181.42.18.41"
},
"Prospect": {
"Identifier": "543e8e52-098c-401b-8214-5ad9c1e98505",
"Type": "Prospect",
"Name": "Manuel Galdamez",
"Email": "mgaldamez@email.com",
"Addresses": [],
"PhoneNumbers": [
{
"Type": "Home",
"Number": "+56912314874"
},
{
"Type": "Mobile",
"Number": "+56912314874"
}
],
"Identification": [
{
"Type": "Name",
"Value": "Manuel"
},
{
"Type": "LastName",
"Value": "Galdamez"
}
]
},
"CreatedUtc": "2024-10-01T00:30:43.0527329Z",
"Labels": [
{
"Type": "Tag",
"Value": "Used"
},
{
"Type": "Tag",
"Value": "PhotoTypeDealer"
},
{
"Type": "Tag",
"Value": "Billable"
}
],
"Item": {
"Type": "Car",
"Identifier": "1191238c-e705-4e61-80d6-05d9b96ccae6",
"ListingType": "Usado",
"SaleStatus": "In Stock",
"Registration": {
"Number": "LGWX99"
},
"Identification": [
{
"Type": "NetworkId",
"Value": "CL-SELLER-9999"
}
],
"OdometerReadings": [
{
"Value": 89000.0
}
],
"Seller": {
"Identifier": "7132bc5b-ef1a-46f8-a535-94dbea03caf4"
},
"Specification": {
"Make": "Nissan",
"Model": "NP300",
"ReleaseDate": {
"Year": 2018
},
"Title": "2018 Nissan Np300 NP 300 XE 2.3 MT 4X2 DSL DC E5 JYVJ37"
},
"Media": {
"Photos": [
{
"Url": "/car/dealer/a177730hltt9rmj7704zsnqnp.jpg"
},
{
"Url": "/car/dealer/dnvbjv3emhme3z09f5s5st44c.jpg"
}
],
"Videos": [],
"Links": [
{
"Type": "Details",
"Url": "https://www.chileautos.cl/details/1112318c-e705-4e61-80d6-05d9b55ccae6"
}
]
},
"ComplianceDate": {},
"BuildDate": {},
"Warranty": {},
"PriceList": [
{
"Currency": "CLP",
"Amount": 15000000
}
],
"ExtendedProperties": [
{
"Name": "TRIGGERSECTION",
"Value": "topright"
},
{
"Name": "SellerId",
"Value": "CL-SELLER-999"
},
{
"Name": "NetworkId",
"Value": "GI-AD-999999"
}
]
},
"ExtendedProperties": []
}
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.
ChileautosLeadPremium: Son los leads que provienen de nuestro sitio cuando se solicita financiamiento.
Para diferenciar uno de otro solo es necesario validar la información incluida en el campo Source
Para el caso de Lead Premium la única diferencia es que dentro de extendedProperties viene el Rut ingresado en el formulario de contacto.
"extendedProperties": [
{
"Name": "RUT",
"Value": "17423700-k"
}
]
Solicitud inválida
Falla de autenticación / credenciales erróneas
El servidor aceptó y completó la solicitud como se esperaba.
El servidor falló al intentar completar la solicitud debido a un error interno.
El servicio solicitado no está disponible.
Para más información, por favor escribir a soporte@chileautos.cl