Resources · CSV and feeds

CSV synchronisation: full specification

Specification of the items CSV: fields, limits, car and motorbike attributes, and delivery via SFTP or URL.

For synchronisation between customers and Portal Hero we use a system of CSV files. The main CSV file is the items file (or item feed), which lists all the items published on the different portals. This file contains the items with their characteristics.

How synchronisation works

The way to identify each item is through the id field, which we rely on as the unique identifier to decide whether an item is updated or ceases to exist. When an item appears for the first time in the item feed, it is uploaded to all the portals selected by the customer. When an item is no longer present in the feed, it is marked as sold, and when any of an item's data changes, it is also updated on the portals. For more details on synchronisation itself you can check them here.

The general format of these CSV files is as follows:

  • Fields separated by commas
  • The header must be present in order to identify the fields
  • Fields delimited by double quotes (where necessary or always)
  • File encoding UTF-8

File sharing

We have two options for getting the file to us:

  • SFTP
    We provide an SFTP to share the files and make the secure exchange of information easier. The SFTP access details (username and password) will be provided during the onboarding process.
    The rest of the common connection details are as follows:
    • Host: sftp.portalhero.pro
    • Port: 2222

    In addition, the SFTP is secured and restricted at the network level, and we will need one or more IPs to add them to our list of allowed access IPs.
    Within the SFTP there is a folder called upload where the files will be written: for the items file the file name will be: item_feed.csv
  • url
    The item feed can also be sent via a public URL from which the Portal Hero process will download it on each daily run of the process.
    The URL must be provided by the customer during the onboarding process. If more security measures are required, you can provide us with any header(s), which we will add to the request.

CSV file format

List of the fields, detail types and examples of the items CSV file:

NameTypeRequiredDescriptionExample
idstringYesUnique identifier of the item. It must be unique across all items and is the one we will use to refer to items in our communications. (Maximum length: 150 characters)wer432r
pricedoubleYesPrice in € with a precision of 2 decimal places (not mandatory) for the item.344.95
external_categorystringYesIdentifier of the category to upload the item to. It must be text with the category, not a numeric identifier. It can be directly the category that exists in your system.Camisetas manga corta
statusstringYesCondition of the item. The values are limited to an enumeration that is also provided further on.good
titlestringYesTitle of the item. Maximum 60 characters.Camiseta verde
descriptionstringYesDescription of the item. Maximum 600 characters.Camiseta verde talla M…
imageslist stringYesComposite field created by concatenating, using "|" (pipe), the different URLs of the item's images. These must be publicly accessible and in jpg format. Maximum 10 images.https://image-cdn.com/image1.jpg|https://image-cdn.com/image2.jpg|https://image-cdn.com/image3.jpg
storelist stringNoIdentifier of the account on the portal where this item is to be published. It is only necessary if you have more than one account on which to publish items. If you have more than one account or more than one portal associated with the product, it must be a list of integers separated by "|" (pipe).2|F5
portal_statusstringNoPublication status of the item. Possible statuses: "active", "reserved"active
shippingboolNoBoolean to indicate whether shipping within the portal is accepted for the item.true
shipping_weight_kgintNoField associated with the "shipping" field, required if the shipping field is true. Indicates the weight in kg (rounded up without decimals) of the item.3
free_shippingboolNoBoolean to indicate whether it is the seller who bears the shipping costs and therefore they are free for the buyer.true
hashtagsstringNoComposite field created by concatenating, using "|" (pipe), the different hashtags. Each of them is a single word without spaces and without the preceding hash (#).bluetooth|bajoconsumo|geek
brandStringNoBrand of the itemApple
modelStringNoModel of the itemiPhone 15 pro
stockintNoNumber of items3
attributesstrNoField for additional attributes of the item. Depending on the category, some of these attributes may be mandatory. *additional attributes

* For car items, the following attributes must be provided in the 'attributes' field as a serialised JSON string:

Regarding the status field that refers to the condition of the items, the options are as follows:

["new", "as_good_as_new", "good", "fair", "has_given_it_all"]

Car attributes

Car attributes are a set of characteristics that describe a car. They are used in the feed and to publish it on the marketplaces.

NameTypeRequiredDescriptionExample
versionStringYesEngine version or trim level of the car.1.6 TDI
yearIntYesYear of manufacture.2018
kmIntYesMileage in kilometres.60000
horse_powerIntYesEngine power in CV (DIN).105
doorsIntNoNumber of doors.5
body_typeStringNoBody type or style. Possible values:'small_car', 'coupe_cabrio', 'sedan', 'family_car', 'mini_van', 'four_x_four', 'van', 'others'sedan
engineStringyesFuel type. Possible values:'gasoil', 'gasolina', 'electric_hybrid', 'others'gasoil
gear_boxStringYesGearbox type. Possible values are:'manual', 'automatic'manual

Example (python):

car_attrs = {
    "version": "1.6 TDI Toyota",
    "year": "2018",
    "horse_power": 100,
    "mileage": 12000,
    "engine": "gasoil",
    "gearbox": "manual"
}

attributes = json.dumps(car_attrs)

Motorbike attributes

To integrate motorbikes, the item must include the vehicle-specific information. The technical data is sent serialised as JSON in the 'attributes' field, while the brand and model travel in the 'brand' and 'model' fields of the CSV.

The 'external_category' field must take one of the values '2', 'Motos', 'Motorbikes' for the item to be processed as a motorbike. This integration requires having the motorbike ERP service active on your account.

The values of 'brand' and 'model' must match exactly those of our motorbike taxonomy. To check the valid values we provide two public endpoints (they require authentication and the motorbike ERP service active):

  • GET /motorbike_brands — returns the complete list of available brands, with their 'uid' and 'value'.
  • GET /motorbike_models?brand_id={uid} — returns the models associated with the brand indicated via 'brand_id'.

Note that the item's title is generated automatically from the brand, the model, the version (if provided) and the year, so the value of the 'title' field will be overwritten for motorbikes.

NameTypeRequiredDescriptionExample
yearIntYesYear of registration. Value between 1950 and the year after the current one.2020
versionStringNoCommercial name or version of the model. It is added to the automatically generated title.modelo actual
kmIntYesMileage in kilometres. It cannot be negative.5420
horse_powerIntNoEngine power in CV. It must be a positive value.47
engine_capacity_ccIntNoEngine displacement in cubic centimetres. It must be a positive value.400
fuel_typeStringNoFuel type. Possible values: 'gasoline', 'electric'. If not provided, it defaults to 'gasoline'.gasoline
license_plateStringNoVehicle registration plate.1234 ABC

Example (python):

motorbike_attrs = {
    "year": 2020,
    "version": "modelo actual",
    "km": 5420,
    "horse_power": 47,
    "engine_capacity_cc": 400,
    "fuel_type": "gasoline",
    "license_plate": "1234 ABC"
}

attributes = json.dumps(motorbike_attrs)