API used when creating a platform-type ERP channel in the Marketplaces Hub
To start developing the integration of the ERP platform with the Marketplaces Hub using the new passive APIs of the Marketplaces Hub, it is necessary to understand that the processing flow requires the ERP channel to have a pair of access credentials to use the APIs authenticated.
This pair of authentication keys can be generated by creating a new platform-type Marketplaces Hub integration with the ERP channel.
The production and approval environments are divided and can be accessed via the URLs below:
POST, PUT and DELETE requests have some useful headers in their response, containing the ID of the generated request (Request-Id) and the request limits for each endpoint (X-RateLimit -Limit and X-RateLimit-Remaining). If you encounter problems with a request, simply inform the support team of the request ID, as this will make it easier to obtain the logs and reduce the time it takes to fix the problem.
Cache-Control: no-cache, private
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Request-Id: 1R17E20190510133646C1557506206412V9676
The Marketplaces Hub APIs have two levels of authentication: Application authentication and Integration channel authentication (ERP platform type channel).
All integrated applications have an identification token called AppToken which must be sent in the header of all requests, as without it, it is not possible to identify the connected application and its connection will be denied immediately.
In production, each application has a unique AppToken, however in approval, all applications must use the homologation AppToken, as shown in the example below:
App-Token: homologacao
Content-Type: application/json
cache-control: no-cache
The second level of authentication is that of integration, that is, of the seller's account to be requested.
Integration authentication is done using a temporary access token, generated in the authentication and which must be sent in the header of all requests in the Authorization index (except the authentication request, where only the AppToken must be sent).
App-Token: homologacao
Content-Type: application/json
cache-control: no-cache
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLm9tbmkud2Fwc3RvcmUuY29tLmJyXC8iLCJhdWQiOiJBcGkgZGUgVGVzdGUiLCJpYXQiOjE1NTc0MjgzMjcsIm5iZiI6MTU1NzQyODMyNywiZXhwIjoxNTU3NDMwMTI3LCJ0aWQiOiIwOWI4ZGI5YWYxNjhkMDRhMmE2OTBhNTQ1NmEyZWRmMSJ9.Gfvm1Z54pUXZhlNhafV1fEoOBiMGS_sku4o2a8CKWmY
In production, we have several protection services connected (firewall, anti-DDoS protection, always updated TLS, among others) and all of these services work to guarantee the integrity of the system (mainly because the data that passes through the platform is sensitive - data card numbers, addresses, etc.).
So that your system is not blocked by our security services and can create stable communication with our production APIs, it is extremely important that all requests are sent valid user-agents, all connections are made using the HTTPS protocol and that your system supports the most up-to-date TLS/SSL certificates (use an online service such as SSL Labs to check which TLS/SSL certificate is supported by production servers).
In addition, the use of a fixed IP in requests production is also very important, as our infrastructure and security team can create specific rules for this IP, which greatly increases security and reduces the risk of blocking.
In the approval environment, the risk of blocking by security services is low, so always develop your application focusing on the maximum levels of security that will be required in production.
Resource responsible for generating the integration authentication token.
For this resource, the only token that must be sent in the header is the AppToken, as at this moment you have not yet will have the integration token.
The data sent in the body (ApiKey and SecretKey) is related to the Seller's integration account (approval or production account).
After the token is generated, it will be valid for 30 minutes and must be sent in the Authorization header of other APIs.
Important: Whenever a new token is generated, the previous one will be revoked and you will lose access immediately.
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 201 Created |
{
"apiKey": "1234A5678B9012C3456",
"secretKey":"3456D9012E5678F1234"
}
Field | Type | Mandatory | Description |
---|---|---|---|
apiKey | String | Yes | Seller integration API public key |
secretKey | String | Yes | Seller Integration API Private Key |
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLm9tbmkud2Fwc3RvcmUuY29tLmJyXC8iLCJhdWQiOiJBcGkgZGUgVGVzdGUiLCJpYXQiOjE1NTc0NTc2OTYsIm5iZiI6MTU1NzQ1NzY5NiwiZXhwIjoxNTU3NDU5NDk2LCJ0aWQiOiI5MzRjZTY2ZGY5MDQ1YWNmMzY1MGIyZWEzNWUxYjMwMSJ9.Ii148QGob19NI2-fsMbqvMpmVFyGR3bkJjSbOxaCxmg"
}
Field | Type | Description |
---|---|---|
token | String | Access token generated for the APIs |
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 200 Ok |
Offset/Limit | Mandatory the sending of the offset and limit parameters in the request URL. Example of requisition: /v1/logistic/orders/{id}/shipment_labels?offset=0&limit=100 Maximum value for the limit parameter: 100 |
{
"etiquetas": [
{
"conteudo": "YXJxdWl2byB0ZXN0ZQ==",
"tipo": "pdf",
"canal": "string",
"idPedidoCanal": "123"
},
{
"conteudo": "YXJxdWl2byB0ZXN0ZQ==",
"tipo": "zpl",
"canal": "string",
"idPedidoCanal": "123"
},
{
"conteudo": "YXJxdWl2byB0ZXN0ZQ==",
"tipo": "png|jpg",
"canal": "string",
"idPedidoCanal": "123"
}
],
"info": {
"filtros": [],
"prev": "",
"self": "http://localhost/v1/logistic/orders/13127721/shipment_labels?offset=0&limit=100",
"next": "",
"offset": 0,
"limit": 100,
"exibindo": 0,
"total": 0
}
}
Field | Type | Description |
---|---|---|
etiquetas | Data Collection | Order label list |
conteudo | String | Tag content converted to base64 |
tipo | String | File type before converting to base64 |
canal | String | Marketplace channel where the order was generated |
idPedidoCanal | Number | Order ID in the marketplace channel where it was generated |
info | Object | Information about the listing (paging, filters, total items, etc.) |
filtros | Object (key/value) | Filters applied to the URL |
prev | String | Previous page |
self | String | Current page |
next | String | Next page |
offset | Number | Requested offset |
limit | Number | Limit requested |
exibindo | Number | Number of records being displayed on the current page |
total | Number | Total records on all pages |
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 200 Ok |
Limit requests per minute | 10 |
{
"canais":[
{
"id":123,
"hash":"abc123",
"nome":"Canal A",
"ativo":true
},
{
"id":456,
"hash":"def456",
"nome":"Canal B",
"ativo":false
}
],
"info":{
"total":2
}
}
Field | Type | Description |
---|---|---|
canais | Data Collection | Connected channels |
id | Number | Channel ID in HUB |
hash | String | Channel hash in HUB |
nome | String | Name given to the channel by the seller |
ativo | Boolean | Defines whether the channel is active on the HUB |
info | Object | Information about returning the consultation |
total | Number | Total channels returned |
Resource available to check the safety stock of productsThis resource can be used to check the amount of safety stock available for products in your store.Important: If the product does not have safety stock, it will not be returned
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 200 Ok |
Filters | idCanalIntegracao: Filter the search for products using the integration channel ID Exemplo de requisição: /v1/erp/products/security-stock?idCanalIntegracao=16|22|708 sku: Filter the search for products using the sku Exemplo de requisição: /v1/erp/products/security-stock?sku=produto-teste|novo-produto |
Limit requests per minute | 40 |
Offset/Limit | Mandatory the sending of the offset and limit parameters in the request URL. Example of requisition: /v1/erp/products/security-stock?offset=0&limit=100 Maximum value for the limit parameter: 100 |
{
"produtosEstoqueSeguranca": {
"Wapstore Marketplace": [
{
"idProduto": 4,
"skuProduto": "produto-2-tete-36",
"idCanalIntegracao": 459,
"qtdEstoqueSeguranca": 12
}
],
"Shopee": [
{
"idProduto": 9,
"skuProduto": "produto-teste-1",
"idCanalIntegracao": 708,
"qtdEstoqueSeguranca": 10
}
]
},
"info": {
"filtros": [],
"prev": "",
"self": "https://omni.wapstore.com.br/v1/erp/products/security-stock?offset=0&limit=5",
"next": "https://omni.wapstore.com.br/v1/erp/products/security-stock?offset=5&limit=5",
"offset": 0,
"limit": 2,
"exibindo": 2,
"total": 55
}
}
Field | Type | Description |
---|---|---|
produtosEstoqueSeguranca | Object | List of products returned from the query |
nomeCanalIntegracao | Data Collection | Channel name returned from the query |
idProduto | Number | platform product ID |
skuProduto | String | Product SKU |
idCanalIntegracao | Number | Channel integration ID in HUB |
qtdEstoqueSeguranca | Number | Safety stock quantity |
info | Object | Information about the query response |
filtros | Array | Array of filters used in the query |
prev | String | Previous page |
self | String | Current page |
next | String | Next page |
offset | Number | Requested offset |
limit | Number | Limit requested |
exibindo | Number | Number of records being displayed on the current page |
total | Number | Total records on all pages |
Resource responsible for changing the safety stock of a product
This resource can be used to update an existing safety stock or create a new one.
Important: The product must be registered on the HUB
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 200 Ok |
{
"idCanalIntegracao": 205,
"sku": "TESTE-ITEM02",
"estoqueSeguranca": 8
}
Field | Type | Mandatory | Description |
---|---|---|---|
idCanalIntegracao | Number | Yes | Channel integration ID in HUB Minimum value: 1 |
sku | String | Yes | Product SKU Minimum size: 1 | Maximum size: 255 |
estoqueSeguranca | Number | Yes | Safety stock quantity Minimum value: 0 |
{
"ProdutoEstoqueSeguranca": [
{
"idProduto": 3,
"idAtributoSimples": 2,
"idCanalIntegracao": 207,
"idIntegracao": 3,
"estoqueSeguranca": 10,
"dataCadastro": "2024-02-15 20:28:35",
"dataAtualizacao": "2024-02-15 21:39:29"
},
{
"idProduto": 3,
"idAtributoSimples": 3,
"idCanalIntegracao": 207,
"idIntegracao": 3,
"estoqueSeguranca": 10,
"dataCadastro": "2024-02-15 20:28:35",
"dataAtualizacao": "2024-02-15 21:39:29"
},
{
"idProduto": 3,
"idAtributoSimples": 4,
"idCanalIntegracao": 207,
"idIntegracao": 3,
"estoqueSeguranca": 10,
"dataCadastro": "2024-02-15 20:28:35",
"dataAtualizacao": "2024-02-15 21:39:29"
}
]
}
Field | Type | Description |
---|---|---|
ProdutoEstoqueSeguranca | Data Collection | List of products with changed/created safety stock |
idProduto | Number | Product ID |
idAtributoSimples | Number | Simple Attribute ID |
idCanalIntegracao | Number | Channel integration ID in HUB |
idIntegracao | Number | integration ID |
estoqueSeguranca | Number | Safety stock quantity |
dataCadastro | String | Registration date |
dataAtualizacao | String | Update date |
Resource available to consult products with personalized prices in the HUB.This feature can be used to consult products with personalized prices in your store, returning "from" price and "per" priceImportant: If the product does not have a personalized price, it will not be returned
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 200 Ok |
Filters | idCanalIntegracao: Filter the search for products using the integration channel ID Exemplo de requisição: /v1/erp/products/customized-prices?idCanalIntegracao=16|22|708 sku: Filter the search for products through the sku | Product level Exemplo de requisição: /v1/erp/products/customized-prices?sku=produto-teste|novo-produto |
Limit requests per minute | 40 |
Offset/Limit | Mandatory the sending of the offset and limit parameters in the request URL. Example of requisition: /v1/erp/products/customized-prices?offset=0&limit=100 Maximum value for the limit parameter: 100 |
{
"produtosPrecoPersonalizado": {
"Dafiti": [
{
"idProduto": 77,
"skuProduto": "Teste",
"idCanalIntegracao": 177,
"precoDePersonalizado": "100,00",
"precoPorPersonalizado": "80,00"
}
],
"Mercado Livre": [
{
"idProduto": 58,
"skuProduto": "produto-teste",
"idCanalIntegracao": 177,
"precoDePersonalizado": "20,00",
"precoPorPersonalizado": "10,00"
}
]
},
"info": {
"filtros": [],
"prev": "",
"self": "https://omni.wapstore.com.br/v1/erp/products/customized-prices?offset=0&limit=2",
"next": "https://omni.wapstore.com.br/v1/erp/products/customized-prices?offset=2&limit=2",
"offset": "0",
"limit": "2",
"exibindo": 2,
"total": "14"
}
}
Field | Type | Description |
---|---|---|
produtosPrecoPersonalizado | Object | Object with the return of channels and their respective products with personalized prices |
nomeCanalIntegracao | Data Collection | Dynamic property that returns the channel name |
idProduto | Number | Product ID in HUB |
skuProduto | String | Product SKU in HUB |
idCanalIntegracao | Number | Channel integration ID in HUB |
precoDePersonalizado | Number | Custom “from” price of the product |
precoPorPersonalizado | Number | Custom "per" price of the product |
info | Object | Pagination information and filters |
filtros | Array | Array of filters used in the query |
prev | String | Previous page |
self | String | Current page |
next | String | Next page |
offset | Number | Requested offset |
limit | Number | Limit requested |
exibindo | Number | Number of records being displayed on the current page |
total | Number | Total records on all pages |
Resource available to change/create personalized prices for products registered in the HUB.
With this functionality it is possible for the same product to have different prices per integration channel. This can be applied at both levels: (Product/Variation).
Important: The product must be registered in the HUB.
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 200 Ok |
Limit requests per minute | 60 |
{
"precos": [
{
"idCanalIntegracao": 1,
"skuProduto": "ABC123",
"precoDe": 25.50,
"precoPor": 20.00
},
{
"idCanalIntegracao": 2,
"skuProduto": "XYZ789",
"precoDe": 35.75,
"precoPor": 30.50
},
{
"idCanalIntegracao": 1,
"skuProduto": "DEF456",
"precoDe": 18.99,
"precoPor": 15.49
}
]
}
Field | Type | Mandatory | Description |
---|---|---|---|
precos | Data Collection | Yes | Customized price list by Integration Channel Minimum size: 1 | Maximum size: 100 |
idCanalIntegracao | Number | Yes | Channel integration ID in HUB Minimum value: 1 |
skuProduto | String | Yes | Product SKU Minimum size: 1 | Maximum size: 250 |
precoDe | Number | Yes | Product 'from' price Minimum value: 0.01 | Maximum value: 999999.99 |
precoPor | Number | Yes | Product 'per' price Minimum value: 0.01 | Maximum value: 999999.99 |
{
"resultados": [
{
"skuProduto": "ABC123",
"sucessos": [
{
"idCanalIntegracao": 1,
"precoDe": 25.50,
"precoPor": 20.00
},
{
"idCanalIntegracao": 2,
"precoDe": 35.75,
"precoPor": 30.50
}
],
"erros": []
},
{
"skuProduto": "XYZ789",
"sucessos": [],
"erros": [
{
"idCanalIntegracao": 1,
"mensagem": "Produto não encontrado"
}
]
},
{
"skuProduto": "DEF456",
"sucessos": [
{
"idCanalIntegracao": 1,
"precoDe": 18.99,
"precoPor": 15.49
}
],
"erros": []
}
]
}
Field | Type | Description |
---|---|---|
resultados | Data Collection | Custom price processing results |
skuProduto | String | Product SKU |
sucessos | Data Collection | Custom prices successfully created/changed |
idCanalIntegracao | Number | Channel integration ID in HUB |
precoDe | Number | Price 'from' of the product |
precoPor | Number | Price 'per' of the product |
erros | Data Collection | Errors that occurred when creating/changing custom prices |
idCanalIntegracao | Number | Channel ID integration in HUB |
mensagem | String | Error information |
Resource responsible for deleting a custom price.
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 204 No Content |
/v1/erp/products/customized-prices/{idCanalIntegracao}/{skuProduto} | Channel ID integration in HUB |
/v1/erp/products/customized-prices/{idCanalIntegracao}/{skuProduto} | Product SKU |
Resource available to change/create personalized prices for ads in the Hub that are published on MercadoLivre.
Important: The ad must be published on MercadoLivre.
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 200 Ok |
Limit requests per minute | 60 |
{
"precos": [
{
"idCanalIntegracao": 1,
"prefixoCanalIntegracao": "MLB",
"skuProduto": "ABC123",
"precoDe": 25.50,
"precoPor": 20.00
},
{
"idCanalIntegracao": 1,
"prefixoCanalIntegracao": "MLP",
"skuProduto": "ABC123",
"precoDe": 35.75,
"precoPor": 30.50
},
{
"idCanalIntegracao": 1,
"prefixoCanalIntegracao": "MLF",
"skuProduto": "DEF456",
"precoDe": 18.99,
"precoPor": 15.49
}
]
}
Field | Type | Mandatory | Description |
---|---|---|---|
precos | Data Collection | Yes | Customized price list for MercadoLibre ads Minimum size: 1 | Maximum size: 100 |
idCanalIntegracao | Number | Yes | Channel integration ID in HUB Minimum value: 1 |
prefixoCanalIntegracao | String | Yes | Prefix configured to differentiate ad types Minimum size: 1 | Maximum size: 10 |
skuProduto | String | Yes | Product SKU Minimum size: 1 | Maximum size: 250 |
precoDe | Number | Yes | Price 'from' of the product Minimum value: 0.01 | Maximum value: 999999.99 |
precoPor | Number | Yes | Price 'per' of the product Minimum value: 0.01 | Maximum value: 999999.99 |
{
"resultados": [
{
"skuProduto": "ABC123",
"sucessos": [
{
"idCanalIntegracao": 1,
"prefixoCanalIntegracao": "MLB",
"codigoMlb": "MLB1999999999",
"precoDe": 25.50,
"precoPor": 20.00
},
{
"idCanalIntegracao": 1,
"prefixoCanalIntegracao": "MLP",
"codigoMlb": "MLB2999999999",
"precoDe": 35.75,
"precoPor": 30.50
}
],
"erros": []
},
{
"skuProduto": "DEF456",
"sucessos": [],
"erros": [
{
"idCanalIntegracao": 1,
"prefixoCanalIntegracao": "MLF",
"mensagem": "Não foi possível localizar anúncios Grátis para este SKU."
}
]
}
]
}
Field | Type | Description |
---|---|---|
resultados | Data Collection | Custom price processing results |
skuProduto | String | Product SKU |
sucessos | Data Collection | Custom prices successfully created/changed |
idCanalIntegracao | Number | Channel integration ID in HUB |
prefixoCanalIntegracao | String | Prefix for which the price customization application was successful |
codigoMlb | String | MLB code of the ad to which the personalization was applied |
precoDe | Number | Price 'from' of the product |
precoPor | Number | Price 'per' of the product |
erros | Data Collection | Errors that occurred when creating/changing custom prices |
idCanalIntegracao | Number | Channel ID integration in HUB |
prefixoCanalIntegracao | String | Prefix for which there was an error when applying price customization |
mensagem | String | Error information |
Resource responsible for deleting a custom price.
Endpoint information | |
---|---|
Environment | Sandbox / Production |
Success Status | 204 No Content |
/v1/erp/mercadolivre/items/customized-prices/{idCanalIntegracao}/{prefixoCanalIntegracao}/{skuProduto} | Channel ID integration in HUB |
/v1/erp/mercadolivre/items/customized-prices/{idCanalIntegracao}/{prefixoCanalIntegracao}/{skuProduto} | Prefix configured to differentiate ad types |
/v1/erp/mercadolivre/items/customized-prices/{idCanalIntegracao}/{prefixoCanalIntegracao}/{skuProduto} | Product SKU |
All requests that result in errors will have the same return pattern. The HTTP status code returned will indicate whether the problem is with the request (client-site - 4xx) or processing (server-site - 5xx) and the message will describe additional details about the problem.
{
"error": "Requisição rejeitada.",
"details": [
"O SKU 'TESTEAPISIMPLES' já está cadastrado"
]
}
Field | Type | Description |
---|---|---|
error | String | Information about the error presented |
details | Array de strings | Details about the error presented (returned in some error cases) |