{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-parceiros/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Autenticação","description":"APIs públicas da Movvia para parceiros, estabelecimentos comerciais e clientes de dados veiculares.","meta":[{"name":"theme-color","content":"#7E3DEE"},{"name":"apple-mobile-web-app-title","content":"Movvia Docs"},{"name":"application-name","content":"Movvia Docs"}],"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"autenticação","__idx":0},"children":["Autenticação"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"esquema","__idx":1},"children":["Esquema"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A API usa ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Basic Auth"]}," padrão HTTP. A Movvia fornece as credenciais (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id:client_secret"]},") no onboarding."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Codifique em Base64 e envie no header ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Codificar credenciais\nCREDENTIALS=$(echo -n \"client_id:client_secret\" | base64)\n\n# Usar na requisição\ncurl https://hml.api.pedagioeletronico.com.br/gestao-webhooks-api/v1/me \\\n  -H \"Authorization: Basic $CREDENTIALS\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"Variável de ambiente"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Armazene as credenciais já codificadas em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MV_KEY"]}," e use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-H \"Authorization: Basic $MV_KEY\""]}," nas requisições. Nunca comite credenciais no código."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"descoberta-de-identidade","__idx":2},"children":["Descoberta de identidade"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Antes de fazer qualquer outra chamada, obtenha seu ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parceiroId"]}," via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /me"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl https://hml.api.pedagioeletronico.com.br/gestao-webhooks-api/v1/me \\\n  -H \"Authorization: Basic $MV_KEY\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resposta:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"parceiroId\": \"par_7f3a1b2c\",\n  \"nome\": \"Parceiro Exemplo Ltda\",\n  \"modo\": \"FILTRADO\",\n  \"status\": \"ativo\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"header-obrigatório-x-parceiro-id","__idx":3},"children":["Header obrigatório: x-parceiro-id"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Após obter o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parceiroId"]},", inclua-o em ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["todas"]}," as demais requisições:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl https://hml.api.pedagioeletronico.com.br/gestao-webhooks-api/v1/placas \\\n  -H \"Authorization: Basic $MV_KEY\" \\\n  -H \"x-parceiro-id: par_7f3a1b2c\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"placa\":\"ABC1D23\"}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requisições sem ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-parceiro-id"]}," retornam ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"erros-de-autenticação","__idx":4},"children":["Erros de autenticação"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Código"},"children":["Código"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Causa"},"children":["Causa"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Ação"},"children":["Ação"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401 Unauthorized"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Credenciais inválidas ou expiradas"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Verificar ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MV_KEY"]},"; solicitar novas credenciais"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403 Forbidden"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Parceiro sem permissão para o recurso"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Verificar plano; contatar suporte"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Header ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-parceiro-id"]}," ausente"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Incluir o header em todas as requisições"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"rotação-de-credenciais","__idx":5},"children":["Rotação de credenciais"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Credenciais não expiram automaticamente. Para rotacionar, solicite ao suporte. O período de sobreposição é de 24h — ambas as credenciais funcionam durante a transição."]}]},"headings":[{"value":"Autenticação","id":"autenticação","depth":1},{"value":"Esquema","id":"esquema","depth":2},{"value":"Descoberta de identidade","id":"descoberta-de-identidade","depth":2},{"value":"Header obrigatório: x-parceiro-id","id":"header-obrigatório-x-parceiro-id","depth":2},{"value":"Erros de autenticação","id":"erros-de-autenticação","depth":2},{"value":"Rotação de credenciais","id":"rotação-de-credenciais","depth":2}],"frontmatter":{"title":"Autenticação — Parceiros Movvia","description":"Como autenticar na API de Parceiros Movvia usando Basic Auth e o header x-parceiro-id.","seo":{"title":"Autenticação"}},"lastModified":"2026-04-25T15:17:56.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/parceiros/guides/autenticacao","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}