api.tipmoto.com » API documentation » Examples » Inserting/editing moto

Example of inserting/editing moto

Some values can be written in several ways - e.g. <manufacturer id="8" /> is equivalent to <manufacturer>Honda</manufacturer> (for XML).
Likewise, "manufacturer@id":8 is for JSON the same as "manufacturer":"Honda".

You can choose whichever suits you better, but so that you do not have to update lists etc., we recommend writing values (not IDs), and the examples show only these.

XML

Address:
https://api.tipmoto.com/c/{dealer ID}/moto.xml
Send the following request (ideally PUT, where the BODY contains the following XML):
<?xml version="1.0"?>
<tipmoto>
  <moto>
    <!-- Your ID. We recommend identifying records by <idApi>, not <id>
      This way you do not have to deal with matching our IDs to yours
    -->
    <idApi>AB-198</idApi>

    <!-- ID of the dealer's branch.
      Does not need to be sent if the dealer has only one branch (which is the case in most cases)
      If you send it, only sending via the attribute 'id' is supported here
    -->
    <pobocka id="0" />

    <!-- Is the ad active
      '0' = not displayed
      '1' = yes, displayed
      '2' = not displayed on TipMoto.com, active in the dealer's data listing (only if the dealer has enabled this option)
      'firstInactive' = this value can be given only on import = the first import sets the ad as inactive, afterwards the value is not changed -->
    <aktivni>1</aktivni>

    <!-- Motorcycle manufacturer (from the list)
      Required field when inserting (not when editing) -->
    <manufacturer>BMW</manufacturer>
 
    <!-- Ad title (motorcycle/quad model without the manufacturer)
      Required field when inserting (not when editing) -->
    <nazev>S 1000 R, Hockenheim Silver Metallic</nazev>

    <!-- Motorcycle model (from the list) -->
    <model>S 1000 R</model>
    
    <!-- Motorcycle category (from the list)
      Recommended -->
    <zarazenimoto>silniční sportovní</zarazenimoto>

    <!-- Vehicle condition
      Possible values:
        'ojetá' = used
        'nová' = new
        'předváděcí' = demonstrator
        'bouraná' = damaged
        'veterán' = vintage -->
    <stav>nová</stav>

    <!--  Motorcycle/quad engine capacity
      Required field when inserting (not when editing) -->
    <objem>1000</objem>
    
    <!-- Power in kW (decimal 4,1) -->
    <vykon>118.0</vykon>

    <!-- Year of manufacture -->
    <vyrobeno>2021</vyrobeno>
    
    <!-- Year of first registration -->
    <doProvozu>2021</doProvozu>
    
    <!-- Price (integer)
      The final full price including VAT is given.
      0 = price negotiable, not allowed for new motorcycles -->
    <cena>389000</cena>

    <!-- Price currency
      'Kč'
      '€' -->
    <cenaMena>Kč</cenaMena>

    <!-- Old price (integer)
      Original price (before discount) - shown struck through
      0 (or '') = the price is not shown -->
    <cenaOld>0</cenaOld>

    <!-- VAT deductible
      '0' = no
      '1' = yes
      '2' = not set -->
    <dph>1</dph>

    <!-- Instalments/leasing possible
      '0' = no
      '1' = yes
      '2' = not set -->
    <splatky>1</splatky>

    <!--  Mileage (integer) -->
    <najeto>5243</najeto>
    
    <!-- Unit for the mileage element (najeto)
      'km'
      'mil'
      'mth' -->
    <najetoMira>km</najetoMira>
    
    <!-- Motorcycle/quad availability
      from the agenda /lists/dostupnostmoto.xml -->
    <dostupnostmoto>0</dostupnostmoto>
    
    <!-- Motorcycle/quad country of origin
      from the agenda /lists/puvodmoto.xml -->
    <puvodmoto>ČR</puvodmoto>

    <!-- The vehicle has a registration certificate (TP)
      '0' = no
      '1' = yes (if STK = 1, TP must be 1)
      '2' = not set -->
    <tp>1</tp>

    <!-- The vehicle has a valid roadworthiness test (STK)
      '0' = no
      '1' = yes
      '2' = not set -->
    <stk>1</stk>

    <!-- STK is valid until MM/YYYY -->
    <stkDo>04/2027</stkDo>
    
    <!-- The vehicle has a service book
      Has no effect on TipMoto, used for other advertising servers
      '0' = no
      '1' = yes
      '2' = not set -->
    <serviska>1</serviska>

    <!-- Vehicle VIN -->
    <vin>WB10E5106N6F19653</vin>

    <!-- Strokes
      '' = not set
      '2T'
      '4T' -->
    <takt>4T</takt>

    <!-- ABS
      Has no effect on TipMoto, used for other advertising servers
      '0' = no
      '1' = yes
      '2' = not set -->
    <abs>1</abs>

    <!-- Number of cylinders
      Has no effect on TipMoto, used for other advertising servers
      '' (empty - for most ads)
      'Elektromotor' = electric motor
      '1'
      '2'
      '3'
      '4'
      '5'
      '6' -->
    <valce>4</valce>

    <!-- Number of owners
      Has no effect on TipMoto, used for other advertising servers
      '' (empty - the value for most ads) or a non-negative integer (where 0 = also not set) -->
    <majitelu>1</majitelu>

    <!-- Labels
      Possible labels (inside the label tag):
      'Premium selection' (only for the BMW manufacturer)
      'Harley-Davidson Originals'
      'Importér' = importer -->
    <labels>
      <label>Premium selection</label>
    </labels>

    <!-- Internal note for the dealer (sent in e-mail, e.g. parking spot etc.) -->
    <poznamkaInterni>Stání 83</poznamkaInterni>

    <!-- Include in special offer listings on TipMoto
      '0' = no
      '1' = yes (default value, recommended) -->
    <akce>1</akce>

    <!-- URL - address on the dealer's website. A link is then shown on TipMoto -->
    <url>https://www.webprodejce.cz/nabizena-motorka.html</url>

    <!-- YouTube address of the video -->
    <youtube>https://youtu.be/xv123456</youtube>

    <!-- Ad description. May contain HTML formatting -->
    <popis><![CDATA[
      <p><strong>Zánovní motocykl model 2021  SKLADEM</strong></p>
      <p>Prodej od autorizovaného dealera, zkontrolováno v autorizovaném servise!</p>
      <p>Zdarma dovozeme po ČR</p>
    ]]></popis>

    <!-- Ad photos
     If the value of the attribute ignoreimport == true, the import ignores the structure.
     If the value of the attribute forceupdate == true, an update of all photos is forced
       (do not send the forced update by default, only when needed, e.g. to update the photos;
       every photo is downloaded again and gets a new ID)
     If the value of the attribute reorder == true, the gallery is sorted by the order of the photos in this structure.
       Without it, only 'main' and 'sortOrder' change the order (the order the dealer set
       in the administration is kept). See https://api.tipmoto.com/docs-en/ref/fotky/ -->
    <photos ignoreimport="false" forceupdate="false" reorder="false">

      <!-- Individual photos -->
      <photo>

        <!-- URL of the photo (JPG, PNG, GIF, BMP, TIFF, WebP) -->
        <url>https://www.webprodejce.cz/ph/AB-198_1.jpg</url>

        <!-- Main photo in the overview
          '1' or 'true' = yes (the photo moves to position 1)
          '0' or 'false' = no
          Not set = the main photo does not change (for an ad without photos, the first photo is the main one) -->
        <main>1</main>

        <!-- Position of the photo in the gallery (optional, 1 = main photo)
          Absolute position: the photo is placed at this position, the other photos fill the remaining positions -->
        <sortOrder>1</sortOrder>

        <!-- Photo stamp (reaction to a photo change)
          Any text value. If the value changes, the photo is updated (even with the same URL).
          We recommend giving e.g. datetime, filesize, file_hash -->
        <stamp>2021-11-30 14:13:43</stamp>
      </photo>


      <!-- More photos -->
      <photo>
        <url>https://www.webprodejce.cz/ph/AB-198_2.jpg</url>
        <main>0</main>
        <stamp>2021-11-30 14:13:43</stamp>
      </photo>
      <photo>
        <url>https://www.webprodejce.cz/ph/AB-198_3.jpg</url>
        <main>0</main>
        <stamp>2021-11-30 14:13:43</stamp>
      </photo>

    </photos>

    <!--Video uploaded to the ad
      Besides a YouTube video, the system allows uploading a video directly to TipMoto.com - it is downloaded from the given URL and processed -->
    <videos>
      <video>
        <!-- URL of the video file
          Link directly to the video, not to a web page -->
        <originalUrl>https://www.webprodejce.cz/v/AB-198.mp4</originalUrl>

        <!-- Video stamp (reaction to a change)
          Any text value. If the value changes, the video is updated (even with the same URL).
          We recommend giving e.g. datetime, filesize, file_hash -->
        <stamp>2021-11-30 14:14:28</stamp>
      </video>
    </videos>  
  </moto>
</tipmoto>
The example above
If some values are missing from your data, ideally leave out the whole element with that value.

JSON

Address:
https://api.tipmoto.com/c/{dealer ID}/moto.json
Send the following request (ideally PUT, where the BODY contains the following JSON):
For comments on the individual values, see the XML above
{
    "tipmoto": {
        "moto": {
            "idApi": "AB-198",
            "pobocka@id": "0",
            "aktivni": "1",
            "manufacturer": "BMW",
            "nazev": "S 1000 R, Hockenheim Silver Metallic",
            "model": "S 1000 R",
            "zarazenimoto": "silniční sportovní",
            "stav": "ojetá",
            "objem": "1000",
            "vykon": "118.0",
            "vyrobeno": "2021",
            "doProvozu": "2021",
            "cena": "389000",
            "cenaMena": "Kč",
            "cenaOld": "",
            "dph": "1",
            "splatky": "1",
            "najeto": "5243",
            "najetoMira": "km",
            "dostupnostmoto": "0",
            "puvodmoto": "ČR",
            "tp": "1",
            "stk": "1",
            "stkDo": "04/2027",
            "serviska": "1",
            "vin": "WB10E5106N6F19653",
            "takt": "4T",
            "abs": "1",
            "valce": "4",
            "majitelu": "1",
            "labels": {
                "label": [
                    "Premium selection"
                ]
            },
            "poznamkaInterni": "Stání 83",
            "akce": "1",
            "url": "https://www.sellersweb.com/offered-vehicle.html",
            "youtube": "https://youtu.be/xv123456",
            "popis": "<p><strong>Zánovní motocykl model 2021  SKLADEM</strong></p>\n<p>Prodej od autorizovaného dealera, zkontrolováno v autorizovaném servise!</p>\n<p>Zdarma dovozeme po ČR</p>",
            "photos@ignoreimport": "false",
            "photos@forceupdate": "false",
            "photos@reorder": "false",
            "photos": {
                "photo": [
                    {
                        "url": "https://www.sellersweb.com/ph/AB-198_1.jpg",
                        "main": "1",
                        "sortOrder": "1",
                        "stamp": "2021-11-30 14:13:43"
                    },
                    {
                        "url": "https://www.sellersweb.com/ph/AB-198_2.jpg",
                        "main": "0",
                        "stamp": "2021-11-30 14:13:43"
                    },
                    {
                        "url": "https://www.sellersweb.com/ph/AB-198_3.jpg",
                        "main": "0",
                        "stamp": "2021-11-30 14:13:43"
                    }
                ]
            },
            "videos": {
                "video": {
                    "originalUrl": "https://www.sellersweb.com/v/AB-198.mp4",
                    "stamp": "2021-11-30 14:14:28"
                }
            }
        }
    }
}
The example above
If some values are missing from your data, ideally leave out the line (block) with that value.
TipMoto.com Contact us