Introdução
BASE URL https://api.telepecas.com/
O serviço API TelePeças tem como objetivo fornecer aos clientes um acesso programáticos aos seus dados, facilitando a integração de sistemas.
Todos os recursos descritos neste documento seguem as normas REST e necessitam de uma autorização prévia via framework OAuth2.
Acessos não autorizados bem como invocações erradas/incompletas que não satisfaçam os requisitos deste serviço irão retornar códigos de erros, acompanhados de descrições.
As respostas obtidas por este serviço serão retornadas por predefinição no formato application/json. No entanto, o parâmetro Accept request-header poderá ser usado para especificar o formato do resultado retornado. Poderá parametrizar os seguintes tipos de documentos: application/json, application/xml.
Recomendamos que no decurso do desenvolvimento da solução informática utilize a versão sandbox. Na versão sandbox os dados enviados ou recebidos pelos endpoints não transitarão ou refletirão os dados reais das contas TelePeças. Para utilizar esta versão crie credenciais da versão sandbox na área reservada de vendedor.
Para utilizar esta API poderá fazê-lo através de dois métodos:
Registo de conta developer
Poderá gerir várias contas de vendedores e tornar a sua integração mais simples. Para registar uma conta de developer, clique aqui.
Serão gerados dados de autenticação associados à sua conta que deverá utilizar em todas as invocações, conjuntamente com o token público do vendedor alvo dessa ação.
Para associar novos clientes à sua conta partilhe o seu token público. Os clientes na área reservada poderão dar-lhe permissões de acesso.
Criar credenciais de acesso diretamente na área reservada de vendedor
Este método não necessita de conta developer. Não estará disponível a ativação de webhooks nem o módulo de logs.
Apenas necessita de se autenticar usando as credenciais geradas.
Autenticação
AUTH REQUESTCURL curl https://api.telepecas.com/auth/token \ -H "Accept: application/json" \ -u "C12AEh2g:7000bd21e6b39f8ef2f9e1df88a1b807" \ -d "grant_type=client_credentials"PHP CODE function getServerTokenSync(){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/auth/token'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_USERPWD, 'C12AEh2g' . ':' . '7000bd21e6b39f8ef2f9e1df88a1b807'); $headers = array(); $headers[] = 'Content-Type: application/x-www-form-urlencoded'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); if($result){ $tokenInfo = json_decode($result,true); $token = $tokenInfo['access_token']; } }
Todos os recursos desta API estão restritos por autenticação e subsequente autorização por token.
Ao solicitar um token deverá no seu pedido indicar o username/password e definir o parâmetro grant_type com o valor client_credentials.
Caso as credenciais sejam válidas receberá um token (access_token) com validade indicada no parametro expires_in.
Poderá invocar novamente este endpoint para gerar um novo token quando for ultrapassada a respetiva validade.
Endpoint: https://api.telepecas.com/auth/token
Argumentos de entrada
| Name | Type | Value |
|---|---|---|
| grant_type(*) | String | client_credentials |
(*) - Campos obrigatórios
Resposta
SUCCESS
{
"access_token":"3873aacbbbaaa05850de3fa607d98f4f5d2b00d6",
"expires_in":3600,
"token_type":"Bearer",
"scope":null
}
ERROR
{"error": {"code":"900.000.001", "description":"invalid_request", "message":"The grant type was not specified in the request"}}
Meus dados
Gestão dos dados da minha conta
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/account/profile \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getMyProfileDeveloper(){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/account/profile'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint é exclusivo para contas developer.
Endpoint: https://api.telepecas.com/account/profile
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"name":"Hugo","username":"hmrod","email":"hugorodrigues@telepecas.com","website":"https:\/\/en.telepecas.com","facebook":"facebook.com\/telepecas","twitter":"twitter.com\/telepeca","github":"github.com\/telepecas","instagram":"instagram.com\/telepecas","address":"","country":"Portugal","periodEnd":"2021-12-13 18:35:32","maxClients":"3","noActiveClients":"1","noKeysTotal":"1","noKeysActive":"1","production":{"noClients":"1","noStock":"2","noCalls":"21","noCallsMax":"10000","noInsertOps":"0","noInsertOpsMax":"1000","noSearchOps":"0","noSearchOpsMax":"1000","noUpdatesOps":"0","noUpdatesOpsMax":"2000","noStatsOps":"0","noStatsOpsMax":"100","noSearchMarketingOps":"0","noSearchMarketingOpsMax":"50","noInsertMarketingOps":"0","noInsertMarketingOpsMax":"10"},"sandbox":{"noClients":"1","noStock":"0","noCalls":"0","noInsertOps":"0","noSearchOps":"0","noUpdatesOps":"0","noStatsOps":"0","noSearchMarketingOps":"0","noInsertMarketingOps":"0"},"keys":[{"name":"Telepecas - Hugo Rodrigues","address":"Morada 1","location":"Braga","postalCode":"4710-312 - Braga","vatNumber":"12807754114","email":"teste@teste.com","phone":"+351910000000","publicKey":"d2432abc26e29db888aa73900c0bc939","sandbox":1,"state":"A","updateAccountConfigs":"1","readWarehouses":"1","updateWarehouses":"1","readShippingConfigs":"1","updateShippingConfigs":"1","readCatalogs":"1","updateCatalogs":"1","readStock":"1","changeStock":"1","readSales":"1","updateSales":"1","postSaleModule":"1","statsModule":"1","marketingModule":"1"}],"status":"success","timestamp":"2021-11-26T04:39:01Z"}
ERROR
{"error":{"code":"900.000.002","description":"You do not have permissions to access API functionality.","message":"Check the documentation at api.telepecas.com\/docs"}}
SUCCESS
success
2021-11-29T13:17:56Z
Hugo
hmrod
hugorodrigues@telepecas.com
https://en.telepecas.com
facebook.com/telepecas
twitter.com/telepeca
github.com/telepecas
instagram.com/telepecas
Portugal
2021-12-13 18:35:32
3
2
1
1
2
2
23
10000
0
1000
0
1000
0
2000
0
100
0
50
0
10
1
0
2
0
0
0
0
0
0
Telepeças - Hugo Rodrigues
Morada 1
Braga
4710-312 - Braga
12807754114
hugorodrigues@telepecas.com
+351910000000
e2413eba26e29db888fd21900c0bc939
1
A
1
1
1
1
1
1
1
1
1
1
1
1
1
1
ERROR
900.000.002
You do not have permissions to access API functionality.
Check the documentation at api.telepecas.com/docs
Entidades
Nesta secção encontrará todas as entidades que poderá interagir: inserindo ou atualizando dados.
Deverá ter atenção à secção dos Catálogos. Os catálogos são dicionários, constantes ou repositórios de informação necessárias em alguns endpoints.
Exemplos de catálogos: códigos de países, tipos de veículos, tipos de anúncios permitidos...
Em cada dicionário de argumentos de entrada dos endpoints terá, quando necessário, links aos catálogos.
Warehouses
Armazém é a entidade que define a localização do stock do cliente.
Cada vendedor poderá ter mais do que um armazém/filial onde o stock está armazenado.
Caso o stock introduzido não esteja associado a um armazém, ficará associado por predefinição à morada principal do registo do vendedor.
Quando a informação de um armazém for atualizada, todos os registos de stock presente nesse armazém serão automaticamente atualizados com a nova localização e assim recalculadas as novas condições de transporte em possíveis vendas.
Inserção de um armazém
Endpoint: https://api.telepecas.com/warehouses/createWarehouse
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/warehouses/createWarehouse \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"A1\", \"description\" : \"Armazém de Lisboa\", \"address\" : \"Rua de testes, nº23\", \"latitude\" : \"38.7437396\", \"longitude\" : \"-9.2302434\", \"countryCode\" : \"PT\", \"districtId\" : \"11\", \"zoneId\" : \"149\", \"postalCode1\" : \"1200\", \"postalCode2\" : \"111\", \"localDescription\" : \"Lisboa\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/warehouses/createWarehouse \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"A1\", \"description\" : \"Armazém de Lisboa\", \"address\" : \"Rua de testes, nº23\", \"latitude\" : \"38.7437396\", \"longitude\" : \"-9.2302434\", \"countryCode\" : \"PT\", \"districtId\" : \"11\", \"zoneId\" : \"149\", \"postalCode1\" : \"1200\", \"postalCode2\" : \"111\", \"localDescription\" : \"Lisboa\"}"PHP CODE function insertWarehouseAPI($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/warehouses/createWarehouse'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para inserir e alterar os dados relativos aos armazéns.
Caso o armazém já exista (externalId existente), será atualizada a informação correspondente a esse registo.
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | Unique value | A1 |
| description(*) | String | Filial de Lisboa |
| address(*) | String | Rua de testes, nº22 |
| latitude | Float | 38.7437396 |
| longitude | Float | -9.2302434 |
| countryCode(*) | Países | PT |
| districtId | Distritos | 11 |
| zoneId | Concelhos | 149 |
| postalCode1 (*) | String | 1200 |
| postalCode2 | String | 001 |
| localDescription (*) | String | Lisboa |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"5","status":"success","timestamp":"2021-06-07T20:48:27Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: warehouse external ID, description, address, invalid country code (ISO 3166-1 alpha-2), invalid district ID, invalid zone ID, invalid postal code, invalid local description","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
ERROR
900.000.005
Parameters error: warehouse external ID, description, address, invalid country code (ISO 3166-1 alpha-2), invalid district ID, invalid zone ID, invalid postal code, invalid local description
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Consulta de um armazém
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/warehouses/getWarehouses?id=A1&token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/warehouses/getWarehouses?id=A1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getWarehouseAPI($warehouseID){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/warehouses/getWarehouses?id='.$warehouseID.'&token=AAAAAAAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Para consultar a informação de um armazém deverá indicar o ID que definiu na inserção (externalId).
Endpoint: https://api.telepecas.com/warehouses/getWarehouses
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| id(*) | String | A1 |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"status":"success","timestamp":"2021-06-07T20:59:45Z","warehouses":[{"id":"1","externalId":"A1","description":"Armaz\u00e9m de Lisboaa","address":"Rua de testes, n\u00ba23","latitude":"38.7437395","longitude":"-9.2302433","countryCode":"PT","districtId":"11","zoneId":"150","postalCode1":"1201","postalCode2":"001","localDescription":"Lisboaa"}]}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
2021-06-09T14:46:52Z
1
A1
Armazém de Lisboaa
Rua de testes, nº23
38.7437395
-9.2302433
PT
11
150
1201
001
Lisboaa
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Consulta de todos os armazéns de um cliente
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/warehouses/getWarehouses?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/warehouses/getWarehouses \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getListWarehousesAPI(){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/warehouses/getWarehouses?token=AAAAAAAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json '; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve a lista de todos os armazéns referentes a um dado cliente.
Endpoint: https://api.telepecas.com/warehouses/getWarehouses
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"warehouses":[{"id":"1","externalId":"A1","description":"Armaz\u00e9m de Lisboaa","address":"Rua de testes, n\u00ba23","latitude":"38.7437395","longitude":"-9.2302433","countryCode":"PT","districtId":"11","zoneId":"150","postalCode1":"1201","postalCode2":"001","localDescription":"Lisboa"},{"id":"2","externalId":"A2","description":"Armaz\u00e9m de Porto","address":"Rua de testes, n\u00ba1","latitude":"38.7437395","longitude":"-9.2302433","countryCode":"PT","districtId":"11","zoneId":"149","postalCode1":"4000","postalCode2":"001","localDescription":"Porto"}],"status":"success","timestamp":"2021-06-09T15:37:23Z"}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
2021-06-09T14:49:43Z
1
A1
Armazém de Lisboaa
Rua de testes, nº23
38.7437395
-9.2302433
PT
11
150
1201
001
Lisboa
2
A2
Armazém de Porto
Rua de testes, nº1
38.7437395
-9.2302433
PT
11
149
4000
001
Porto
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Catálogo de marcas
Este catálogo deverá conter todas as marcas dos veículos cujas peças foram desmanteladas ou que são compatíveis.
Nota: Quando eliminar um registo de uma marca, todo o stock bem como todos os modelos referentes a essa marca serão inativados de forma automática.
Se possui uma licença TecDoc que contemple os ID's ktype poderá adicionar esses identificadores aos registos a sincronizar (opcional).
Caso preencha os ID's ktype o seu stock irá aparecer nas pesquisas avançadas e nas ferramentas de mapeamentos de stock, aumentando a probabilidade de ocorrer vendas e desta forma melhorar a pontuação de otimização de stock na plataforma (recomendado).
Inserção / alteração de uma marca
Endpoint: https://api.telepecas.com/catalog/makes/createMake
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/catalog/makes/createMake \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"description\" : \"Opel\", \ \"externalId\" : \"2\", \ \"telepecasId\" : \"0\", \ \"ktype\" : \"0\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/catalog/makes/createMake \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"description\" : \"Opel\", \ \"externalId\" : \"2\", \ \"telepecasId\" : \"0\", \ \"ktype\" : \"0\"}"PHP CODE function insertMake($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/makes/createMake'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para inserir ou alterar registos de marcas de viaturas.
Se o externalId existir, o registo será automaticamente atualizado.
O campo ktype é opcional e restrito a utilizadores com licença TecDoc.
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | Unique value | 2 |
| description(*) | String | Opel |
| telepecasId | Number | 0 |
| ktype | Number | 0 |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"3","status":"success","timestamp":"2021-06-11T10:33:44Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: make description","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
ERROR
900.000.005
Parameters error: make description
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Remoção de uma marca
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/catalog/makes/deleteMake \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"2\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/catalog/makes/deleteMake \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"2\"}"PHP CODE function deleteMake($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/makes/deleteMake'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Atenção: Ao ser removida uma marca todos os modelos e artigos referentes a esta marca serão removidos.
Endpoint: https://api.telepecas.com/catalog/makes/deleteMake
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | 2 |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"3","status":"success","timestamp":"2021-06-11T10:36:58Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: external make ID","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
3
success
2021-06-11T10:39:21Z
ERROR
900.000.007
No record found in client database
No results. Try change the external identifier.
Consulta de uma marca
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/makes/getMakes?token=AAAAAAAAAAA&id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/makes/getMakes?id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getMake($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/makes/getMakes?token=AAAA&id=1'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve o registo de uma marca, de um dado cliente.
Endpoint: https://api.telepecas.com/catalog/makes/getMakes
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| id | (External ID) | String | 1 |
Resposta
SUCCESS
{"status":"success","timestamp":"2021-06-11T11:55:23Z","makes":[{"id":"1","externalId":"1","description":"Opel","telepecasId":"0","ktype":"0","status":"ACTIVE","updated_at":"2021-04-18 14:41:06"}]}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
2021-06-11T11:55:39Z
1
1
Opel
0
0
ACTIVE
2021-04-18 14:41:06
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Consulta do catálogo de marcas
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/makes/getMakes?token=AAAAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/makes/getMakes \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getMake($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/makes/getMakes?token=AAAA&limit=1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve uma lista de marcas, de um dado cliente.
Endpoint: https://api.telepecas.com/catalog/makes/getMakes
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| limit | Number | (Default = 100) | 10 |
| offset | Number | (Default = 0) | 10 |
Resposta
SUCCESS
{"makes":[{"id":"1","externalId":"1","description":"Opel","telepecasId":"0","ktype":"0","status":"ACTIVE","updated_at":"2021-04-18 14:41:06"},{"id":"2","externalId":"2","description":"Audi","telepecasId":"0","ktype":"0","status":"ACTIVE","updated_at":"2021-04-18 14:31:08"}],"count":"2","limit":10,"offset":0,"pages":1,"lastPage":"","nextPage":"","status":"success","timestamp":"2021-06-11T10:56:07Z"}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
1
1
Opel
0
0
ACTIVE
2021-04-18 14:41:06
2
2
Audi
0
0
ACTIVE
2021-04-18 14:31:08
success
2021-06-11T11:53:57Z
2
10
0
1
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Catálogo de modelos
Para adicionar stock é necessário introduzir o seu catálogo de modelos.
Nota: Quando eliminar um registo de um dado modelo todo o stock associado a essa modelo será inativado de forma automática.
Se possui uma licença TecDoc que contemple os ID's ktype poderá adicionar esses identificadores aos registos submetidos (opcional).
Caso preencha os ID's ktype o seu stock irá aparecer nas pesquisas avançadas e nas ferramentas de mapeamentos de stock, aumentando a probabilidade de ocorrer vendas e desta forma melhorar a pontuação de otimização de stock na plataforma (recomendado).
Inserção / alteração de um modelo
Endpoint: https://api.telepecas.com/catalog/models/createModel
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/catalog/models/createModel \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"description\" : \"Corsa A\", \ \"externalId\" : \"23\", \ \"externalMakeId\" : \"2\", \ \"ktype\" : \"0\", \ \"tecDocModelId\" : \"0\", \ \"initYear\" : \"1986\", \ \"endYear\" : \"1994\", \ \"vehicleType\" : \"1\", \ \"telepecasId\" : \"0\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/catalog/models/createModel \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"description\" : \"Corsa A\", \ \"externalId\" : \"23\", \ \"externalMakeId\" : \"2\", \ \"ktype\" : \"0\", \ \"tecDocModelId\" : \"0\", \ \"initYear\" : \"1986\", \ \"endYear\" : \"1994\", \ \"vehicleType\" : \"1\", \ \"telepecasId\" : \"0\"}"PHP CODE function insertModel($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/models/createModel'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para inserir ou alterar registos de modelos de viaturas.
Se o externalId existir, o registo será automaticamente atualizado.
O campo ktype é opcional e restrito a utilizadores com licença TecDoc.
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | Unique value | 2 |
| description(*) | String | Corsa A |
| externalMakeId(*) | String | 0 |
| vehicleType(*) | Tipos de veículo | 1 |
| telepecasId | Number | 0 |
| ktype | Number | 0 |
| tecDocModelId | Number | 0 |
| initYear | Number | 1986 |
| endYear | Number | 1994 |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"2","status":"success","timestamp":"2021-06-11T12:47:18Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: model description","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
ERROR
900.000.005
Parameters error: model description
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Remoção de um modelo
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/catalog/models/deleteModel \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"2\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/catalog/models/deleteModel \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"2\" }"PHP CODE function deleteModel($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/models/deleteModel'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Atenção: Ao ser removido um modelo todos os artigos referentes a esse modelo serão inativados.
Endpoint: https://api.telepecas.com/catalog/models/deleteModel
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | 2 |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"1","status":"success","timestamp":"2021-06-11T12:49:47Z"}
ERROR
{"error":{"code":"900.000.007","description":"No record found in client database","message":"No results. Try change the external identifier."}}
SUCCESS
1
success
2021-06-11T12:51:34Z
ERROR
900.000.007
No record found in client database
No results. Try change the external identifier.
Consulta de um modelo
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/models/getModels?token=AAAAAAAAAAA&id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/models/getModels?id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getModel($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/models/getModels?token=AAAA&id=1'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve o registo de um modelo, de um dado cliente.
Endpoint: https://api.telepecas.com/catalog/models/getModels
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| id | (External ID) | String | 1 |
Resposta
SUCCESS
{"status":"success","timestamp":"2021-06-11T12:56:54Z","models":[{"id":"1","externalId":"1","description":"Corsa A","externalMakeId":"1","makeDescription":"Opel","fullDescription":"Opel Corsa A","telepecasId":"0","ktype":"0","tecDocModelId":"0","initYear":"1980","endYear":"1992","vehicleType":"1","status":"ACTIVE","updated_at":"2021-06-11 12:53:11"}]}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
2021-06-11T12:58:38Z
1
1
1
Corsa A
Opel
Opel Corsa A
0
0
0
1980
1992
1
ACTIVE
2021-06-11 12:53:11
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Consulta do catálogo de modelos
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/models/getModels?token=AAAAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/models/getModels \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getModels($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/models/getModels?token=AAAA&limit=1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve uma lista de modelos, de um dado cliente.
Endpoint: https://api.telepecas.com/catalog/models/getModels
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| limit | Number | (Default = 100) | 10 |
| offset | Number | (Default = 0) | 10 |
| externalMakeId | Marcas | 1 |
Resposta
SUCCESS
{"models":[{"id":"1","externalId":"1","description":"Corsa A","externalMakeId":"1","makeDescription":"Opel","fullDescription":"Opel Corsa A","telepecasId":"0","ktype":"0","tecDocModelId":"0","initYear":"1980","endYear":"1992","vehicleType":"1","status":"ACTIVE","updated_at":"2021-06-11 12:53:11"},{"id":"3","externalId":"3","description":"Corsa C","externalMakeId":"1","makeDescription":"Opel","fullDescription":"Opel Corsa C","telepecasId":"12","ktype":"2323","tecDocModelId":"1","initYear":"112","endYear":"2323","vehicleType":"1","status":"ACTIVE","updated_at":"2021-05-25 01:19:43"}],"count":"2","limit":10,"offset":0,"pages":1,"lastPage":"","nextPage":"","status":"success","timestamp":"2021-06-11T14:11:04Z"}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
1
1
Corsa A
1
Opel
Opel Corsa A
0
0
0
1980
1992
1
ACTIVE
2021-06-11 12:53:11
3
3
Corsa C
1
Opel
Opel Corsa C
12
2323
1
112
2323
1
ACTIVE
2021-05-25 01:19:43
success
2021-06-11T14:08:22Z
2
10
0
1
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Catálogo de Partes
Para adicionar stock é necessário manter atualizado o seu catálogo de partes.
Nota: Quando eliminar um registo de uma dada parte, todo o stock associado a essa parte será inativado de forma automática.
Inserção / alteração de uma parte
Endpoint: https://api.telepecas.com/catalog/parts/createPart
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/catalog/parts/createPart \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"23\", \"partTypeId\" : \"0\", \"localId\" : \"0\", \"groupId\" : \"0\", \"sideId\" : \"0\", \"sideDimensionId\" : \"0\", \"isTools\" : \"0\", \"telepecasId\" : \"0\", \"weight\" : \"90\", \"dimLength\" : \"100\", \"dimWidth\" : \"40\", \"dimHeight\" : \"50\", \"volume\" : \"0.02\", \"partDescription\" : [{\"languageCode\" : \"PT\", \"content\" : \"Motor completo\"}, {\"languageCode\" : \"EN\", \"content\" : \"Full Engine\"}], \ \"partFixedObs\" : [{\"languageCode\" : \"PT\", \"content\" : \"com turbo\"}, {\"languageCode\" : \"EN\", \"content\" : \"with turbo\"}] }" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/catalog/parts/createPart \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"23\", \"partTypeId\" : \"0\", \"localId\" : \"0\", \"groupId\" : \"0\", \"sideId\" : \"0\", \"sideDimensionId\" : \"0\", \"isTools\" : \"0\", \"telepecasId\" : \"0\", \"weight\" : \"90\", \"dimLength\" : \"100\", \"dimWidth\" : \"40\", \"dimHeight\" : \"50\", \"volume\" : \"0.02\", \"partDescription\" : [{\"languageCode\" : \"PT\", \"content\" : \"Motor completo\"}, {\"languageCode\" : \"EN\", \"content\" : \"Full Engine\"}], \ \"partFixedObs\" : [{\"languageCode\" : \"PT\", \"content\" : \"com turbo\"}, {\"languageCode\" : \"EN\", \"content\" : \"with turbo\"}] }"PHP CODE function insertPart($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/parts/createPart'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para inserir ou alterar registos de partes.
Se o externalId existir, o registo será automaticamente atualizado.
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | Unique value | 2 |
| partTypeId | Tipos de peças | 0 |
| localId | Localizações peças | 0 |
| groupId | Grupos de peças | 0 |
| sideId | Lados peças | 0 |
| sideDimensionId | Lados dimensões peças | 0 |
| isTools | Number (0/1) | 0 |
| telepecasId | Number | 0 |
| weight | Float (Kg) | 0 |
| dimLength | Float (cm) | 60 |
| dimWidth | Float (cm) | 40 |
| dimHeight | Float (cm) | 0 |
| volume | Float (m3) | 0.2 |
| partDescription(*) | [ languageCode ( Línguas) | content (String)] | [{ "languageCode" : "PT", "content" : "Motor Completo"}, { "languageCode": "EN", "content": "Full Engine"}] |
| partFixedObs(*) | [ languageCode ( Línguas) | content (String)] | [{ "languageCode" : "PT", "content" : "com turbo"}, { "languageCode": "EN", "content": "with turbo"}] |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"1","status":"success","timestamp":"2021-06-14T14:10:43Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: part description","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
ERROR
900.000.005
Parameters error: part description
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Remoção de uma parte
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/catalog/parts/deletePart \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"2\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/catalog/parts/deletePart \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"2\"}"PHP CODE function deletePart($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/parts/deletePart'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Atenção: Ao ser removido uma parte do catálogo, todos os artigos referentes a essa parte serão inativados.
Endpoint: https://api.telepecas.com/catalog/parts/deletePart
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | 2 |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"1","status":"success","timestamp":"2021-06-14T14:14:22Z"}
ERROR
{"error":{"code":"900.000.007","description":"No record found in client database","message":"No results. Try change the external identifier."}}
SUCCESS
1
success
2021-06-14T14:18:20Z
ERROR
900.000.007
No record found in client database
No results. Try change the external identifier.
Consulta de uma parte
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/parts/getParts?token=AAAAAAAAAAA&id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/parts/getParts?id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getPart($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/parts/getParts?token=AAAA&id=1'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve o registo de uma parte, de um dado cliente.
Endpoint: https://api.telepecas.com/catalog/parts/getParts
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| id | (External ID) | String | 1 |
Resposta
SUCCESS
{"status":"success","timestamp":"2021-06-14T14:30:25Z","parts":[{"id":"1","externalId":"1","partTypeId":"0","partTypeDescription":"","localId":"0","localDescription":"","groupId":"0","groupDescription":"","sideId":"0","sideDescription":"","sideDimensionId":"0","sideDimensionDescription":"","isTools":"0","weight":"10","dimLength":"5","dimWidth":"6","dimHeight":"4","volume":"0.0100","partDescriptionPT":"Comando da soufagem PT1","partDescriptionES":"Comando da soufagem ES1","partDescriptionFR":"Comando da soufagem FR1","partDescriptionEN":"Comando da soufagem EN1","partDescriptionIT":"Comando da soufagem IT1","partDescriptionDE":"Comando da soufagem DE1","partFixedObsPT":"descri\u00e7\u00e3o fixo PT","partFixedObsES":"descri\u00e7\u00e3o fixo ES","partFixedObsEN":"descri\u00e7\u00e3o fixo EN","partFixedObsFR":"descri\u00e7\u00e3o fixo FR","partFixedObsIT":"descri\u00e7\u00e3o fixo IT","partFixedObsDE":"descri\u00e7\u00e3o fixo DE","status":"ACTIVE","updated_at":"2021-06-14 14:18:20"}]}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
2021-06-14T14:23:49Z
1
1
0
0
0
0
0
0
10
5
6
4
0.0100
Comando da soufagem PT
Comando da soufagem ES
Comando da soufagem FR
Comando da soufagem EN
Comando da soufagem IT
Comando da soufagem DE
descrição fixo PT
descrição fixo ES
descrição fixo EN
descrição fixo FR
descrição fixo IT
descrição fixo DE
ACTIVE
2021-06-14 14:18:20
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Consulta do catálogo de partes
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/parts/getParts?token=AAAAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/parts/getParts \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getParts($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/parts/getParts?token=AAAA&limit=1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve uma lista de partes, de um dado cliente.
Endpoint: https://api.telepecas.com/catalog/parts/getParts
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| limit | Number | (Default = 100) | 10 |
| offset | Number | (Default = 0) | 10 |
Resposta
SUCCESS
{"parts":[{"id":"1","externalId":"1","partTypeId":"0","partTypeDescription":"","localId":"0","localDescription":"","groupId":"0","groupDescription":"","sideId":"0","sideDescription":"","sideDimensionId":"0","sideDimensionDescription":"","isTools":"0","weight":"10","dimLength":"5","dimWidth":"6","dimHeight":"4","volume":"0.0100","partDescriptionPT":"Comando da soufagem PT1","partDescriptionES":"Comando da soufagem ES1","partDescriptionFR":"Comando da soufagem FR1","partDescriptionEN":"Comando da soufagem EN1","partDescriptionIT":"Comando da soufagem IT1","partDescriptionDE":"Comando da soufagem DE1","partFixedObsPT":"descri\u00e7\u00e3o fixo PT","partFixedObsES":"descri\u00e7\u00e3o fixo ES","partFixedObsEN":"descri\u00e7\u00e3o fixo EN","partFixedObsFR":"descri\u00e7\u00e3o fixo FR","partFixedObsIT":"descri\u00e7\u00e3o fixo IT","partFixedObsDE":"descri\u00e7\u00e3o fixo DE","status":"ACTIVE","updated_at":"2021-06-14 14:18:20"},{"id":"2","externalId":"2","partTypeId":"0","partTypeDescription":"","localId":"0","localDescription":"","groupId":"0","groupDescription":"","sideId":"0","sideDescription":"","sideDimensionId":"0","sideDimensionDescription":"","isTools":"0","weight":"8","dimLength":"3","dimWidth":"3","dimHeight":"3","volume":"0.0100","partDescriptionPT":"Caixa de velocidades PT","partDescriptionES":"Caixa de velocidades ES","partDescriptionFR":"Caixa de velocidades FR","partDescriptionEN":"Caixa de velocidades EN","partDescriptionIT":"Caixa de velocidades IT","partDescriptionDE":"Caixa de velocidades DE","partFixedObsPT":"desc PT","partFixedObsES":"desc ES","partFixedObsEN":"desc EN","partFixedObsFR":"desc FR","partFixedObsIT":"desc IT","partFixedObsDE":"desc DE","status":"ACTIVE","updated_at":"2021-04-19 00:11:40"},{"id":"3","externalId":"15","partTypeId":"0","partTypeDescription":"","localId":"0","localDescription":"","groupId":"12","groupDescription":"Front Window Mechanism","sideId":"1","sideDescription":"Left","sideDimensionId":"1","sideDimensionDescription":"Front","isTools":"0","weight":"0","dimLength":"0","dimWidth":"0","dimHeight":"0","volume":"0.0000","partDescriptionPT":"Comando da soufagem PT1","partDescriptionES":"Comando da soufagem ES1","partDescriptionFR":"Comando da soufagem FR1","partDescriptionEN":"Comando da soufagem EN1","partDescriptionIT":"Comando da soufagem IT1","partDescriptionDE":"Comando da soufagem DE1","partFixedObsPT":"descri\u00e7\u00e3o fixo PT","partFixedObsES":"descri\u00e7\u00e3o fixo ES","partFixedObsEN":"descri\u00e7\u00e3o fixo EN","partFixedObsFR":"descri\u00e7\u00e3o fixo FR","partFixedObsIT":"descri\u00e7\u00e3o fixo IT","partFixedObsDE":"descri\u00e7\u00e3o fixo DE","status":"ACTIVE","updated_at":"2021-05-25 01:19:43"}],"count":"3","limit":10,"offset":0,"pages":1,"lastPage":"","nextPage":"","status":"success","timestamp":"2021-06-14T14:56:16Z"}
ERROR
{"parts":[],"count":"3","limit":10,"offset":10,"pages":1,"lastPage":"https:\/\/api.telepecas.com\/catalog\/parts\/getParts?token=5da99f00e75c2beb51bf1d43db432188&limit=10&offset=0","nextPage":"","status":"success","timestamp":"2021-06-14T14:57:35Z"}
SUCCESS
1
1
0
0
0
0
0
0
10
5
6
4
0.0100
Comando da soufagem PT1
Comando da soufagem ES1
Comando da soufagem FR1
Comando da soufagem EN1
Comando da soufagem IT1
Comando da soufagem DE1
descrição fixo PT
descrição fixo ES
descrição fixo EN
descrição fixo FR
descrição fixo IT
descrição fixo DE
ACTIVE
2021-06-14 14:18:20
2
2
0
0
0
0
0
0
8
3
3
3
0.0100
Caixa de velocidades PT
Caixa de velocidades ES
Caixa de velocidades FR
Caixa de velocidades EN
Caixa de velocidades IT
Caixa de velocidades DE
desc PT
desc ES
desc EN
desc FR
desc IT
desc DE
ACTIVE
2021-04-19 00:11:40
3
15
0
0
12
Front Window Mechanism
1
1
Front
0
0
0
0
0
0.0000
Comando da soufagem PT1
Comando da soufagem ES1
Comando da soufagem FR1
Comando da soufagem EN1
Comando da soufagem IT1
Comando da soufagem DE1
descrição fixo PT
descrição fixo ES
descrição fixo EN
descrição fixo FR
descrição fixo IT
descrição fixo DE
ACTIVE
2021-05-25 01:19:43
success
2021-06-14T15:00:10Z
3
10
0
1
ERROR
success
2021-06-14T14:58:44Z
3
10
10
1
https://api.telepecas.com/catalog/parts/getParts?token=5da99f00e75c2beb51bf1d43db432188&limit=10&offset=0
Stock
Stock é a entidade que define as peças que tem disponível para venda nos armazéns dos seus clientes. Cada registo irá corresponder a um anúncio publicado na loja online da TelePeças e no seu website.
Apesar de ser opcional, recomendamos que categorize o seu stock fazendo referência aos catálogos disponíveis. Desta forma terá uma maior probabilidade de venda dos produtos.
Inserção stock
Endpoint: https://api.telepecas.com/stock/createStock
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/stock/createStock \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"2\", \ \"externalReference\" : \"STOCK2422222\", \ \"stockType\" : \"P\", \ \"compatibleCarModels\" : [ { \"externalModelId\" : \"2\"} ], \ \"dataOEM\" : [{\"refOEM\" : \"A2323232\", \"priceOEM\" : \"12.21\"}, {\"refOEM\" : \"T26HGS\", \"priceOEM\" : \"15.00\"}] , \ \"tags\" : [{\"description\": \"TAG TESTE\"}, {\"description\": \"TAG 2\"}], \ \"images\" : [], \ \"engine\" : { \"engineInfo\" : \"2.2 HDI\", \"engineCode\" : \"TGW\", \"tecDocEngineId\" : \"0\"}, \ \"partInfo\" : { \"externalPartId\" : \"1\" }, \ \"vehicleInfo\" : { \"externalModelId\" : \"2\" }, \ \"observations\" : \"color 354\", \ \"price1\" : \"100\", \ \"price2\" : \"80\", \ \"vatIncluded\" : \"0\", \ \"price1StockOff\" : \"0\", \ \"price2StockOff\" : \"0\", \ \"initDateStockOff\" : \"2021-06-20 01:00:00\", \ \"endDateStockOff\" : \"2021-06-25 01:00:00\", \ \"pinStock\" : \"0\", \ \"state\" : \"A\", \ \"references\" : [{\"reference\":\"ABC\",\"isMaster\":\"0\"},{\"reference\":\"DEF\",\"isMaster\":\"1\"}], \ \"warehouseId\" : \"0\", \ \"rating\" : \"3\", \ \"stateConditionStock\" : \"0\", \ \"quality\" : \"0\", \ \"packaging\" : \"0\", \ \"labelling\" : \"0\", \ \"dataTire\" : {} }" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/stock/createStock \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"2\", \ \"externalReference\" : \"STOCK2422222\", \ \"stockType\" : \"P\", \ \"compatibleCarModels\" : [ { \"externalModelId\" : \"2\"} ], \ \"dataOEM\" : [{\"refOEM\" : \"A2323232\", \"priceOEM\" : \"12.21\"}, {\"refOEM\" : \"T26HGS\", \"priceOEM\" : \"15.00\"}] , \ \"tags\" : [{\"description\": \"TAG TESTE\"}, {\"description\": \"TAG 2\"}], \ \"images\" : [], \ \"engine\" : { \"engineInfo\" : \"2.2 HDI\", \"engineCode\" : \"TGW\", \"tecDocEngineId\" : \"0\"}, \ \"partInfo\" : { \"externalPartId\" : \"1\" }, \ \"vehicleInfo\" : { \"externalModelId\" : \"2\" }, \ \"observations\" : \"color 354\", \ \"price1\" : \"100\", \ \"price2\" : \"80\", \ \"vatIncluded\" : \"0\", \ \"price1StockOff\" : \"0\", \ \"price2StockOff\" : \"0\", \ \"initDateStockOff\" : \"2021-06-20 01:00:00\", \ \"endDateStockOff\" : \"2021-06-25 01:00:00\", \ \"pinStock\" : \"0\", \ \"state\" : \"A\", \ \"references\" : [{\"reference\":\"ABC\",\"isMaster\":\"0\"},{\"reference\":\"DEF\",\"isMaster\":\"1\"}], \ \"warehouseId\" : \"0\", \ \"rating\" : \"3\", \ \"stateConditionStock\" : \"0\", \ \"quality\" : \"0\", \ \"packaging\" : \"0\", \ \"labelling\" : \"0\", \ \"dataTire\" : {} }"PHP CODE function insertStock($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/stock/createStock'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para inserir ou alterar registos de stock.
Se o externalId existir, o registo será automaticamente atualizado.
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | Unique value (cliente) Este campo será usado para identificar o artigo na plataforma (área reservada e funcionalidades do cliente). Utilize este identificador em todos os endpoints para referenciar o registo. |
2 |
| externalReference(*) | String | Unique value (developer) Se utilizar o método de credenciais cliente, poderá usar o mesmo valor do externalId. Este campo será usado para identificar o artigo nos webhooks (notificações de vendas,...). |
STOCK313232 |
| stockType(*) | Tipo de anúncios | P |
| compatibleCarModels | [ externalModelId (String) | externalMakeId (String) | description (String) | vehicleType ( Tipos de veículo) | telepecasModelId (String) | ktype (String) | tecDocModelId (String) | initYear (String) | endYear (Number) | fuelId ( Combustíveis) ] | [ { "externalModelId" : "2"}, {"externalMakeId" : "1", "description" : "A6", "vehicleType" : "1", "telepecasModelId" : "0", "ktype" : "0", "tecDocModelId" : "0", "initYear": "2000", "endYear" : "2020", "fuelId" : "0"} ] |
| dataOEM | [ refOEM (String) | priceOEM (Float) ] | [{"refOEM" : "A2323232", "priceOEM" : "12.21"}, {"refOEM" : "T26HGS", "priceOEM" : "15.00"}] |
| tags | [ description (String) ] | [{"description": "TAG TESTE"}, {"description": "TAG 2"}] |
| images | [ externalImageId (String) | urlImage (String) | isMaster (0/1) ] | [{"externalImageId": "A1", "urlImage": "https://www.test.com/images/test.png", "isMaster": "1"}, {"externalImageId": "A1", "urlImage": "https://www.test.com/images/test2.png", "isMaster": "0"}] |
| engine | engineInfo (String) | engineCode (String) | tecDocEngineId (Number) | { "engineInfo" : "2.2 HDI", "engineCode" : "TGW", "tecDocEngineId" : "0"} |
| partInfo se stockType for tipo "P" (*) | externalPartId (String) | telepecasPartId (Number) | isTools (Number) | partTypeId ( Tipos de peças) | groupId ( Grupos de peças) | localId ( Localizações peças) | sideId ( Lados peças) | sideDimensionId ( Lados dimensões peças | telepecasId (Number) | weight (Float) | dimLength (Float) | dimWidth (Float) | dimHeight (Float) | volume (Float) | partDescription ( [ languageCode Línguas | content (String) ]) | partFixedObs ( [ languageCode Línguas | content (String) ] ) ) | { "externalPartId" : "", "telepecasPartId" : "0", "isTools" : "0", "partTypeId" : "0", "groupId" : "0", "localId" : "0", "sideId" : "0", "sideDimensionId" : "0", "telepecasId" : "0", "weight" : "10", "dimLength" : "0", "dimWidth" : "0", dimHeight : "0", "volume" : "0", partDescription" : [{"languageCode": "PT", "content": "Caixa velocidades"}], partFixedObs" : [{"languageCode": "PT", "content": "teste"}] } |
| vehicleInfo se stockType for tipo "P", "D" ou "V" (*) | externalModelId (String) | externalOriginVehicleReference (String - externalId do registo da viatura) | externalMakeId (String) | vehicleType (Tipos de veículo) | description (String) | telepecasModelId (Number) | ktype (Number) | tecDocModelId (Number) | initYear (Number) | endYear (Number) | fuelId (Combustíveis) | doorsNumber (Number) | drivetrain (String) | transmission (String) | brakeSystem (String) | engineType (String) | constructionType (String) | brakeType (String) | catalystType (String) | noCylinders (Number) | noValves (Number) | kms (Number) | vin (String) | registryDate (Date Format: Y-m-d H:i:s) | yearVehicle (Integer) | { "externalModelId" : "2", "externalOriginVehicleReference" : "1"} |
| observations | String | color 354/7 Titansilber-Metallic |
| price1 | Float | 100 |
| price2 | Float | 80 |
| vatIncluded | Number (0/1) | 0 |
| price1StockOff | Number | 0 |
| price2StockOff | Number | 0 |
| initDateStockOff | Date (Format: Y-m-d H:i:s) | 2021-06-20 01:00:00 |
| endDateStockOff | Date (Format: Y-m-d H:i:s) superior à initDateStockOff quando for preenchida | 2021-06-25 01:00:00 |
| pinStock | Number (0/1) | 0 |
| state | Estados dos produtos | A |
| references | [ reference (String) | isMaster (0/1)] | [{"reference":"ABC","isMaster":"0"},{"reference":"DEF","isMaster":"1"}] |
| warehouseId | String (ID externo warehouse) | 0 |
| rating | Float (0 <= rating <= 5) | 3 |
| stateConditionStock | Estado de venda peças | 0 |
| quality | Qualidade peças | 0 |
| packaging | Tipos de embalagens | 0 |
| labelling | Tipos de etiquetas | 0 |
| dataTire se stockType for tipo "T" (*) | seasonId ( Pneus - Estações) | width (Float) | height (Float) | diameter (Float) | manufacterId ( Pneus - Fabricantes) | speedRating ( Pneus - Velocidades) | typeCar ( Pneus - Tipos carros) | { "seasonId": "", "width":"205", "height":"55", "diameter":"16", "manufacterId":"34", "speedRating":"", "typeCar":"C"} |
(*) - Campos obrigatórios
- Poderá preencher apenas os elementos identificados a vermelho caso tenha os catálogos de peças e modelos inseridos. Em alternativa poderá adicionar novos modelos / peças quando criar os registos de stock, enviando toda a informação pedida nas estruturas indicadas. Não é permitido atualizar modelos ou peças caso os external ID's já existam. Para isso utilize os endpoints das entidades respetivas.
Resposta
SUCCESS
{"id":"3","status":"success","timestamp":"2021-06-16T21:39:54Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: external stock ID","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
ERROR
900.000.005
Parameters error: external stock ID
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Remoção de stock
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/stock/deleteStock \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"2\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/stock/deleteStock \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"2\"}"PHP CODE function deleteStock($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/stock/deleteStock'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Endpoint: https://api.telepecas.com/stock/deleteStock
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | 2 |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"1","status":"success","timestamp":"2021-06-14T14:14:22Z"}
ERROR
{"error":{"code":"900.000.007","description":"No record found in client database","message":"No results. Try change the external identifier."}}
SUCCESS
1
success
2021-06-14T14:18:20Z
ERROR
900.000.007
No record found in client database
No results. Try change the external identifier.
Consulta de um registo de stock
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/stock/getStock?token=AAAAAAAAAAA&id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/stock/getStock?id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStock($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/stock/getStock?token=AAAA&id=1'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve o registo de um elemento do stock, de um dado cliente.
Endpoint: https://api.telepecas.com/stock/getStock
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| id | (External ID) | String | 1 |
| repo | Repositorórios (Default = 1) | 1 |
Resposta
SUCCESS
{"status":"success","timestamp":"2021-06-19T20:33:11Z","stocks":[{"id":"3","externalId":"3","externalReference":"STOCK23232232","compatibleCarModels":[{"id":"3","externalId":"3","description":"Corsa C","makeDescription":"Opel","fullDescription":"Opel Corsa C","externalMakeId":"1","telepecasId":"12","ktype":"2323","tecDocModelId":"1","initYear":"112","endYear":"2323","vehicleType":"1"}],"dataOEM":[{"makeOEM":"Bosch","refOEM":"12232323","priceOEM":"12.12","description":"Refer\u00eancia original"}],"tags":[{"description":"T1","position":0}],"images":[{"externalImageId":"23232","urlImage":"https:\/\/pt.telepecas.com\/imagemOk.png","urlImageThumbnail":"","isMaster":1,"pos":0},{"externalImageId":"23233","urlImage":"https:\/\/pt.telepecas.com\/imagemOk2.png","urlImageThumbnail":"https:\/\/pt.telepecas.com\/imagemOk2Thumb.png","isMaster":0,"pos":0}],"engine":{"engineInfo":"Motor AAA","engineCode":"AAA","tecDocEngineId":"0"},"stockType":"P","partInfo":{"id":"3","externalId":"15","partTypeId":"0","partTypeDescription":"","localId":"0","localDescription":"","groupId":"12","groupDescription":"Front Window Mechanism","sideId":"1","sideDescription":"Left","sideDimensionId":"1","sideDimensionDescription":"Front","isTools":"0","weight":"0","dimLength":"0","dimWidth":"0","dimHeight":"0","volume":"0.0000","partDescriptionPT":"Comando da soufagem PT1","partDescriptionES":"Comando da soufagem ES1","partDescriptionFR":"Comando da soufagem FR1","partDescriptionEN":"Comando da soufagem EN1","partDescriptionDE":"Comando da soufagem DE1","partDescriptionIT":"Comando da soufagem IT1","partFixedObsPT":"descri\u00e7\u00e3o fixo PT","partFixedObsES":"descri\u00e7\u00e3o fixo ES","partFixedObsFR":"descri\u00e7\u00e3o fixo FR","partFixedObsEN":"descri\u00e7\u00e3o fixo EN","partFixedObsDE":"descri\u00e7\u00e3o fixo DE","partFixedObsIT":"descri\u00e7\u00e3o fixo IT"},"vehicleInfo":{"id":"4","externalModelId":"10","description":"Corsa D","makeDescription":"Opel","fullDescription":"Opel Corsa D","externalMakeId":"1","telepecasModelId":"12","ktype":"2323","tecDocModelId":"1","initYear":"112","endYear":"2323","vehicleType":"1","externalOriginVehicleReference":"","fuelId":"","doorsNumber":"","vin":"","kms":"","registryDate":"","drivetrain":"","transmission":"","brakeSystem":"","engineType":"","constructionType":"","brakeType":"","catalystType":"","noCylinders":"","noValves":""},"dataTire":[],"observations":"Isto \u00e9 um campo de observa\u00e7\u00f5es da pe\u00e7a...","price1":"120.00","price2":"100.00","vatIncluded":"0","price1StockOff":"0.00","price2StockOff":"0.00","initDateStockOff":"0000-00-00 00:00:00","endDateStockOff":"0000-00-00 00:00:00","pinStock":"0","state":"A","references":[{"reference":"B","isMaster":0},{"reference":"C","isMaster":0}],"warehouseId":"","rating":"5","stateConditionStock":"1","quality":"1","packaging":"1","labelling":"1","updated_at":"2021-06-16 21:40:35"}]}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
2021-06-18T17:15:42Z
1
1
STOCK434232
4
10
1
Corsa D
Opel
Opel Corsa D
12
2323
1
112
2323
1
Bosch
12232323
12.12
Referência original
T1
0
23232
https://pt.telepecas.com/imagemOk.png
1
0
23233
https://pt.telepecas.com/imagemOk2.png
https://pt.telepecas.com/imagemOk2Thumb.png
0
0
Motor AAA
Motor AAA
0
P
3
15
0
0
12
Front Window Mechanism
1
1
Front
0
0
0
0
0
0.0000
Comando da soufagem PT1
Comando da soufagem ES1
Comando da soufagem FR1
Comando da soufagem EN1
Comando da soufagem IT1
Comando da soufagem DE1
descrição fixo PT
descrição fixo ES
descrição fixo EN
descrição fixo FR
descrição fixo IT
descrição fixo DE
ACTIVE
4
10
1
Corsa D
Opel
Opel Corsa D
12
2323
1
112
2323
1
0
0
Isto é um campo de observações da peça...
120.00
100.00
0
0.00
0.00
0000-00-00 00:00:00
0000-00-00 00:00:00
0
A
5
1
1
1
1
2021-06-19 20:18:04
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Consulta lista stock
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/stock/getStock?token=AAAAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/stock/getStock \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStockData($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/stock/getStock?token=AAAA&limit=1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve uma lista de peças, de um dado cliente.
Endpoint: https://api.telepecas.com/stock/getStock
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| limit | Number | (Default = 100) | 10 |
| offset | Number | (Default = 0) | 10 |
| repo | Repositorórios (Default = 1) | 1 |
| dateFrom | Date (YYYY-MM-DD HH:mm:ss) | 2021-06-21 00:00:00 |
| dateTo | Date (YYYY-MM-DD HH:mm:ss) | 2021-06-21 00:00:00 |
Resposta
SUCCESS
{"stocks":[{"id":"1","externalId":"1","externalReference":"STOCK434232","compatibleCarModels":[{"id":"4","externalId":"10","description":"Corsa D","makeDescription":"Opel","fullDescription":"Opel Corsa D","externalMakeId":"1","telepecasId":"12","ktype":"2323","tecDocModelId":"1","initYear":"112","endYear":"2323","vehicleType":"1"}],"dataOEM":[{"makeOEM":"Bosch","refOEM":"12232323","priceOEM":"12.12","description":"Refer\u00eancia original"}],"tags":[{"description":"T1","position":0}],"images":[{"externalImageId":"23232","urlImage":"https:\/\/pt.telepecas.com\/imagemOk.png","urlImageThumbnail":"","isMaster":1,"pos":0},{"externalImageId":"23233","urlImage":"https:\/\/pt.telepecas.com\/imagemOk2.png","urlImageThumbnail":"https:\/\/pt.telepecas.com\/imagemOk2Thumb.png","isMaster":0,"pos":0}],"engine":{"engineInfo":"Motor AAA","engineCode":"AAA","tecDocEngineId":"0"},"stockType":"P","partInfo":{"id":"3","externalId":"15","partTypeId":"0","partTypeDescription":"","localId":"0","localDescription":"","groupId":"12","groupDescription":"Front Window Mechanism","sideId":"1","sideDescription":"Left","sideDimensionId":"1","sideDimensionDescription":"Front","isTools":"0","weight":"0","dimLength":"0","dimWidth":"0","dimHeight":"0","volume":"0.0000","partDescriptionPT":"Comando da soufagem PT1","partDescriptionES":"Comando da soufagem ES1","partDescriptionFR":"Comando da soufagem FR1","partDescriptionEN":"Comando da soufagem EN1","partDescriptionDE":"Comando da soufagem DE1","partDescriptionIT":"Comando da soufagem IT1","partFixedObsPT":"descri\u00e7\u00e3o fixo PT","partFixedObsES":"descri\u00e7\u00e3o fixo ES","partFixedObsFR":"descri\u00e7\u00e3o fixo FR","partFixedObsEN":"descri\u00e7\u00e3o fixo EN","partFixedObsDE":"descri\u00e7\u00e3o fixo DE","partFixedObsIT":"descri\u00e7\u00e3o fixo IT"},"vehicleInfo":{"id":"4","externalModelId":"10","description":"Corsa D","makeDescription":"Opel","fullDescription":"Opel Corsa D","externalMakeId":"1","telepecasModelId":"12","ktype":"2323","tecDocModelId":"1","initYear":"112","endYear":"2323","vehicleType":"1","externalOriginVehicleReference":"","fuelId":"","doorsNumber":"","vin":"","kms":"","registryDate":"","drivetrain":"","transmission":"","brakeSystem":"","engineType":"","constructionType":"","brakeType":"","catalystType":"","noCylinders":"","noValves":""},"dataTire":[],"observations":"Isto \u00e9 um campo de observa\u00e7\u00f5es da pe\u00e7a...","price1":"120.00","price2":"100.00","vatIncluded":"0","price1StockOff":"0.00","price2StockOff":"0.00","initDateStockOff":"0000-00-00 00:00:00","endDateStockOff":"0000-00-00 00:00:00","pinStock":"0","state":"A","references":[{"reference":"B","isMaster":0},{"reference":"C","isMaster":0}],"warehouseId":"","rating":"5","stateConditionStock":"1","quality":"1","packaging":"1","labelling":"1","updated_at":"2021-06-19 20:18:04"}],"count":"1","limit":100,"offset":0,"pages":1,"lastPage":"","nextPage":"","status":"success","timestamp":"2021-06-19T20:33:57Z"}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
2021-06-19T20:24:46Z
1
1
STOCK434232
4
10
1
Corsa D
Opel
Opel Corsa D
12
2323
1
112
2323
1
Bosch
12232323
12.12
Referência original
T1
0
23232
https://pt.telepecas.com/imagemOk.png
1
0
23233
https://pt.telepecas.com/imagemOk2.png
https://pt.telepecas.com/imagemOk2Thumb.png
0
0
Motor AAA
Motor AAA
0
P
3
15
0
0
12
Front Window Mechanism
1
1
Front
0
0
0
0
0
0.0000
Comando da soufagem PT1
Comando da soufagem ES1
Comando da soufagem FR1
Comando da soufagem EN1
Comando da soufagem IT1
Comando da soufagem DE1
descrição fixo PT
descrição fixo ES
descrição fixo EN
descrição fixo FR
descrição fixo IT
descrição fixo DE
ACTIVE
4
10
1
Corsa D
Opel
Opel Corsa D
12
2323
1
112
2323
1
0
0
Isto é um campo de observações da peça...
120.00
100.00
0
0.00
0.00
0000-00-00 00:00:00
0000-00-00 00:00:00
0
A
5
1
1
1
1
2021-06-19 20:18:04
1
100
0
1
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Atualização estado de uma peça
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/stock/changeStatusStock \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"2\", \ \"state\" : \"A\" }" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/stock/changeStatusStock \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"2\", \ \"state\" : \"A\" }"PHP CODE function updateStockState($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/stock/changeStatusStock'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Endpoint: https://api.telepecas.com/stock/changeStatusStock
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | 2 |
| state | Estados dos produtos | A |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"2","status":"success","timestamp":"2021-06-19T20:57:13Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: external stock ID not valid","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
2
success
2021-06-19T20:58:44Z
ERROR
900.000.005
Parameters error: external stock ID not valid
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Consulta da página do anúncio
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/stock/getStockAdPage?token=AAAAAAAAAAA&id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/stock/getStockAdPage?id=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStockAdPage($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/stock/getStockAdPage?token=AAAA&id=1'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve o link do anúncio, de uma dada peça publicada. Disponível apenas para stock introduzido através da versão production.
Endpoint: https://api.telepecas.com/stock/getStockAdPage
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| id | (External ID) | String | 1 |
Resposta
SUCCESS
{"status":"success","timestamp":"2021-11-26T01:46:07Z","id":"1","externalId":"2812366","urlPT":"https:\/\/pt.telepecas.com\/anuncio\/pecas\/auto\/usadas\/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html","urlES":"https:\/\/es.telepecas.com\/anuncio\/piezas\/auto\/usadas\/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html","urlFR":"https:\/\/fr.telepecas.com\/annonce\/pieces\/auto\/occasion\/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html","urlDE":"https:\/\/de.telepecas.com\/ankundigung\/teile\/auto\/gebraucht\/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html","urlIT":"https:\/\/it.telepecas.com\/annuncio\/parti\/auto\/usati\/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html","urlEN":"https:\/\/en.telepecas.com\/itm\/parts\/auto\/used\/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html"}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
2021-11-26T01:53:42Z
1
2812366
https://pt.telepecas.com/anuncio/pecas/auto/usadas/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html
https://es.telepecas.com/anuncio/piezas/auto/usadas/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html
https://fr.telepecas.com/annonce/pieces/auto/occasion/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html
https://de.telepecas.com/ankundigung/teile/auto/gebraucht/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html
https://it.telepecas.com/annuncio/parti/auto/usati/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html
https://en.telepecas.com/itm/parts/auto/used/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Imagens Stock
Atualização imagens de uma peça
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/stock/updateImages \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"2\", \ \"images\" : [] }" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/stock/deleteStock \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"2\", \ \"images\" : [] }"PHP CODE function updateStockImages($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/stock/updateImages'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Endpoint: https://api.telepecas.com/stock/updateImages
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | 2 |
| images(*) | [ externalImageId (String) | urlImage (String) | isMaster (0/1) ] | [{"externalImageId": "A1", "urlImage": "https://www.test.com/images/test.png", "isMaster": "1"}, {"externalImageId": "A1", "urlImage": "https://www.test.com/images/test2.png", "isMaster": "0"}] |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"2","status":"success","timestamp":"2021-06-19T20:50:27Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: external stock ID not valid","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
2
success
2021-06-19T20:51:33Z
ERROR
900.000.005
Parameters error: external stock ID not valid
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Referências Stock
Atualização referências de uma peça
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/stock/updateReferences \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"externalId\" : \"2\", \ \"references\" : [] }" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/stock/updateReferences \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"externalId\" : \"2\", \ \"references\" : [] }"PHP CODE function updateStockReferences($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/stock/updateReferences'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Endpoint: https://api.telepecas.com/stock/updateReferences
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| externalId(*) | String | 2 |
| references | [ reference (String) | isMaster (0/1)] | [{"reference":"ABC","isMaster":"0"},{"reference":"DEF","isMaster":"1"}] |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"id":"2","status":"success","timestamp":"2021-06-19T20:56:19Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: external stock ID not valid","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
2
success
2021-06-19T20:52:50Z
ERROR
900.000.005
Parameters error: external stock ID not valid
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Vendas
Venda é a entidade que define um processo de compra de um ou mais artigos disponibilizados na loja online ou de orçamentos emitidos na plataforma TelePeças.
Inserção venda de teste (apenas disponível na versão sandbox)
Endpoint: https://api.telepecas.com/sales/createSales
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/sales/createSales \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"num\" : \"2\", \ \"type\" : \"B\", \ \"state\" : \"N\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/sales/createSales \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"num\" : \"2\", \ \"type\" : \"B\", \ \"state\" : \"N\" }"PHP CODE function insertSaleSandbox($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/sales/createSales'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para inserir registos de vendas na versão sandbox. Este endpoint é útil para poder ter registos e testar os restantes endpoints desta entidade na versão sandbox.
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| num(*) | Number | 2 |
| type(*) | Tipos vendas | B |
| state(*) | Estados vendas | N |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"status":"success","num":2,"timestamp":"2021-06-19T21:25:44Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: number of sales, type of sales, state of sales, client key is not in sandbox mode","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
ERROR
900.000.005
Parameters error: number of sales, type of sales, state of sales, client key is not in sandbox mode
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Atualização da informação de uma venda
CURL (DEVELOPER ACCOUNT) curl -X POST https://api.telepecas.com/sales/updateSales \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"token\" : \"AAAAAAAAAA\", \ \"id\" : \"2\", \ \"type\" : \"B\", \ \"state\" : \"piece broke when disassembling\"}" CURL (CLIENT CREDENTIALS) curl -X POST https://api.telepecas.com/sales/updateSales \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" \ -d "{ \"id\" : \"2\", \ \"type\" : \"B\", \ \"state\" : \"piece broke when disassembling\"}"PHP CODE function updateSale($fields){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/sales/updateSales'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer 36f9255dad680f39de6f424c4e935662c3625d8a'; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); curl_close ($ch); }
Endpoint: https://api.telepecas.com/sales/updateSales
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| id(*) | String | 2 |
| type(*) | Tipos vendas | B |
| state(*) | Estados vendas | F |
| reasonFailedSale se state for tipo "F" (*) | String | piece broke when disassembling |
| carrierName se state for tipo "D" (*) | String | FedEx |
| trackingCode se state for tipo "D" (*) | String | 23FED2343433 |
| docs | [ urlDocument (String) | type Tipos documentos venda] | [ {"urlDocument" : "https://teste.com/doc/1.pdf", "type" : "I"} ] |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"status":"success","timestamp":"2021-06-19T21:55:48Z","id":"5","type":"B"}
ERROR
{"error":{"code":"900.000.006","description":"Without permissions","message":"This key does not have permissions to perform the action. Ask the client to change the key permissions in his telepecas.com reserved area."}}
SUCCESS
success
2021-06-19T21:53:38Z
3
B
ERROR
900.000.006
Without permissions
This key does not have permissions to perform the action. Ask the client to change the key permissions in his telepecas.com reserved area.
Consulta de um registo de uma venda
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/sales/getSales?token=AAAAAAAAAAA&id=1&type=B \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/sales/getSales \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getSale($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/sales/getSales?token=AAAA&id=1&type=B'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve o registo de venda, de um dado cliente.
Endpoint: https://api.telepecas.com/sales/getSale
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| id(*) | String | 1 |
| type(*) | Tipos vendas | B |
Resposta
SUCCESS
{"status":"success","timestamp":"2021-06-19T22:02:02Z","num":1,"sales":[{"id":"5","type":"B","currency":"EUR","numProducts":"1","totalValueProducts":"123.00","totalValueShipping":"6.21","taxVATProducts":"23","taxVATShipping":"23","haveVATProducts":"1","haveVATShipping":"1","client":{"name":"Gary Swanson","countryCode":"BE","shippingAddress":"Ap #645-7815 Non Avenue","billingAddress":"Ap #645-7815 Non Avenue","postalCode":"955489 - Link\u00f6ping","vatNumber":"PT1111111","phoneNumber":"+32234187356"},"notes":"SANDBOX API TEST SALE","paymentDate":"2021-06-19 21:26:18","trackingCode":"FT2323232323","carrierName":"CTT Expressso Portugal","shippingMaxDate":"2021-06-21 21:26:18","shippingDate":"2021-06-19 21:55:48","reasonFailedSale":"","state":"D","products":[{"description":"Centralina do Motor","externalReference":"AzAQewWf","reference":"","weight":"2","width":"0","length":"0","height":"0","volume":"0","additionalReferences":"","observations":"","partName":"Centralina do Motor","vehicle":"CITRO\u00cbN C3 II (SC_) | 09 - | 2011","price":"123.00","haveVAT":"1","images":[{"urlImage":"https:\/\/en.telepecas.com\/sandbox\/images\/part3.png","urlImageThumb":"https:\/\/en.telepecas.com\/sandbox\/images\/thumbs\/part3.png"},{"urlImage":"https:\/\/en.telepecas.com\/sandbox\/images\/part3.png","urlImageThumb":"https:\/\/en.telepecas.com\/sandbox\/images\/thumbs\/part3.png"},{"urlImage":"https:\/\/en.telepecas.com\/sandbox\/images\/part7.png","urlImageThumb":"https:\/\/en.telepecas.com\/sandbox\/images\/thumbs\/part7.png"},{"urlImage":"https:\/\/en.telepecas.com\/sandbox\/images\/part8.png","urlImageThumb":"https:\/\/en.telepecas.com\/sandbox\/images\/thumbs\/part8.png"},{"urlImage":"https:\/\/en.telepecas.com\/sandbox\/images\/part5.png","urlImageThumb":"https:\/\/en.telepecas.com\/sandbox\/images\/thumbs\/part5.png"}]}],"docs":[{"urlDocument":"https:\/\/invoices.com\/invoice2.pdf","type":"O"},{"urlDocument":"https:\/\/invoices.com\/invoice1.pdf","type":"I"}]}]}
ERROR
{"error":{"code":"800.000.001","description":"No results found","message":"No results. Try change the search criteria."}}
SUCCESS
success
1
2021-06-19T21:59:38Z
5
B
1
123.00
6.21
23
23
1
1
EUR
Gary Swanson
BE
Ap #645-7815 Non Avenue
Ap #645-7815 Non Avenue
955489 - Linköping
PT1111111
+32234187356
SANDBOX API TEST SALE
2021-06-19 21:26:18
FT2323232323
CTT Expressso Portugal
2021-06-21 21:26:18
2021-06-19 21:55:48
D
Centralina do Motor
AzAQewWf
2
0
0
0
0
Centralina do Motor
CITROËN C3 II (SC_) | 09 - | 2011
123.00
1
https://en.telepecas.com/sandbox/images/part3.png
https://en.telepecas.com/sandbox/images/thumbs/part3.png
https://en.telepecas.com/sandbox/images/part3.png
https://en.telepecas.com/sandbox/images/thumbs/part3.png
https://en.telepecas.com/sandbox/images/part7.png
https://en.telepecas.com/sandbox/images/thumbs/part7.png
https://en.telepecas.com/sandbox/images/part8.png
https://en.telepecas.com/sandbox/images/thumbs/part8.png
https://en.telepecas.com/sandbox/images/part5.png
https://en.telepecas.com/sandbox/images/thumbs/part5.png
https://invoices.com/invoice2.pdf
O
https://invoices.com/invoice1.pdf
I
ERROR
800.000.001
No results found
No results. Try change the search criteria.
Consulta lista vendas
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/sales/getSales?token=AAAAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/sales/getSales \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getSales($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/sales/getSales?token=AAAA&limit=1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Este endpoint devolve uma lista de vendas, de um dado cliente.
Endpoint: https://api.telepecas.com/sales/getSales
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| limit | Number | (Default = 100) | 10 |
| offset | Number | (Default = 0) | 10 |
| type | Tipos vendas | B |
Resposta
SUCCESS
{"status":"success","timestamp":"2021-06-19T22:06:48Z","num":1,"sales":[{"id":"6","type":"B","currency":"EUR","numProducts":"1","totalValueProducts":"53.00","totalValueShipping":"10.00","taxVATProducts":"23","taxVATShipping":"23","haveVATProducts":"1","haveVATShipping":"1","client":{"name":"Gary Swanson","countryCode":"BE","shippingAddress":"Ap #645-7815 Non Avenue","billingAddress":"Ap #645-7815 Non Avenue","postalCode":"955489 - Link\u00f6ping","vatNumber":"PT1111111","phoneNumber":"+32234187356"},"notes":"SANDBOX API TEST SALE","paymentDate":"2021-06-19 21:26:18","trackingCode":"","carrierName":"","shippingMaxDate":"2021-06-21 21:26:18","shippingDate":"","reasonFailedSale":"","state":"N","products":[{"description":"Motor Elevador de Vidro Frente Esquerdo","externalReference":"5kYyxum8","reference":"","weight":"1","width":"0","length":"0","height":"0","volume":"0","additionalReferences":"","observations":"","partName":"Motor Elevador de Vidro Frente Esquerdo","vehicle":"SKODA OCTAVIA I (1U2) | 96 - 10 | 2004 | 4P","price":"53.00","haveVAT":"1","images":[{"urlImage":"https:\/\/en.telepecas.com\/sandbox\/images\/part2.png","urlImageThumb":"https:\/\/en.telepecas.com\/sandbox\/images\/thumbs\/part2.png"},{"urlImage":"https:\/\/en.telepecas.com\/sandbox\/images\/part2.png","urlImageThumb":"https:\/\/en.telepecas.com\/sandbox\/images\/thumbs\/part2.png"},{"urlImage":"https:\/\/en.telepecas.com\/sandbox\/images\/part6.png","urlImageThumb":"https:\/\/en.telepecas.com\/sandbox\/images\/thumbs\/part6.png"}]}],"docs":[]}]}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: type of sales","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
success
1
2021-06-19T22:02:43Z
6
B
1
53.00
10.00
23
23
1
1
EUR
Gary Swanson
BE
Ap #645-7815 Non Avenue
Ap #645-7815 Non Avenue
955489 - Linköping
PT1111111
+32234187356
SANDBOX API TEST SALE
2021-06-19 21:26:18
2021-06-21 21:26:18
N
Motor Elevador de Vidro Frente Esquerdo
5kYyxum8
1
0
0
0
0
Motor Elevador de Vidro Frente Esquerdo
SKODA OCTAVIA I (1U2) | 96 - 10 | 2004 | 4P
53.00
1
https://en.telepecas.com/sandbox/images/part2.png
https://en.telepecas.com/sandbox/images/thumbs/part2.png
https://en.telepecas.com/sandbox/images/part2.png
https://en.telepecas.com/sandbox/images/thumbs/part2.png
https://en.telepecas.com/sandbox/images/part6.png
https://en.telepecas.com/sandbox/images/thumbs/part6.png
ERROR
900.000.005
Parameters error: type of sales
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Webhooks
Payload
{"type": "PAYMENT"}
Payload in Hexadecimal (after getting bytes in UTF-8)
7B2274797065223A20225041594D454E54227D
Key in Hexadecimal
000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F
Initialization-Vector (Hexadecimal)
3D575574536D450F71AC76D8
Authentication-Tag (Hexadecimal)
19FDD068C6F383C173D3A906F7BD1D83
Encrypted value in Hexadecimal
F8E2F759E528CB69375E51DB2AF9B53734E393
Webhooks são HTTP callbacks que o notificam de todos os eventos para os quais se inscreveu numa entidade.
Deverá inscrever-se nos eventos disponíveis na área reservada de developer. A atribuição será feita entre a chave do cliente, tipo de evento e endpoint a ser notificado.
Um evento pode ser uma nova venda, uma nova mensagem relativa aos seus anúncios, um pedido de orçamento, uma nova reclamação, um novo pagamento...
Para seguir o standart PCI DSS só são permitidas conexões SSL usando certificados confiáveis. Certifique-se que os endpoints possuem certificados SSL válidos. Os certificados autoassinados não são válidos.
Delay: Near real-time. Clique aqui para ler o que significa.
Request timeout: Se não recebermos uma resposta ao fim de 30 segundos, a resposta será considerada inválida. Será agendado uma nova tentativa.
Retries: Em caso de falha na entrega, enviaremos uma nova notificação. Novas tentativas são enviadas em intervalos de tempo crescentes até que a mensagem seja aceita ou o período máximo de nova tentativa de 2 dias seja excedido.
Intervalos de repetição envio mensagem:
- 1 minuto
- 2 minutos
- 4 minutos
- 8 minutos
- 15 minutos
- 30 minutos
- 1 hora
- 1 dia
- 2 dias
Guarantee on message order: Não há garantia sobre a ordem das mensagens. Se enviarmos primeiro a mensagem A e depois a B, poderá receber a mensagem B primeiro e depois em A, especialmente se:
A diferença de tempo entre as mensagens é menor do que o tempo que levamos para processá-las.
O servidor ficar indisponível por um intervalo de tempo. Assim que o servidor estiver ativo novamente, as novas notificações chegarão em tempo real, as notificações antigas, no entanto, só seriam reenviadas depois de serem repetidas no ritmo especificado acima.
Nota: Tenha em atenção que esta situação pode acontecer no caso de fluxos de trabalho assíncronos quando uma notificação com estado pendente ser recebida após a notificação de status da transação final. Nesse caso, certifique-se de que, uma vez que uma notificação final rejeitada ou de status de transação bem-sucedida seja recebida, quaisquer outras atualizações de notificações para a mesma transação sejam desconsideradas.
Servidor cliente: Certifique-se de que o servidor que irá receber as notificações seja capaz de receber adequadamente os picos de carga que podem ser causados pelo processamento de transações. Exemplo: se houver um pico de processamento de transação de 30 transações / segundo, receberá cerca de 30 notificações / segundo no URL do webhook também. Recomendamos o processamento assíncrono e um cache de receptor para cenários deste tipo.
Conteúdo (Encriptação)
O conteúdo da notificação é criptografado para proteger os dados de tentativas de fraude. Ao converter a string para o formato hexadecimal, usamos UTF-8.
| Parametro | Descrição |
|---|---|
| Encryption algorithm | AES |
| Key | [secret of listener] (64-character-long hexa string in configuration) |
| Key length | 256 bits (32 bytes) |
| Block mode | GCM |
| Padding | None |
| Initialization vector | HTTP header (X-Initialization-Vector) |
| Authentication tag | HTTP header (X-Authentication-Tag) |
Formato do body: Hexadecimal
Formato do Initialization Vector: Hexadecimal
Estrutura da mensagem (JSON)
| Name | Type | Example |
|---|---|---|
| type | String | SALE |
| subtype | String | NEW_SALE |
| action | String | CREATED |
| payload | JSON | { "type":"S", "id":"4389", "numProducts":"1", "totalValueProducts":"165.29", "totalValueShipping":"26.05", "taxVATProducts":"23.00", "taxVATShipping":"23.00", "haveVATProducts":"1", "haveVATShipping":"1", "currency":"EUR", "client":{ "name":"Jose Costa", "countryCode":"PT", "shippingAddress":"Av. Lisboa n. 12", "billingAddress":"", "postalCode":"1200-000 - Lisboa", "vatNumber":"PT212855921", "phoneNumber":"+351916532252" }, "notes":"", "paymentDate":"2021-06-02 15:40:34", "trackingCode":"", "carrierName":"", "shippingMaxDate":"2021-06-03 15:44:00", "shippingDate":"", "reasonFailedSale":"", "state":"N", "products":[ { "description":"Radio CD", "externalReference":"185545", "reference":"94823339", "weight":"5", "width":"40", "length":"30", "height":"30", "volume":"0.036", "additionalReferences":"", "observations":"", "partName":"Radio CD", "vehicle":"CHEVROLET AVEO \/ KALOS Hatchback (T250, T255) | 06 - ", "price":"64.58", "haveVAT":"1", "images":[ { "urlImage":"https:\/\/cdn.telepecas.com\/auto\/parts\/images\/veiculo-pecas-fiat-bravo-i-182-95-01-telepecas-46550661.jpg", "urlImageThumb":"https:\/\/cdn.telepecas.com\/auto\/parts\/images\/veiculo-pecas-fiat-bravo-i-182-95-01-telepecas-46550661.jpg" } ] } ], "timestamp":"2021-06-02T15:44:03+01:00" } |
Novas Vendas
No momento da confirmação de uma nova venda na plataforma TelePeças será gerado uma notificação com toda a informação relativa ao cliente (dados de faturação e de envio), produtos adquiridos e resumo da venda.
Estrutura do payload (JSON)
{
"type":"SALE",
"subtype":"NEW_SALE",
"action":"CREATED",
"payload": {
"type":"S",
"id":"4389",
"clientToken":"12def4342a1211111111111",
"numProducts":"1",
"totalValueProducts":"165.29",
"totalValueShipping":"26.05",
"taxVATProducts":"23.00",
"taxVATShipping":"23.00",
"haveVATProducts":"1",
"haveVATShipping":"1",
"currency":"EUR",
"client":{
"name":"Jose Costa",
"countryCode":"PT",
"shippingAddress":"Av. Lisboa n. 12",
"billingAddress":"",
"postalCode":"1200-000 - Lisboa",
"vatNumber":"PT212855921",
"phoneNumber":"+351916532252"
},
"notes":"",
"paymentDate":"2021-06-02 15:40:34",
"trackingCode":"",
"carrierName":"",
"shippingMaxDate":"2021-06-03 15:44:00",
"shippingDate":"",
"reasonFailedSale":"",
"state":"N",
"products":[
{
"description":"Radio CD",
"externalReference":"185545",
"reference":"94823339",
"weight":"5",
"width":"40",
"length":"30",
"height":"30",
"volume":"0.036",
"additionalReferences":"",
"observations":"",
"partName":"Radio CD",
"vehicle":"CHEVROLET AVEO \/ KALOS Hatchback (T250, T255) | 06 - ",
"price":"64.58",
"haveVAT":"1",
"images":[
{
"urlImage":"https:\/\/cdn.telepecas.com\/auto\/parts\/images\/veiculo-pecas-fiat-bravo-i-182-95-01-telepecas-46550661.jpg",
"urlImageThumb":"https:\/\/cdn.telepecas.com\/auto\/parts\/images\/veiculo-pecas-fiat-bravo-i-182-95-01-telepecas-46550661.jpg"
}
]
}
],
"timestamp":"2021-06-02T15:44:03+01:00"
}
}
| Name | Type | Example |
|---|---|---|
| type | String | Tipos vendas |
| id | String | 4389 |
| clientToken | String | 12def4342a1211111111111 |
| totalValueProducts | Float | 165.29 |
| totalValueShipping | Float | 26.05 |
| taxVATProducts | Float | 23.00 |
| taxVATShipping | Float | 23.00 |
| haveVATProducts | Number (0/1) | 1 |
| haveVATShipping | Number (0/1) | 1 |
| currency | String | EUR |
| client | name (String) | countryCode Países | shippingAddress (String) | billingAddress (String) | postalCode (String) | vatNumber (String) | phoneNumber (String) | {"name":"Jose Costa", "countryCode":"PT", "shippingAddress":"Av. Lisboa n. 12", "billingAddress":"", "postalCode":"1200-000 - Lisboa", "vatNumber":"PT212855921", "phoneNumber":"+351916532252"} |
| notes | String | |
| paymentDate | Date (Format: YYYY-MM-DD HH:ii:ss) | 2021-06-02 15:40:34 |
| trackingCode | String | |
| carrierName | String | |
| shippingMaxDate | Date (Format: YYYY-MM-DD HH:ii:ss) | 2021-06-03 15:44:00 |
| shippingDate | Date (Format: YYYY-MM-DD HH:ii:ss) | |
| reasonFailedSale | String | |
| state | Estados vendas | N |
| products | [ description (String) | externalReference (String) | reference (String) | weight (Float) | width (Float) | length (Float) | height (Float) | volume (Float) | additionalReferences (String) | observations (String) | partName (String) | vehicle (String) | price (Float) | haveVAT Number (0/1) | images : [ urlImage (String) | urlImageThumb (String) ] ] | :[ { "description":"Radio CD", "externalReference":"185545", "reference":"94823339", "weight":"5", "width":"40", "length":"30", "height":"30", "volume":"0.036", "additionalReferences":"", "observations":"", "partName":"Radio CD", "vehicle":"CHEVROLET AVEO \/ KALOS Hatchback (T250, T255) | 06 - ", "price":"64.58", "haveVAT":"1", "images":[ ] } ], |
| timestamp | Date (Format: YYYY-MM-DD HH:ii:ss) | 2021-06-02T15:44:03+01:00 |
Erros
Os códigos de resultado fazem parte do JSON (resultado do campo) do corpo da resposta, contendo um código e uma descrição explicando o código.
Um código de resultado tem o formato ddd.ddd.ddd, ou seja, 3 grupos de números de 3 dígitos. Os códigos são divididos em grupos aproximados pelo primeiro número, depois em subgrupos mais detalhados pelo segundo número e, em seguida, no código exato pelo terceiro número.
Exemplo: 900.000.001
Lista de códigos de erro
| Código | Descrição do erro |
|---|---|
| 900.000.001 | Token OAuth inválido. |
| 900.000.002 | Não tem permissões de acesso à funcionalidade da API. |
| 900.000.003 | Token (chave) cliente inválido |
| 900.000.004 | Erro na autenticação |
| 900.000.005 | Parâmetros inválidos. Mais informações do erro (campos inválidos) na descrição da mensagem. |
| 900.000.006 | Sem permissões. Cliente não autorizou a chave a ter essas permissões de acesso à funcionalidade. |
| 900.000.007 | Não foi encontrado registo. |
| 900.000.008 | Excedido o limite de calls relativo à conta de developer. |
| 900.000.009 | Cliente sem serviço TelePeças. |
| 900.000.009 | Cliente sem serviço TelePeças. |
| 900.000.010 | Endpoint não disponível em modo sandbox. |
| 800.000.001 | Não foram encontrados registos de acordo com o seu critério de pesquisa. |
| 800.000.002 | Registo em processo de atualização. Aguarde uns momentos. |
Catálogos
Lista de países
Consulta da lista de países
Endpoint: https://api.telepecas.com/countries/getCountries
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/countries/getCountries?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/countries/getCountries \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getCountries($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/countries/getCountries?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os países onde é possível comprar e vender produtos na plataforma TelePeças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"countries":[{"code":"AD","description":"Andorra"},{"code":"AE","description":"United Arab Emirates"},{"code":"AG","description":"Antigua and Barbuda"}],"status":"success","timestamp":"2021-06-20T01:35:34Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
AD
AE
AG
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Lista de distritos
Consulta da lista de distritos
Endpoint: https://api.telepecas.com/districts/getDistricts
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/districts/getDistricts?countryCode=PT&token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/districts/getDistricts?countryCode=PT \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getDistricts($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/districts/getDistricts?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os distritos de um dado país onde é possível comprar e vender produtos na plataforma TelePeças.
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| countryCode(*) | Países | PT |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"districts":[{"id":"1","description":"AVEIRO"},{"id":"2","description":"BEJA"}],"status":"success","timestamp":"2021-06-20T01:43:15Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: invalid country code","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
ERROR
900.000.005
Parameters error: invalid country code
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Lista de concelhos
Consulta da lista de concelhos
Endpoint: https://api.telepecas.com/zones/getZones
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/zones/getZones?districtId=1&token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/zones/getZones?districtId=1 \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getZones($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/zones/getZones?districtId=1&token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os concelhos (zonas) de um dado país onde é possível comprar e vender produtos na plataforma TelePeças.
Argumentos de entrada
| Name | Type | Example |
|---|---|---|
| districtId(*) | Distritos | 1 |
(*) - Campos obrigatórios
Resposta
SUCCESS
{"zones":[{"id":"1","description":"AVEIRO"},{"id":"2","description":"\u00c1GUEDA"}],"status":"success","timestamp":"2021-06-20T02:00:05Z"}
ERROR
{"error":{"code":"900.000.005","description":"Parameters error: invalid district identifier","message":"Check the required parameters and the format in the documentation at api.telepecas.com\/docs"}}
SUCCESS
ERROR
900.000.005
Parameters error: invalid district identifier
Check the required parameters and the format in the documentation at api.telepecas.com/docs
Lista de línguas
Consulta da lista de línguas
Endpoint: https://api.telepecas.com/languages/getLanguages
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/languages/getLanguages?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/languages/getLanguages \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getLanguages($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/languages/getLanguages?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os códigos de língua permitidos para envio de campos de texto.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"languages":[{"code":"PT","language":"Portuguese","updated_at":"2021-04-24 16:11:28"},{"code":"ES","language":"Spanish","updated_at":"2021-04-24 16:11:28"}],"status":"success","timestamp":"2021-06-20T02:05:04Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
PT
ES
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Repositórios de stock
Consulta da lista de repositórios
Endpoint: https://api.telepecas.com/catalog/repositories/getRepositories
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/repositories/getRepositories?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/repositories/getRepositories \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getRepositories($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/repositories/getRepositories?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os repositórios onde o cliente tem stock disponível para consulta.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"repositories":[{"id":"1","description":"API"},{"id":"2","description":"telepecas.com"}],"status":"success","timestamp":"2023-01-29T14:16:11Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Combustíveis
Consulta do catálogo de combustíveis
Endpoint: https://api.telepecas.com/catalog/fuels/getFuels
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/fuels/getFuels?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/fuels/getFuels \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getFuels($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/fuels/getFuels?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os combustíveis disponíveis.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"fuels":[{"id":"1","description":"Gasoline","updated_at":"2021-04-19 23:49:02"}],"status":"success","timestamp":"2021-06-20T02:28:15Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Tipos de veículo
Consulta do catálogo de tipo de veículos
Endpoint: https://api.telepecas.com/catalog/vehicleTypes/getVehicleTypes
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/vehicleTypes/getVehicleTypes?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/vehicleTypes/getVehicleTypes \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getVehicleTypes($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/vehicleTypes/getVehicleTypes?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os tipos de veículo permitidos para introdução de peças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"vehicleTypes":[{"id":"1","description":"Car","updated_at":"2021-04-18 01:57:18"},{"id":"2","description":"Van","updated_at":"2021-04-18 01:57:18"},{"id":"3","description":"Motorcycle","updated_at":"2021-04-18 01:57:18"}],"status":"success","timestamp":"2021-06-20T02:09:43Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Grupos de peças
Consulta do catálogo de grupos de peças
Endpoint: https://api.telepecas.com/catalog/partGroups/getPartGroups
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/partGroups/getPartGroups?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/partGroups/getPartGroups \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getPartGroups($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/partGroups/getPartGroups?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os grupos de peças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"partGroups":[{"id":"1","description":"Front doors","updated_at":"2021-04-18 20:59:05"},{"id":"2","description":"Rearview mirror","updated_at":"2021-04-18 20:59:05"}],"status":"success","timestamp":"2021-06-20T02:13:19Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Localizações Peças
Consulta do catálogo de localizações de peças
Endpoint: https://api.telepecas.com/catalog/partLocals/getPartLocals
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/partLocals/getPartLocals?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/partLocals/getPartLocals \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getPartLocals($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/partLocals/getPartLocals?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todas as localizações de peças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"partLocals":[{"id":"1","description":"Front","updated_at":"2021-04-18 21:14:13"},{"id":"2","description":"Right side","updated_at":"2021-04-18 21:14:13"}],"status":"success","timestamp":"2021-06-20T02:17:40Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Lados peças
Consulta do catálogo dos lados de peças
Endpoint: https://api.telepecas.com/catalog/partSides/getPartSides
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/partSides/getPartSides?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/partSides/getPartSides \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getPartSides($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/partSides/getPartSides?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os lados de peças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"partSides":[{"id":"1","description":"Left","updated_at":"2021-04-18 21:04:01"},{"id":"2","description":"Right","updated_at":"2021-04-18 21:04:01"}],"status":"success","timestamp":"2021-06-20T02:20:33Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Lados dimensões peças
Consulta do catálogo das dimensões de peças
Endpoint: https://api.telepecas.com/catalog/partSidesDimensions/getPartSidesDimensions
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/partSidesDimensions/getPartSidesDimensions?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/partSidesDimensions/getPartSidesDimensions \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getPartSidesDimensions($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/partSidesDimensions/getPartSidesDimensions?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todas as dimensões dos lados de peças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"partSidesDimensions":[{"id":"1","description":"Front","updated_at":"2021-04-18 21:07:47"},{"id":"2","description":"Back","updated_at":"2021-04-18 21:07:47"},{"id":"3","description":"Middle (interior)","updated_at":"2021-04-18 21:07:47"},{"id":"4","description":"Middle (chassis)","updated_at":"2021-04-18 21:07:47"}],"status":"success","timestamp":"2021-06-20T02:24:26Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Tipos de peças
Consulta do catálogo de tipo de peças
Endpoint: https://api.telepecas.com/catalog/partTypes/getPartTypes
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/partTypes/getPartTypes?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/partTypes/getPartTypes \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getPartTypes($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/partTypes/getPartTypes?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os tipos de peças disponíveis.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"partTypes":[{"id":"1","description":"Mechanic","updated_at":"2021-04-18 20:48:35"}],"status":"success","timestamp":"2021-06-20T02:34:23Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Estados dos produtos
Consulta do catálogo dos estados dos produtos
Endpoint: https://api.telepecas.com/catalog/stockStates/getStockStates
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/stockStates/getStockStates?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/stockStates/getStockStates \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStockStates($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/stockStates/getStockStates?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os estados dos produtos.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"stockStates":[{"code":"A","description":"AVAILABLE","updated_at":"2021-04-18 22:33:58"},{"code":"S","description":"SOLD","updated_at":"2021-04-18 22:33:58"},{"code":"R","description":"RESERVED","updated_at":"2021-04-18 22:34:11"}],"status":"success","timestamp":"2021-06-20T02:47:18Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
A
S
R
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Tipos de anúncios
Consulta do catálogo dos tipos de anúncios
Endpoint: https://api.telepecas.com/catalog/stockTypes/getStockTypes
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/stockTypes/getStockTypes?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/stockTypes/getStockTypes \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStockTypes($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/stockTypes/getStockTypes?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os tipos de anúncios que poderá criar no portal TelePeças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"stockTypes":[{"code":"P","description":"Part","updated_at":"2021-04-19 20:08:52"},{"code":"D","description":"Accident-damaged vehicle","updated_at":"2021-04-19 20:08:52"},{"code":"V","description":"Vehicle for parts","updated_at":"2021-04-19 20:08:52"},{"code":"T","description":"Tire","updated_at":"2021-04-19 20:08:52"}],"status":"success","timestamp":"2021-06-20T15:10:58Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
P
D
V
T
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Condições venda peças
Consulta do catálogo das condições de venda peças
Endpoint: https://api.telepecas.com/catalog/stockCondition/getStockCondition
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/stockCondition/getStockCondition?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/stockCondition/getStockCondition \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStockConditions($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/stockCondition/getStockCondition?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todas as condições de venda dos produtos.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"stockConditions":[{"id":"1","description":"Used","updated_at":"2021-04-20 01:29:29"}],"status":"success","timestamp":"2021-06-22T23:49:29Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Tipo de Etiquetas
Consulta dos tipos de etiquetas dos produtos
Endpoint: https://api.telepecas.com/catalog/stockLabelling/getStockLabelling
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/stockLabelling/getStockLabelling?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/stockLabelling/getStockLabelling \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStockLabelling($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/stockLabelling/getStockLabelling?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os tipos de etiquetas dos produtos.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"stockLabelling":[{"id":"1","description":"Original manufacturer label","updated_at":"2021-04-20 01:40:13"}],"status":"success","timestamp":"2021-06-22T23:45:47Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Tipo de Embalagens
Consulta dos tipos de embalagens de produtos
Endpoint: https://api.telepecas.com/catalog/stockPackaging/getStockPackaging
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/stockPackaging/getStockPackaging?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/stockPackaging/getStockPackaging \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStockPackaging($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/stockPackaging/getStockPackaging?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os tipos de embalagens dos produtos.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"stockPackaging":[{"id":"1","description":"Car Manufacturer Packaging","updated_at":"2021-04-24 23:05:53"}],"status":"success","timestamp":"2021-06-22T23:46:41Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Qualidade peças
Consulta dos graus qualidade produtos
Endpoint: https://api.telepecas.com/catalog/stockQuality/getStockQuality
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/stockQuality/getStockQuality?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/stockQuality/getStockQuality \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getStockQuality($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/stockQuality/getStockQuality?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os graus de qualidade dos produtos.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"stockQuality":[{"id":"1","description":"(1) Original (Original manufacturer)","updated_at":"2021-04-24 23:08:30"}],"status":"success","timestamp":"2021-06-22T23:41:44Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Tipos Documentos Vendas
Consulta dos tipos de documentos venda
Endpoint: https://api.telepecas.com/catalog/salesDocumentTypes/getSalesDocumentTypes
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/salesDocumentTypes/getSalesDocumentTypes?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/salesDocumentTypes/getSalesDocumentTypes \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getSalesDocumentTypes($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/salesDocumentTypes/getSalesDocumentTypes?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os os tipos de documentos que pode anexar na expedição das peças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"docTypes":[{"code":"P","description":"PROOF OF PAYMENT","updated_at":"2021-04-18 22:33:58"},{"code":"I","description":"INVOICE","updated_at":"2021-04-18 22:33:58"},{"code":"C","description":"CREDIT NOTE","updated_at":"2021-04-18 22:34:11"},{"code":"D","description":"DISPATCH IMAGE","updated_at":"2021-04-18 22:34:11"},{"code":"O","description":"OTHER","updated_at":"2021-04-18 22:34:11"}],"status":"success","timestamp":"2021-07-04T01:48:49Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
P
I
C
D
O
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Estados vendas
Consulta dos estados vendas
Endpoint: https://api.telepecas.com/catalog/salesStates/getSalesStates
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/salesStates/getSalesStates?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/salesStates/getSalesStates \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getSalesStates($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/salesStates/getSalesStates?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os estados das vendas.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"states":[{"code":"A","description":"ALL","updated_at":"2021-04-18 22:33:58"},{"code":"N","description":"NEW","updated_at":"2021-04-18 22:33:58"},{"code":"H","description":"HANDLED","updated_at":"2021-04-18 22:34:11"},{"code":"F","description":"FAILED SALES","updated_at":"2021-04-18 22:34:11"},{"code":"D","description":"DISPATCHED SALES","updated_at":"2021-04-18 22:34:11"}],"status":"success","timestamp":"2021-06-22T23:38:07Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
A
N
H
F
D
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Tipos Vendas
Consulta dos tipos de vendas
Endpoint: https://api.telepecas.com/catalog/salesTypes/getSalesTypes
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/salesTypes/getSalesTypes?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/salesTypes/getSalesTypes \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getSalesTypes($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/salesTypes/getSalesTypes?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os tipos das vendas.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"types":[{"code":"S","description":"SHOP","updated_at":"2021-04-18 22:33:58"},{"code":"B","description":"BUDGET","updated_at":"2021-04-18 22:33:58"}],"status":"success","timestamp":"2021-06-22T23:19:45Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
S
B
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Pneus - Fabricantes
Consulta do catálogo de fabricantes de pneus
Endpoint: https://api.telepecas.com/catalog/tires/manufacters/getManufacters
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/tires/manufacters/getManufacters?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/tires/manufacters/getManufacters \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getTiresManufacters($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/tires/manufacters/getManufacters?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os fabricantes de pneus disponíveis no portal TelePeças.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"manufacters":[{"id":"4","manufacter":"Accelera","updated_at":"2021-05-01 18:08:32"},{"id":"5","manufacter":"Achilles","updated_at":"2021-05-01 18:08:32"}],"status":"success","timestamp":"2021-06-22T23:30:46Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Pneus - Estações
Consulta do catálogo de estações de pneus
Endpoint: https://api.telepecas.com/catalog/tires/seasons/getSeasons
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/tires/seasons/getSeasons?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/tires/seasons/getSeasons \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getTiresSeasons($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/tires/seasons/getSeasons?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todas as estações de pneus.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"seasons":[{"code":"S","season":"Summer tyres","updated_at":"2021-05-01 17:20:00"},{"code":"W","season":"Winter tyres","updated_at":"2021-05-01 17:20:00"}],"status":"success","timestamp":"2021-06-22T23:31:50Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
S
W
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Pneus - Índices velocidade
Consulta dos índices de velocidade de pneus
Endpoint: https://api.telepecas.com/catalog/tires/speedRatings/getSpeedRatings
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/tires/speedRatings/getSpeedRatings?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/tires/speedRatings/getSpeedRatings \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getTiresSpeedRatings($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/tires/speedRatings/getSpeedRatings?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os índices de velocidade de pneus.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"speedRatings":[{"code":"H","description":"to 130 mph (210km\/h)","updated_at":"2021-05-01 18:20:33"},{"code":"Q","description":"to 99 mph (160 km\/h)","updated_at":"2021-05-01 18:20:33"},{"code":"V","description":"to 149 mph (240 km\/h)","updated_at":"2021-05-01 18:20:44"},{"code":"W","description":"to 168 mph (270 km\/h)","updated_at":"2021-05-01 18:20:44"},{"code":"Y","description":"to 186 mph (300 km\/h)","updated_at":"2021-05-01 18:20:59"},{"code":"Zr","description":"to 150-168 mph (240-270 km\/h)","updated_at":"2021-05-01 18:20:59"}],"status":"success","timestamp":"2021-06-22T23:34:24Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
H
Q
V
W
Y
Zr
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Pneus - Tipos Carros
Consulta dos tipos de carros (classificação para pneus)
Endpoint: https://api.telepecas.com/catalog/tires/typeCars/getTypeCars
CURL (DEVELOPER ACCOUNT) curl -X GET https://api.telepecas.com/catalog/tires/typeCars/getTypeCars?token=AAAAAAAAA \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}" CURL (CLIENT CREDENTIALS) curl -X GET https://api.telepecas.com/catalog/tires/typeCars/getTypeCars \ -H "Accept: application/json" \ -H "Authorization: Bearer {token}"PHP CODE function getTiresTypesCar($authToken){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.telepecas.com/catalog/tires/typeCars/getTypeCars?token=AAAA'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$authToken; $headers[] = 'Output-Type: application/json'; //(Response - JSON) //$headers[] = 'Output-Type: text/xml'; //(Response - XML) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); curl_close ($ch); }
Poderá usar este endpoint para consultar todos os os tipos de carros para classificação de pneus.
Argumentos de entrada
Não é necessário definir argumentos.
Resposta
SUCCESS
{"typeCars":[{"code":"C","description":"Car","updated_at":"2021-05-24 15:14:10"},{"code":"S","description":"Off-Road\/4x4\/SUV","updated_at":"2021-05-24 15:14:10"},{"code":"T","description":"Light truck","updated_at":"2021-05-24 15:14:10"},{"code":"M","description":"Moto","updated_at":"2021-05-24 15:14:10"}],"status":"success","timestamp":"2021-06-22T23:37:15Z"}
ERROR
{"error":{"code":"900.000.003","description":"Account error","message":"You must indicate a valid client token. Consult the documentation for more information."}}
SUCCESS
C
S
T
M
ERROR
900.000.003
Account error
You must indicate a valid client token. Consult the documentation for more information.
Parceiros
Esta secção é exclusiva a parceiros TelePeças. Trata-se de um conjunto de funções solicitadas para otimizar processos.
Para o desenvolvimento de alguma funcionalidade adicional desta API, abra um ticket de suporte para podermos analisar o seu pedido.
