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.


Em caso de dúvida clique aqui e abra um ticket de suporte.

Autenticação

AUTH REQUEST

CURL
    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

<telepecas> <status>success</status> <timestamp>2021-11-29T13:17:56Z</timestamp> <name>Hugo</name> <username>hmrod</username> <email>hugorodrigues@telepecas.com</email> <website>https://en.telepecas.com</website> <facebook>facebook.com/telepecas</facebook> <twitter>twitter.com/telepeca</twitter> <github>github.com/telepecas</github> <instagram>instagram.com/telepecas</instagram> <address/> <country>Portugal</country> <periodEnd>2021-12-13 18:35:32</periodEnd> <maxClients>3</maxClients> <noActiveClients>2</noActiveClients> <noKeysTotal>1</noKeysTotal> <noKeysActive>1</noKeysActive> <production> <noClients>2</noClients> <noStock>2</noStock> <noCalls>23</noCalls> <noCallsMax>10000</noCallsMax> <noInsertOps>0</noInsertOps> <noInsertOpsMax>1000</noInsertOpsMax> <noSearchOps>0</noSearchOps> <noSearchOpsMax>1000</noSearchOpsMax> <noUpdatesOps>0</noUpdatesOps> <noUpdatesOpsMax>2000</noUpdatesOpsMax> <noStatsOps>0</noStatsOps> <noStatsOpsMax>100</noStatsOpsMax> <noSearchMarketingOps>0</noSearchMarketingOps> <noSearchMarketingOpsMax>50</noSearchMarketingOpsMax> <noInsertMarketingOps>0</noInsertMarketingOps> <noInsertMarketingOpsMax>10</noInsertMarketingOpsMax> </production> <production> <noClients>1</noClients> <noStock>0</noStock> <noCalls>2</noCalls> <noInsertOps>0</noInsertOps> <noSearchOps>0</noSearchOps> <noUpdatesOps>0</noUpdatesOps> <noStatsOps>0</noStatsOps> <noSearchMarketingOps>0</noSearchMarketingOps> <noInsertMarketingOps>0</noInsertMarketingOps> </production> <keys> <key> <name>Telepeças - Hugo Rodrigues</name> <address>Morada 1</address> <location>Braga</location> <postalCode>4710-312 - Braga</postalCode> <vatNumber>12807754114</vatNumber> <email>hugorodrigues@telepecas.com</email> <phone>+351910000000</phone> <publicKey>e2413eba26e29db888fd21900c0bc939</publicKey> <sandbox>1</sandbox> <state>A</state> <updateAccountConfigs>1</updateAccountConfigs> <readWarehouses>1</readWarehouses> <updateWarehouses>1</updateWarehouses> <readShippingConfigs>1</readShippingConfigs> <updateShippingConfigs>1</updateShippingConfigs> <readCatalogs>1</readCatalogs> <updateCatalogs>1</updateCatalogs> <readStock>1</readStock> <changeStock>1</changeStock> <readSales>1</readSales> <updateSales>1</updateSales> <postSaleModule>1</postSaleModule> <statsModule>1</statsModule> <marketingModule>1</marketingModule> </key> </keys> </telepecas>

ERROR

<telepecas> <error> <code>900.000.002</code> <description>You do not have permissions to access API functionality.</description> <message>Check the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <id>4</id> <status>success</status> <timestamp>2021-06-07T20:47:02Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <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</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-09T14:46:52Z</timestamp> <warehouses> <warehouse> <id>1</id> <externalId>A1</externalId> <description>Armazém de Lisboaa</description> <address>Rua de testes, nº23</address> <latitude>38.7437395</latitude> <longitude>-9.2302433</longitude> <countryCode>PT</countryCode> <districtId>11</districtId> <zoneId>150</zoneId> <postalCode1>1201</postalCode1> <postalCode2>001</postalCode2> <localDescription>Lisboaa</localDescription> </warehouse> </warehouses> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-09T14:49:43Z</timestamp> <warehouses> <warehouse> <id>1</id> <externalId>A1</externalId> <description>Armazém de Lisboaa</description> <address>Rua de testes, nº23</address> <latitude>38.7437395</latitude> <longitude>-9.2302433</longitude> <countryCode>PT</countryCode> <districtId>11</districtId> <zoneId>150</zoneId> <postalCode1>1201</postalCode1> <postalCode2>001</postalCode2> <localDescription>Lisboa</localDescription> </warehouse> <warehouse> <id>2</id> <externalId>A2</externalId> <description>Armazém de Porto</description> <address>Rua de testes, nº1</address> <latitude>38.7437395</latitude> <longitude>-9.2302433</longitude> <countryCode>PT</countryCode> <districtId>11</districtId> <zoneId>149</zoneId> <postalCode1>4000</postalCode1> <postalCode2>001</postalCode2> <localDescription>Porto</localDescription> </warehouse> </warehouses> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <id>3</id> <status>success</status> <timestamp>2021-06-11T10:34:25Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: make description</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <id>3</id> <status>success</status> <timestamp>2021-06-11T10:39:21Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.007</code> <description>No record found in client database</description> <message>No results. Try change the external identifier.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-11T11:55:39Z</timestamp> <makes> <make> <id>1</id> <externalId>1</externalId> <description>Opel</description> <telepecasId>0</telepecasId> <ktype>0</ktype> <status>ACTIVE</status> <updated_at>2021-04-18 14:41:06</updated_at> </make> </makes> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <makes> <make> <id>1</id> <externalId>1</externalId> <description>Opel</description> <telepecasId>0</telepecasId> <ktype>0</ktype> <status>ACTIVE</status> <updated_at>2021-04-18 14:41:06</updated_at> </make> <make> <id>2</id> <externalId>2</externalId> <description>Audi</description> <telepecasId>0</telepecasId> <ktype>0</ktype> <status>ACTIVE</status> <updated_at>2021-04-18 14:31:08</updated_at> </make> </makes> <status>success</status> <timestamp>2021-06-11T11:53:57Z</timestamp> <count>2</count> <limit>10</limit> <offset>0</offset> <pages>1</pages> <lastPage/> <nextPage/> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <id>2</id> <status>success</status> <timestamp>2021-06-11T12:46:44Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: model description</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <id>1</id> <status>success</status> <timestamp>2021-06-11T12:51:34Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.007</code> <description>No record found in client database</description> <message>No results. Try change the external identifier.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-11T12:58:38Z</timestamp> <models> <model> <id>1</id> <externalId>1</externalId> <externalMakeId>1</externalMakeId> <description>Corsa A</description> <makeDescription>Opel</makeDescription> <fullDescription>Opel Corsa A</fullDescription> <telepecasId>0</telepecasId> <ktype>0</ktype> <tecDocModelId>0</tecDocModelId> <initYear>1980</initYear> <endYear>1992</endYear> <vehicleType>1</vehicleType> <status>ACTIVE</status> <updated_at>2021-06-11 12:53:11</updated_at> </model> </models> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <models> <model> <id>1</id> <externalId>1</externalId> <description>Corsa A</description> <externalMakeId>1</externalMakeId> <makeDescription>Opel</makeDescription> <fullDescription>Opel Corsa A</fullDescription> <telepecasId>0</telepecasId> <ktype>0</ktype> <tecDocModelId>0</tecDocModelId> <initYear>1980</initYear> <endYear>1992</endYear> <vehicleType>1</vehicleType> <status>ACTIVE</status> <updated_at>2021-06-11 12:53:11</updated_at> </model> <model> <id>3</id> <externalId>3</externalId> <description>Corsa C</description> <externalMakeId>1</externalMakeId> <makeDescription>Opel</makeDescription> <fullDescription>Opel Corsa C</fullDescription> <telepecasId>12</telepecasId> <ktype>2323</ktype> <tecDocModelId>1</tecDocModelId> <initYear>112</initYear> <endYear>2323</endYear> <vehicleType>1</vehicleType> <status>ACTIVE</status> <updated_at>2021-05-25 01:19:43</updated_at> </model> </models> <status>success</status> <timestamp>2021-06-11T14:08:22Z</timestamp> <count>2</count> <limit>10</limit> <offset>0</offset> <pages>1</pages> <lastPage/> <nextPage/> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <id>1</id> <status>success</status> <timestamp>2021-06-14T14:11:19Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: part description</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <id>1</id> <status>success</status> <timestamp>2021-06-14T14:18:20Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.007</code> <description>No record found in client database</description> <message>No results. Try change the external identifier.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-14T14:23:49Z</timestamp> <parts> <part> <id>1</id> <externalId>1</externalId> <partTypeId>0</partTypeId> <partTypeDescription/> <localId>0</localId> <localDescription/> <groupId>0</groupId> <groupDescription/> <sideId>0</sideId> <sideDescription/> <sideDimensionId>0</sideDimensionId> <sideDimensionDescription/> <isTools>0</isTools> <weight>10</weight> <dimLength>5</dimLength> <dimWidth>6</dimWidth> <dimHeight>4</dimHeight> <volume>0.0100</volume> <partDescriptionPT>Comando da soufagem PT</partDescriptionPT> <partDescriptionES>Comando da soufagem ES</partDescriptionES> <partDescriptionFR>Comando da soufagem FR</partDescriptionFR> <partDescriptionEN>Comando da soufagem EN</partDescriptionEN> <partDescriptionIT>Comando da soufagem IT</partDescriptionIT> <partDescriptionDE>Comando da soufagem DE</partDescriptionDE> <partFixedObsPT>descrição fixo PT</partFixedObsPT> <partFixedObsES>descrição fixo ES</partFixedObsES> <partFixedObsEN>descrição fixo EN</partFixedObsEN> <partFixedObsFR>descrição fixo FR</partFixedObsFR> <partFixedObsIT>descrição fixo IT</partFixedObsIT> <partFixedObsDE>descrição fixo DE</partFixedObsDE> <status>ACTIVE</status> <updated_at>2021-06-14 14:18:20</updated_at> </part> </parts> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <parts> <part> <id>1</id> <externalId>1</externalId> <partTypeId>0</partTypeId> <partTypeDescription/> <localId>0</localId> <localDescription/> <groupId>0</groupId> <groupDescription/> <sideId>0</sideId> <sideDescription/> <sideDimensionId>0</sideDimensionId> <sideDimensionDescription/> <isTools>0</isTools> <weight>10</weight> <dimLength>5</dimLength> <dimWidth>6</dimWidth> <dimHeight>4</dimHeight> <volume>0.0100</volume> <partDescriptionPT>Comando da soufagem PT1</partDescriptionPT> <partDescriptionES>Comando da soufagem ES1</partDescriptionES> <partDescriptionFR>Comando da soufagem FR1</partDescriptionFR> <partDescriptionEN>Comando da soufagem EN1</partDescriptionEN> <partDescriptionIT>Comando da soufagem IT1</partDescriptionIT> <partDescriptionDE>Comando da soufagem DE1</partDescriptionDE> <partFixedObsPT>descrição fixo PT</partFixedObsPT> <partFixedObsES>descrição fixo ES</partFixedObsES> <partFixedObsEN>descrição fixo EN</partFixedObsEN> <partFixedObsFR>descrição fixo FR</partFixedObsFR> <partFixedObsIT>descrição fixo IT</partFixedObsIT> <partFixedObsDE>descrição fixo DE</partFixedObsDE> <status>ACTIVE</status> <updated_at>2021-06-14 14:18:20</updated_at> </part> <part> <id>2</id> <externalId>2</externalId> <partTypeId>0</partTypeId> <partTypeDescription/> <localId>0</localId> <localDescription/> <groupId>0</groupId> <groupDescription/> <sideId>0</sideId> <sideDescription/> <sideDimensionId>0</sideDimensionId> <sideDimensionDescription/> <isTools>0</isTools> <weight>8</weight> <dimLength>3</dimLength> <dimWidth>3</dimWidth> <dimHeight>3</dimHeight> <volume>0.0100</volume> <partDescriptionPT>Caixa de velocidades PT</partDescriptionPT> <partDescriptionES>Caixa de velocidades ES</partDescriptionES> <partDescriptionFR>Caixa de velocidades FR</partDescriptionFR> <partDescriptionEN>Caixa de velocidades EN</partDescriptionEN> <partDescriptionIT>Caixa de velocidades IT</partDescriptionIT> <partDescriptionDE>Caixa de velocidades DE</partDescriptionDE> <partFixedObsPT>desc PT</partFixedObsPT> <partFixedObsES>desc ES</partFixedObsES> <partFixedObsEN>desc EN</partFixedObsEN> <partFixedObsFR>desc FR</partFixedObsFR> <partFixedObsIT>desc IT</partFixedObsIT> <partFixedObsDE>desc DE</partFixedObsDE> <status>ACTIVE</status> <updated_at>2021-04-19 00:11:40</updated_at> </part> <part> <id>3</id> <externalId>15</externalId> <partTypeId>0</partTypeId> <partTypeDescription/> <localId>0</localId> <localDescription/> <groupId>12</groupId> <groupDescription>Front Window Mechanism</groupDescription> <sideId>1</sideId> <sideDescription/> <sideDimensionId>1</sideDimensionId> <sideDimensionDescription>Front</sideDimensionDescription> <isTools>0</isTools> <weight>0</weight> <dimLength>0</dimLength> <dimWidth>0</dimWidth> <dimHeight>0</dimHeight> <volume>0.0000</volume> <partDescriptionPT>Comando da soufagem PT1</partDescriptionPT> <partDescriptionES>Comando da soufagem ES1</partDescriptionES> <partDescriptionFR>Comando da soufagem FR1</partDescriptionFR> <partDescriptionEN>Comando da soufagem EN1</partDescriptionEN> <partDescriptionIT>Comando da soufagem IT1</partDescriptionIT> <partDescriptionDE>Comando da soufagem DE1</partDescriptionDE> <partFixedObsPT>descrição fixo PT</partFixedObsPT> <partFixedObsES>descrição fixo ES</partFixedObsES> <partFixedObsEN>descrição fixo EN</partFixedObsEN> <partFixedObsFR>descrição fixo FR</partFixedObsFR> <partFixedObsIT>descrição fixo IT</partFixedObsIT> <partFixedObsDE>descrição fixo DE</partFixedObsDE> <status>ACTIVE</status> <updated_at>2021-05-25 01:19:43</updated_at> </part> </parts> <status>success</status> <timestamp>2021-06-14T15:00:10Z</timestamp> <count>3</count> <limit>10</limit> <offset>0</offset> <pages>1</pages> <lastPage/> <nextPage/> </telepecas>

ERROR

<telepecas> <parts/> <status>success</status> <timestamp>2021-06-14T14:58:44Z</timestamp> <count>3</count> <limit>10</limit> <offset>10</offset> <pages>1</pages> <lastPage>https://api.telepecas.com/catalog/parts/getParts?token=5da99f00e75c2beb51bf1d43db432188&limit=10&offset=0</lastPage> <nextPage/> </telepecas>

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

<telepecas> <id>3</id> <status>success</status> <timestamp>2021-06-16T21:39:24Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: external stock ID</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <id>1</id> <status>success</status> <timestamp>2021-06-14T14:18:20Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.007</code> <description>No record found in client database</description> <message>No results. Try change the external identifier.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-18T17:15:42Z</timestamp> <stocks> <stock> <id>1</id> <externalId>1</externalId> <externalReference>STOCK434232</externalReference> <compatibleCarModels> <carModel> <id>4</id> <externalId>10</externalId> <externalMakeId>1</externalMakeId> <description>Corsa D</description> <makeDescription>Opel</makeDescription> <fullDescription>Opel Corsa D</fullDescription> <telepecasId>12</telepecasId> <ktype>2323</ktype> <tecDocModelId>1</tecDocModelId> <initYear>112</initYear> <endYear>2323</endYear> <vehicleType>1</vehicleType> </carModel> </compatibleCarModels> <dataOEM> <OEM> <makeOEM>Bosch</makeOEM> <refOEM>12232323</refOEM> <priceOEM>12.12</priceOEM> <description>Referência original</description> </OEM> </dataOEM> <tags> <tag> <description>T1</description> <position>0</position> </tag> </tags> <images> <image> <externalImageId>23232</externalImageId> <urlImage>https://pt.telepecas.com/imagemOk.png</urlImage> <urlImageThumbnail/> <isMaster>1</isMaster> <pos>0</pos> </image> <image> <externalImageId>23233</externalImageId> <urlImage>https://pt.telepecas.com/imagemOk2.png</urlImage> <urlImageThumbnail>https://pt.telepecas.com/imagemOk2Thumb.png</urlImageThumbnail> <isMaster>0</isMaster> <pos>0</pos> </image> </images> <engine> <engineInfo>Motor AAA</engineInfo> <engineCode>Motor AAA</engineCode> <tecDocEngineId>0</tecDocEngineId> </engine> <stockType>P</stockType> <partInfo> <id>3</id> <externalId>15</externalId> <partTypeId>0</partTypeId> <partTypeDescription/> <localId>0</localId> <localDescription/> <groupId>12</groupId> <groupDescription>Front Window Mechanism</groupDescription> <sideId>1</sideId> <sideDescription/> <sideDimensionId>1</sideDimensionId> <sideDimensionDescription>Front</sideDimensionDescription> <isTools>0</isTools> <weight>0</weight> <dimLength>0</dimLength> <dimWidth>0</dimWidth> <dimHeight>0</dimHeight> <volume>0.0000</volume> <partDescriptionPT>Comando da soufagem PT1</partDescriptionPT> <partDescriptionES>Comando da soufagem ES1</partDescriptionES> <partDescriptionFR>Comando da soufagem FR1</partDescriptionFR> <partDescriptionEN>Comando da soufagem EN1</partDescriptionEN> <partDescriptionIT>Comando da soufagem IT1</partDescriptionIT> <partDescriptionDE>Comando da soufagem DE1</partDescriptionDE> <partFixedObsPT>descrição fixo PT</partFixedObsPT> <partFixedObsES>descrição fixo ES</partFixedObsES> <partFixedObsEN>descrição fixo EN</partFixedObsEN> <partFixedObsFR>descrição fixo FR</partFixedObsFR> <partFixedObsIT>descrição fixo IT</partFixedObsIT> <partFixedObsDE>descrição fixo DE</partFixedObsDE> <status>ACTIVE</status> </partInfo> <vehicleInfo> <id>4</id> <externalId>10</externalId> <externalMakeId>1</externalMakeId> <description>Corsa D</description> <makeDescription>Opel</makeDescription> <fullDescription>Opel Corsa D</fullDescription> <telepecasId>12</telepecasId> <ktype>2323</ktype> <tecDocModelId>1</tecDocModelId> <initYear>112</initYear> <endYear>2323</endYear> <vehicleType>1</vehicleType> <externalOriginVehicleReference/> <fuelId>0</fuelId> <doorsNumber>0</doorsNumber> <vin/> <kms/> <registryDate/> <drivetrain/> <transmission/> <brakeSystem/> <engineType/> <constructionType/> <brakeType/> <catalystType/> <noCylinders/> <noValves/> </vehicleInfo> <dataTire> <seasonId/> <width/> <height/> <diameter/> <manufacterId/> <speedRating/> <typeCar/> </dataTire> <observations>Isto é um campo de observações da peça...</observations> <price1>120.00</price1> <price2>100.00</price2> <vatIncluded>0</vatIncluded> <price1StockOff>0.00</price1StockOff> <price2StockOff>0.00</price2StockOff> <initDateStockOff>0000-00-00 00:00:00</initDateStockOff> <endDateStockOff>0000-00-00 00:00:00</endDateStockOff> <pinStock>0</pinStock> <state>A</state> <references/> <warehouseId/> <rating>5</rating> <stateConditionStock>1</stateConditionStock> <quality>1</quality> <packaging>1</packaging> <labelling>1</labelling> <updated_at>2021-06-19 20:18:04</updated_at> </stock> </stocks> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-19T20:24:46Z</timestamp> <stocks> <stock> <id>1</id> <externalId>1</externalId> <externalReference>STOCK434232</externalReference> <compatibleCarModels> <carModel> <id>4</id> <externalId>10</externalId> <externalMakeId>1</externalMakeId> <description>Corsa D</description> <makeDescription>Opel</makeDescription> <fullDescription>Opel Corsa D</fullDescription> <telepecasId>12</telepecasId> <ktype>2323</ktype> <tecDocModelId>1</tecDocModelId> <initYear>112</initYear> <endYear>2323</endYear> <vehicleType>1</vehicleType> </carModel> </compatibleCarModels> <dataOEM> <OEM> <makeOEM>Bosch</makeOEM> <refOEM>12232323</refOEM> <priceOEM>12.12</priceOEM> <description>Referência original</description> </OEM> </dataOEM> <tags> <tag> <description>T1</description> <position>0</position> </tag> </tags> <images> <image> <externalImageId>23232</externalImageId> <urlImage>https://pt.telepecas.com/imagemOk.png</urlImage> <urlImageThumbnail/> <isMaster>1</isMaster> <pos>0</pos> </image> <image> <externalImageId>23233</externalImageId> <urlImage>https://pt.telepecas.com/imagemOk2.png</urlImage> <urlImageThumbnail>https://pt.telepecas.com/imagemOk2Thumb.png</urlImageThumbnail> <isMaster>0</isMaster> <pos>0</pos> </image> </images> <engine> <engineInfo>Motor AAA</engineInfo> <engineCode>Motor AAA</engineCode> <tecDocEngineId>0</tecDocEngineId> </engine> <stockType>P</stockType> <partInfo> <id>3</id> <externalId>15</externalId> <partTypeId>0</partTypeId> <partTypeDescription/> <localId>0</localId> <localDescription/> <groupId>12</groupId> <groupDescription>Front Window Mechanism</groupDescription> <sideId>1</sideId> <sideDescription/> <sideDimensionId>1</sideDimensionId> <sideDimensionDescription>Front</sideDimensionDescription> <isTools>0</isTools> <weight>0</weight> <dimLength>0</dimLength> <dimWidth>0</dimWidth> <dimHeight>0</dimHeight> <volume>0.0000</volume> <partDescriptionPT>Comando da soufagem PT1</partDescriptionPT> <partDescriptionES>Comando da soufagem ES1</partDescriptionES> <partDescriptionFR>Comando da soufagem FR1</partDescriptionFR> <partDescriptionEN>Comando da soufagem EN1</partDescriptionEN> <partDescriptionIT>Comando da soufagem IT1</partDescriptionIT> <partDescriptionDE>Comando da soufagem DE1</partDescriptionDE> <partFixedObsPT>descrição fixo PT</partFixedObsPT> <partFixedObsES>descrição fixo ES</partFixedObsES> <partFixedObsEN>descrição fixo EN</partFixedObsEN> <partFixedObsFR>descrição fixo FR</partFixedObsFR> <partFixedObsIT>descrição fixo IT</partFixedObsIT> <partFixedObsDE>descrição fixo DE</partFixedObsDE> <status>ACTIVE</status> </partInfo> <vehicleInfo> <id>4</id> <externalId>10</externalId> <externalMakeId>1</externalMakeId> <description>Corsa D</description> <makeDescription>Opel</makeDescription> <fullDescription>Opel Corsa D</fullDescription> <telepecasId>12</telepecasId> <ktype>2323</ktype> <tecDocModelId>1</tecDocModelId> <initYear>112</initYear> <endYear>2323</endYear> <vehicleType>1</vehicleType> <externalOriginVehicleReference/> <fuelId>0</fuelId> <doorsNumber>0</doorsNumber> <vin/> <kms/> <registryDate/> <drivetrain/> <transmission/> <brakeSystem/> <engineType/> <constructionType/> <brakeType/> <catalystType/> <noCylinders/> <noValves/> </vehicleInfo> <dataTire> <seasonId/> <width/> <height/> <diameter/> <manufacterId/> <speedRating/> <typeCar/> </dataTire> <observations>Isto é um campo de observações da peça...</observations> <price1>120.00</price1> <price2>100.00</price2> <vatIncluded>0</vatIncluded> <price1StockOff>0.00</price1StockOff> <price2StockOff>0.00</price2StockOff> <initDateStockOff>0000-00-00 00:00:00</initDateStockOff> <endDateStockOff>0000-00-00 00:00:00</endDateStockOff> <pinStock>0</pinStock> <state>A</state> <references/> <warehouseId/> <rating>5</rating> <stateConditionStock>1</stateConditionStock> <quality>1</quality> <packaging>1</packaging> <labelling>1</labelling> <updated_at>2021-06-19 20:18:04</updated_at> </stock> </stocks> <count>1</count> <limit>100</limit> <offset>0</offset> <pages>1</pages> <lastPage/> <nextPage/> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <id>2</id> <status>success</status> <timestamp>2021-06-19T20:58:44Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: external stock ID not valid</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-11-26T01:53:42Z</timestamp> <id>1</id> <externalId>2812366</externalId> <urlPT>https://pt.telepecas.com/anuncio/pecas/auto/usadas/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html</urlPT> <urlES>https://es.telepecas.com/anuncio/piezas/auto/usadas/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html</urlES> <urlFR>https://fr.telepecas.com/annonce/pieces/auto/occasion/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html</urlFR> <urlDE>https://de.telepecas.com/ankundigung/teile/auto/gebraucht/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html</urlDE> <urlIT>https://it.telepecas.com/annuncio/parti/auto/usati/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html</urlIT> <urlEN>https://en.telepecas.com/itm/parts/auto/used/amorcedor-frt-esq-bmw-320d-berlina-de-1995-ref-55555-bmw-320d-Ybd8X.html</urlEN> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <id>2</id> <status>success</status> <timestamp>2021-06-19T20:51:33Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: external stock ID not valid</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <id>2</id> <status>success</status> <timestamp>2021-06-19T20:52:50Z</timestamp> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: external stock ID not valid</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-19T21:26:18Z</timestamp> <num>2</num> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: number of sales, type of sales, state of sales, client key is not in sandbox mode</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-19T21:53:38Z</timestamp> <id>3</id> <type>B</type> </telepecas>

ERROR

<telepecas> <error> <code>900.000.006</code> <description>Without permissions</description> <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.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <num>1</num> <timestamp>2021-06-19T21:59:38Z</timestamp> <sales> <sale> <id>5</id> <type>B</type> <numProducts>1</numProducts> <totalValueProducts>123.00</totalValueProducts> <totalValueShipping>6.21</totalValueShipping> <taxVATProducts>23</taxVATProducts> <taxVATShipping>23</taxVATShipping> <haveVATProducts>1</haveVATProducts> <haveVATShipping>1</haveVATShipping> <currency>EUR</currency> <client> <name>Gary Swanson</name> <countryCode>BE</countryCode> <shippingAddress>Ap #645-7815 Non Avenue</shippingAddress> <billingAddress>Ap #645-7815 Non Avenue</billingAddress> <postalCode>955489 - Linköping</postalCode> <vatNumber>PT1111111</vatNumber> <phoneNumber>+32234187356</phoneNumber> </client> <notes>SANDBOX API TEST SALE</notes> <paymentDate>2021-06-19 21:26:18</paymentDate> <trackingCode>FT2323232323</trackingCode> <carrierName>CTT Expressso Portugal</carrierName> <shippingMaxDate>2021-06-21 21:26:18</shippingMaxDate> <shippingDate>2021-06-19 21:55:48</shippingDate> <reasonFailedSale/> <state>D</state> <products> <product> <description>Centralina do Motor</description> <externalReference>AzAQewWf</externalReference> <reference/> <weight>2</weight> <width>0</width> <length>0</length> <height>0</height> <volume>0</volume> <additionalReferences/> <observations/> <partName>Centralina do Motor</partName> <vehicle>CITROËN C3 II (SC_) | 09 - | 2011</vehicle> <price>123.00</price> <haveVAT>1</haveVAT> <images> <image> <urlImage>https://en.telepecas.com/sandbox/images/part3.png</urlImage> <urlImageThumb>https://en.telepecas.com/sandbox/images/thumbs/part3.png</urlImageThumb> </image> <image> <urlImage>https://en.telepecas.com/sandbox/images/part3.png</urlImage> <urlImageThumb>https://en.telepecas.com/sandbox/images/thumbs/part3.png</urlImageThumb> </image> <image> <urlImage>https://en.telepecas.com/sandbox/images/part7.png</urlImage> <urlImageThumb>https://en.telepecas.com/sandbox/images/thumbs/part7.png</urlImageThumb> </image> <image> <urlImage>https://en.telepecas.com/sandbox/images/part8.png</urlImage> <urlImageThumb>https://en.telepecas.com/sandbox/images/thumbs/part8.png</urlImageThumb> </image> <image> <urlImage>https://en.telepecas.com/sandbox/images/part5.png</urlImage> <urlImageThumb>https://en.telepecas.com/sandbox/images/thumbs/part5.png</urlImageThumb> </image> </images> </product> </products> <docs> <doc> <urlDocument>https://invoices.com/invoice2.pdf</urlDocument> <type>O</type> </doc> <doc> <urlDocument>https://invoices.com/invoice1.pdf</urlDocument> <type>I</type> </doc> </docs> </sale> </sales> </telepecas>

ERROR

<telepecas> <error> <code>800.000.001</code> <description>No results found</description> <message>No results. Try change the search criteria.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <num>1</num> <timestamp>2021-06-19T22:02:43Z</timestamp> <sales> <sale> <id>6</id> <type>B</type> <numProducts>1</numProducts> <totalValueProducts>53.00</totalValueProducts> <totalValueShipping>10.00</totalValueShipping> <taxVATProducts>23</taxVATProducts> <taxVATShipping>23</taxVATShipping> <haveVATProducts>1</haveVATProducts> <haveVATShipping>1</haveVATShipping> <currency>EUR</currency> <client> <name>Gary Swanson</name> <countryCode>BE</countryCode> <shippingAddress>Ap #645-7815 Non Avenue</shippingAddress> <billingAddress>Ap #645-7815 Non Avenue</billingAddress> <postalCode>955489 - Linköping</postalCode> <vatNumber>PT1111111</vatNumber> <phoneNumber>+32234187356</phoneNumber> </client> <notes>SANDBOX API TEST SALE</notes> <paymentDate>2021-06-19 21:26:18</paymentDate> <trackingCode/> <carrierName/> <shippingMaxDate>2021-06-21 21:26:18</shippingMaxDate> <shippingDate/> <reasonFailedSale/> <state>N</state> <products> <product> <description>Motor Elevador de Vidro Frente Esquerdo</description> <externalReference>5kYyxum8</externalReference> <reference/> <weight>1</weight> <width>0</width> <length>0</length> <height>0</height> <volume>0</volume> <additionalReferences/> <observations/> <partName>Motor Elevador de Vidro Frente Esquerdo</partName> <vehicle>SKODA OCTAVIA I (1U2) | 96 - 10 | 2004 | 4P</vehicle> <price>53.00</price> <haveVAT>1</haveVAT> <images> <image> <urlImage>https://en.telepecas.com/sandbox/images/part2.png</urlImage> <urlImageThumb>https://en.telepecas.com/sandbox/images/thumbs/part2.png</urlImageThumb> </image> <image> <urlImage>https://en.telepecas.com/sandbox/images/part2.png</urlImage> <urlImageThumb>https://en.telepecas.com/sandbox/images/thumbs/part2.png</urlImageThumb> </image> <image> <urlImage>https://en.telepecas.com/sandbox/images/part6.png</urlImage> <urlImageThumb>https://en.telepecas.com/sandbox/images/thumbs/part6.png</urlImageThumb> </image> </images> </product> </products> <docs/> </sale> </sales> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: type of sales</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T01:29:54Z</timestamp> <countries> <country> <code>AD</code> <description>Andorra</description> </country> <country> <code>AE</code> <description>United Arab Emirates</description> </country> <country> <code>AG</code> <description>Antigua and Barbuda</description> </country> </countries> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T01:44:42Z</timestamp> <districts> <district> <id>1</id> <description>AVEIRO</description> </district> <district> <id>2</id> <description>BEJA</description> </district> </districts> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: invalid country code</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T01:59:25Z</timestamp> <zones> <zone> <id>1</id> <description>AVEIRO</description> </zone> <zone> <id>2</id> <description>ÁGUEDA</description> </zone> </zones> </telepecas>

ERROR

<telepecas> <error> <code>900.000.005</code> <description>Parameters error: invalid district identifier</description> <message>Check the required parameters and the format in the documentation at api.telepecas.com/docs</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:05:42Z</timestamp> <languages> <language> <code>PT</code> <language>Portuguese</language> <updated_at>2021-04-24 16:11:28</updated_at> </language> <language> <code>ES</code> <language>Spanish</language> <updated_at>2021-04-24 16:11:28</updated_at> </language> </languages> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2023-01-29T14:25:56Z</timestamp> <repositories> <repository> <id>1</id> <description>API</description> </repository> <repository> <id>2</id> <description>telepecas.com</description> </repository> </repositories> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:28:38Z</timestamp> <fuels> <fuel> <id>1</id> <description>Gasoline</description> <updated_at>2021-04-19 23:49:02</updated_at> </fuel> <fuel> <id>2</id> <description>Diesel</description> <updated_at>2021-04-19 23:49:08</updated_at> </fuel> <fuel> <id>3</id> <description>Electric</description> <updated_at>2021-04-19 23:49:14</updated_at> </fuel> <fuel> <id>4</id> <description>Hybrid</description> <updated_at>2021-04-19 23:49:22</updated_at> </fuel> </fuels> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:09:07Z</timestamp> <vehicleTypes> <vehicleType> <id>1</id> <description>Car</description> <updated_at>2021-04-18 01:57:18</updated_at> </vehicleType> <vehicleType> <id>2</id> <description>Van</description> <updated_at>2021-04-18 01:57:18</updated_at> </vehicleType> <vehicleType> <id>3</id> <description>Motorcycle</description> <updated_at>2021-04-18 01:57:18</updated_at> </vehicleType> </vehicleTypes> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:13:48Z</timestamp> <partGroups> <partGroup> <id>1</id> <description>Front doors</description> <updated_at>2021-04-18 20:59:05</updated_at> </partGroup> <partGroup> <id>2</id> <description>Rearview mirror</description> <updated_at>2021-04-18 20:59:05</updated_at> </partGroup> </partGroups> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:16:53Z</timestamp> <partLocals> <partLocal> <id>1</id> <description>Front</description> <updated_at>2021-04-18 21:14:13</updated_at> </partLocal> <partLocal> <id>2</id> <description>Right side </description> <updated_at>2021-04-18 21:14:13</updated_at> </partLocal> </partLocals> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:20:59Z</timestamp> <partSides> <partSide> <id>1</id> <description>Left</description> <updated_at>2021-04-18 21:04:01</updated_at> </partSide> <partSide> <id>2</id> <description>Right</description> <updated_at>2021-04-18 21:04:01</updated_at> </partSide> </partSides> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:23:52Z</timestamp> <partSidesDimensions> <partSidesDimension> <id>1</id> <description>Front</description> <updated_at>2021-04-18 21:07:47</updated_at> </partSidesDimension> <partSidesDimension> <id>2</id> <description>Back</description> <updated_at>2021-04-18 21:07:47</updated_at> </partSidesDimension> <partSidesDimension> <id>3</id> <description>Middle (interior)</description> <updated_at>2021-04-18 21:07:47</updated_at> </partSidesDimension> <partSidesDimension> <id>4</id> <description>Middle (chassis)</description> <updated_at>2021-04-18 21:07:47</updated_at> </partSidesDimension> </partSidesDimensions> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:33:52Z</timestamp> <partTypes> <partType> <id>1</id> <description>Mechanic</description> <updated_at>2021-04-18 20:48:35</updated_at> </partType> </partTypes> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T02:49:04Z</timestamp> <stockStates> <stockState> <code>A</code> <description>AVAILABLE</description> <updated_at>2021-04-18 22:33:58</updated_at> </stockState> <stockState> <code>S</code> <description>SOLD</description> <updated_at>2021-04-18 22:33:58</updated_at> </stockState> <stockState> <code>R</code> <description>RESERVED</description> <updated_at>2021-04-18 22:34:11</updated_at> </stockState> </stockStates> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-20T15:10:08Z</timestamp> <stockTypes> <stockType> <code>P</code> <description>Part</description> <updated_at>2021-04-19 20:08:52</updated_at> </stockType> <stockType> <code>D</code> <description>Accident-damaged vehicle</description> <updated_at>2021-04-19 20:08:52</updated_at> </stockType> <stockType> <code>V</code> <description>Vehicle for parts</description> <updated_at>2021-04-19 20:08:52</updated_at> </stockType> <stockType> <code>T</code> <description>Tire</description> <updated_at>2021-04-19 20:08:52</updated_at> </stockType> </stockTypes> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:48:58Z</timestamp> <stockConditions> <stockCondition> <id>1</id> <description>Used</description> <updated_at>2021-04-20 01:29:29</updated_at> </stockCondition> </stockConditions> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:45:00Z</timestamp> <stockLabelling> <labelling> <id>5</id> <description>Without label</description> <updated_at>2021-04-20 01:40:13</updated_at> </labelling> </stockLabelling> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:47:06Z</timestamp> <stockPackaging> <packaging> <id>1</id> <description>Car Manufacturer Packaging</description> <updated_at>2021-04-24 23:05:53</updated_at> </packaging> </stockPackaging> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:41:10Z</timestamp> <stockQuality> <quality> <id>1</id> <description>(1) Original (Original manufacturer)</description> <updated_at>2021-04-24 23:08:30</updated_at> </quality> </stockQuality> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-07-04T01:57:30Z</timestamp> <docTypes> <docType> <code>P</code> <description>PROOF OF PAYMENT</description> <updated_at>2021-04-18 22:33:58</updated_at> </docType> <docType> <code>I</code> <description>INVOICE</description> <updated_at>2021-04-18 22:33:58</updated_at> </docType> <docType> <code>C</code> <description>CREDIT NOTE</description> <updated_at>2021-04-18 22:34:11</updated_at> </docType> <docType> <code>D</code> <description>DISPATCH IMAGE</description> <updated_at>2021-04-18 22:34:11</updated_at> </docType> <docType> <code>O</code> <description>OTHER</description> <updated_at>2021-04-18 22:34:11</updated_at> </docType> </docTypes> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:39:00Z</timestamp> <states> <state> <code>A</code> <description>ALL</description> <updated_at>2021-04-18 22:33:58</updated_at> </state> <state> <code>N</code> <description>NEW</description> <updated_at>2021-04-18 22:33:58</updated_at> </state> <state> <code>H</code> <description>HANDLED</description> <updated_at>2021-04-18 22:34:11</updated_at> </state> <state> <code>F</code> <description>FAILED SALES</description> <updated_at>2021-04-18 22:34:11</updated_at> </state> <state> <code>D</code> <description>DISPATCHED SALES</description> <updated_at>2021-04-18 22:34:11</updated_at> </state> </states> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:22:33Z</timestamp> <types> <type> <code>S</code> <description>SHOP</description> <updated_at>2021-04-18 22:33:58</updated_at> </type> <type> <code>B</code> <description>BUDGET</description> <updated_at>2021-04-18 22:33:58</updated_at> </type> </types> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:29:29Z</timestamp> <tiresManufacters> <tiresManufacter> <id>4</id> <manufacter>Accelera</manufacter> <updated_at>2021-05-01 18:08:32</updated_at> </tiresManufacter> <tiresManufacter> <id>5</id> <manufacter>Achilles</manufacter> <updated_at>2021-05-01 18:08:32</updated_at> </tiresManufacter> </tiresManufacters> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:32:09Z</timestamp> <tiresSeasons> <tiresSeason> <code>S</code> <season>Summer tyres</season> <updated_at>2021-05-01 17:20:00</updated_at> </tiresSeason> <tiresSeason> <code>W</code> <season>Winter tyres</season> <updated_at>2021-05-01 17:20:00</updated_at> </tiresSeason> </tiresSeasons> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:33:09Z</timestamp> <speedRatings> <speedRating> <code>H</code> <description>to 130 mph (210km/h)</description> <updated_at>2021-05-01 18:20:33</updated_at> </speedRating> <speedRating> <code>Q</code> <description>to 99 mph (160 km/h)</description> <updated_at>2021-05-01 18:20:33</updated_at> </speedRating> <speedRating> <code>V</code> <description>to 149 mph (240 km/h)</description> <updated_at>2021-05-01 18:20:44</updated_at> </speedRating> <speedRating> <code>W</code> <description>to 168 mph (270 km/h)</description> <updated_at>2021-05-01 18:20:44</updated_at> </speedRating> <speedRating> <code>Y</code> <description>to 186 mph (300 km/h)</description> <updated_at>2021-05-01 18:20:59</updated_at> </speedRating> <speedRating> <code>Zr</code> <description>to 150-168 mph (240-270 km/h)</description> <updated_at>2021-05-01 18:20:59</updated_at> </speedRating> </speedRatings> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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

<telepecas> <status>success</status> <timestamp>2021-06-22T23:36:27Z</timestamp> <typeCars> <typeCar> <code>C</code> <description>Car</description> <updated_at>2021-05-24 15:14:10</updated_at> </typeCar> <typeCar> <code>S</code> <description>Off-Road/4x4/SUV</description> <updated_at>2021-05-24 15:14:10</updated_at> </typeCar> <typeCar> <code>T</code> <description>Light truck</description> <updated_at>2021-05-24 15:14:10</updated_at> </typeCar> <typeCar> <code>M</code> <description>Moto</description> <updated_at>2021-05-24 15:14:10</updated_at> </typeCar> </typeCars> </telepecas>

ERROR

<telepecas> <error> <code>900.000.003</code> <description>Account error</description> <message>You must indicate a valid client token. Consult the documentation for more information.</message> </error> </telepecas>

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.