POST v1/ads

Cria um novo anúncio

Requires Authorization

To perform authorization, you must submit the authentication credentials using the HTTP Basic authorization header.
The authorization header is constructed as follows:

  1. The username and password are combined into a string "user:password"
  2. The resulting literal string is then encoded in Base64
  3. The authorization method followed by the word "Basic" is then placed before the coded sequence.
For example, if the user is 'Aladdin' and the password is 'open-sesame' then the header should be:
Authorization: Basic QWxhZGRpbjpvcGVuLXNlc2FtZQ==

Response Codes

  • Created (201)
  • BadRequest (400)
  • Unauthorized (401)
  • Forbidden (403)
  • NotFound (404)

Request Information

URL Parameters

The parameters must be in the request URL.

Nothing.

Request body parameters

These parameters must be in the request Body.

AdNewRequest Representation model of an request to create a new Ad.

NameDescriptionTypeAdditional Information
ReferenceCodeReference code provided by the advertiserstringRequired
OfferTypeOffer type (Venda/Locação/Serviço)stringRequired
ContractIdAdvertiser current Contract IDintegerRequired
CategoryMachine/Equipment CategorystringRequired
MakeMachine/Equipment Manufacturerstring
ModelMachine/Equipment Modelstring
SerialNumberMachine/Equipment Serial Numberstring
YearYear of manufacture of the machine/equipment (ex. 1998)integer
PricePrice of Ad in Reais (ex. R$ 100.000,00 -> 100000). Only numbers.integer
StateState or Province of location (ex. SP)stringRequired
CityCity of location (ex. Jundiaí)stringRequired
DescriptionAd description (Ex.: pintura nova, pneus bons, cabinada, motor novo). It is forbidden to enter addresses of other sites, telephones and email.string
IsPrivateIndicates wheter the Ad is private (published only in EmEstoque)booleanRequired
SyncToMarketplacesIndicates whether the Ad should be Synchronized with the Marketplaces available through EmEstoqueboolean
PhotosList with photos links. Maximum of 4 photos.string array

Request Formats

application/json, text/json

Notes:

  • In Json format, the parameter names follow the camelCase pattern, that is, they always start with lowercase letters.
{
  "referenceCode": "XXXX0123456",
  "offerType": "Venda",
  "contractId": 1,
  "category": "Escavadeira",
  "make": "Case",
  "model": "CX220",
  "serialNumber": "ABC123456",
  "year": 2012,
  "price": 100000,
  "state": "SP",
  "city": "Jundiaí",
  "description": "NONONON NONONON NONONON",
  "isPrivate": false,
  "syncToMarketplaces": false,
  "photos": [
    "http://www.yourdomain.com/photo1.jpg",
    "http://www.yourdomain.com/photo2.jpg",
    "http://www.yourdomain.com/photo3.jpg",
    "http://www.yourdomain.com/photo4.jpg"
  ]
}

text/html

{"referenceCode":"XXXX0123456","offerType":"Venda","contractId":1,"category":"Escavadeira","make":"Case","model":"CX220","serialNumber":"ABC123456","year":2012,"price":100000,"state":"SP","city":"Jundiaí","description":"NONONON NONONON NONONON","isPrivate":false,"syncToMarketplaces":false,"photos":["http://www.yourdomain.com/photo1.jpg","http://www.yourdomain.com/photo2.jpg","http://www.yourdomain.com/photo3.jpg","http://www.yourdomain.com/photo4.jpg"]}

application/xml, text/xml

<AdNewRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ReferenceCode>XXXX0123456</ReferenceCode>
  <OfferType>Venda</OfferType>
  <ContractId>1</ContractId>
  <Category>Escavadeira</Category>
  <Make>Case</Make>
  <Model>CX220</Model>
  <SerialNumber>ABC123456</SerialNumber>
  <Year>2012</Year>
  <Price>100000</Price>
  <State>SP</State>
  <City>Jundiaí</City>
  <Description>NONONON NONONON NONONON</Description>
  <IsPrivate>false</IsPrivate>
  <SyncToMarketplaces>false</SyncToMarketplaces>
  <Photos>
    <Url>http://www.yourdomain.com/photo1.jpg</Url>
    <Url>http://www.yourdomain.com/photo2.jpg</Url>
    <Url>http://www.yourdomain.com/photo3.jpg</Url>
    <Url>http://www.yourdomain.com/photo4.jpg</Url>
  </Photos>
</AdNewRequest>

application/x-www-form-urlencoded

Example not available.

Response Information

Resource Description

AdResponse Returns the representation of the new Ad.

NameDescriptionTypeAdditional Information
AdIdID code generated by the systeminteger
ReferenceCodeReference code provided by the advertiserstringRequired
TypeOffer type (Venda/Locação/Serviço)stringRequired
ContractIdAdvertiser current Contract IDintegerRequired
CategoryMachine/Equipment CategorystringRequired
MakeMachine/Equipment ManufacturerstringRequired
ModelMachine/Equipment ModelstringRequired
SerialNumberMachine/Equipment Serial Numberstring
YearYear of manufacture of the machine/equipment (ex. 1998)integer
PricePrice of Ad in Reais (ex. R$ 100.000,00 -> 100000). Only numbers.integer
StateState or Province of location (ex. SP)stringRequired
CityCity of location (ex. Jundiaí)stringRequired
DescriptionAd description (Ex.: pintura nova, pneus bons, cabinada, motor novo). It is forbidden to enter addresses of other sites, telephones and email.string
IsPrivateIndicates wheter the Ad is private (published only in EmEstoque)booleanRequired
SyncToMarketplacesIndicar se o anúncio deve ser Sincronizado com os Marketplaces disponíveis através do EmEstoqueboolean
PhotosList with photos links. Maximum of 4 photos.string arrayMax. Length: 4
SpecificationsList of the Ad SpecificationsNameValueItem array
LinksAd links listLink array

Response Formats

application/json, text/json

Notes:

  • In Json format, the parameter names follow the camelCase pattern, that is, they always start with lowercase letters.
{
  "adId": 1,
  "referenceCode": "XXXX0123456",
  "type": "Venda",
  "contractId": 1,
  "category": "Escavadeira",
  "make": "Case",
  "model": "CX220",
  "serialNumber": "ABC123456",
  "year": 2012,
  "price": 100000,
  "state": "SP",
  "city": "Jundiaí",
  "description": "NONONON NONONON NONONON",
  "isPrivate": false,
  "syncToMarketplaces": false,
  "photos": [
    "http://www.yourdomain.com/photo1.jpg",
    "http://www.yourdomain.com/photo2.jpg",
    "http://www.yourdomain.com/photo3.jpg",
    "http://www.yourdomain.com/photo4.jpg"
  ],
  "specifications": [
    {
      "name": "numero-de-serie",
      "value": "ABC1234"
    },
    {
      "name": "ano-fabricacao",
      "value": "2012"
    }
  ],
  "links": [
    {
      "href": "https://www.mercadomaquinas.com.br/anuncio/1-test-ad-permalink-slug",
      "rel": "ad",
      "type": "GET"
    },
    {
      "href": "https://api.mercadomaquinas.com.br/v1/ads/1",
      "rel": "ad api",
      "type": "GET"
    }
  ]
}

text/html

{"adId":1,"referenceCode":"XXXX0123456","type":"Venda","contractId":1,"category":"Escavadeira","make":"Case","model":"CX220","serialNumber":"ABC123456","year":2012,"price":100000,"state":"SP","city":"Jundiaí","description":"NONONON NONONON NONONON","isPrivate":false,"syncToMarketplaces":false,"photos":["http://www.yourdomain.com/photo1.jpg","http://www.yourdomain.com/photo2.jpg","http://www.yourdomain.com/photo3.jpg","http://www.yourdomain.com/photo4.jpg"],"specifications":[{"name":"numero-de-serie","value":"ABC1234"},{"name":"ano-fabricacao","value":"2012"}],"links":[{"href":"https://www.mercadomaquinas.com.br/anuncio/1-test-ad-permalink-slug","rel":"ad","type":"GET"},{"href":"https://api.mercadomaquinas.com.br/v1/ads/1","rel":"ad api","type":"GET"}]}