> ## Documentation Index
> Fetch the complete documentation index at: https://docs.localpayment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Obtenha o token de acesso

Para acessar qualquer um dos nossos serviços, você deve primeiro se autenticar obtendo um token de acesso. Use o usuário e a senha do seu dashboard para solicitar o token.

> **Expiração do token**
>
> Por motivos de segurança, os tokens de acesso são válidos por 60 minutos.

> **Importante**
>
> Seu endereço IP deve estar na [whitelist](https://docs.localpayment.com/pt-br/docs/dashboard-whitelist-your-ips.md) para gerar um token com sucesso.


## OpenAPI

````yaml openapi/pt-br/localpayment.json POST /api/token/
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/token/:
    post:
      summary: Obtenha o token de acesso.
      operationId: get-token
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                  description: >-
                    Seu nome de usuário da Localpayment. Ele foi fornecido a
                    você durante o processo de onboarding.
                password:
                  type: string
                  description: >-
                    Sua senha da Localpayment. Ela foi fornecida a você durante
                    o processo de onboarding.
              required:
                - username
                - password
              x-examples:
                Example 1:
                  username: USERNAME_PROVIDED_BY_LOCALPAYMENT
                  password: PASSWORD_PROVIDED_BY_LOCALPAYMENT
            examples:
              200 - Access Token:
                value:
                  username: <USERNAME>
                  password: <PASSWORD>
              400 - Username field is required.:
                value:
                  password: '{{password}}'
              400 - Not a valid string.:
                value:
                  username: string
                  password: []
              400 - Password field is required.:
                value:
                  username: user@example.com
              400 - Required fields missing.:
                value: {}
              401 - No active account found with the given credentials:
                value:
                  username: user@example.com
                  password: <PASSWORD>
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  refresh:
                    type: string
                    description: >-
                      Token de atualização usado para obter um novo token de
                      acesso.
                  access:
                    type: string
                    description: >-
                      Token de acesso usado para autenticar solicitações aos
                      serviços Localpayment.
                required:
                  - refresh
                  - access
                x-examples:
                  Example 1:
                    refresh: >-
                      eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTczNTMxOTkyOSwianRpIjoiZWUxMDE3MTUwY2JhNGM1NTg0MjYyZmRkZTdiOThiNGQiLCJ1c2VyX2lkIjoxMDAwLCJzdXBlcnVzZXIiOnRydWUsImlzX3N0YWZmIjp0cnVlLCJyb2xlcyI6WyJBTEwiXSwiY291bnRyaWVzIjpbIkFMTCJdLCJjb21wYW55IjoiQUxMIiwiY2xpZW50X2NvZGUiOiJBTEwiLCJwZXJtaXNzaW9ucyI6W119.6siymomk9sMCQ72yMvHGUO4h-cxpNgQXorcM5kYO7o4
                    access: >-
                      eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM1MjMzODI5LCJqdGkiOiJiMDRmNzQ3YWE4Mjg0YjM0YmMwN2Y4ZjVkOWM0NWFjOCIsInVzZXJfaWQiOjEwMDAsInN1cGVydXNlciI6dHJ1ZSwiaXNfc3RhZmYiOnRydWUsInJvbGVzIjpbIkFMTCJdLCJjb3VudHJpZXMiOlsiQUxMIl0sImNvbXBhbnkiOiJBTEwiLCJjbGllbnRfY29kZSI6IkFMTCIsInBlcm1pc3Npb25zIjpbXX0.sWOLKFxCcXQkUcPvTjYceXBp39lqEnH7GrEhDF3-Snc
              examples:
                200 - Access Token:
                  value:
                    refresh: >-
                      eyJ0eXAiOiJKV1QiLCJhbGccM5kYO7o4iOiJIU18jaiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTczNTMxOTkyOSwianRpIjoiZWUxMDE3MTUwY2JhNGM1NTg0MjYyZmRkZTdiOThiNGQiLCJ1c2VyX2lkIjoxMDAwLCJzdXBlcnVzZXIiOnRydWUsImlzX3N0YWZmIjp0cnVlLCJybaCIsImV4cCI62xlcyI6WyJBTEwiXSwiY291bnRyaWVzIjpbIkFMTCJdLCJjb21wYW55IjoiQUxMIiwiY2xpZW50X2NvZGUiOiJBNzaW9uTEwiLCJwZXJtaXcyI6W119.6siymomkQ72yMvHGU9sMCO4h-cxpNgQXor
                    access: >-
                      eyJ0eXAiOiJKV1QiLCJhJIUzI1NiJ9.eyJ0b2tlbl90eXBlIbGciOijoiYWNjZXNzIiwiZXhwIjoxNzM1MjMzODI5LCJqdGkiOiJiMDRmNzQ3YWEjOCIsIn4Mjg0YjM0YmMwN2Y4ZjVkOWM0NWFVzZXJfaWQiOjEwMDAsInN1cGVydXNlciI6dHJ1ZSwiaXNfc3RhZmYiOnRy3VudHJpZXMiOljpbIkFsiQUxMIl0sImNvbXBhbnkiOiJBTEwiLCJjbGllbnRfY29kZSI6IkFMTCIsInBlcm1pc3Npb25zIjpdWUsInJvbGVzIMTCJdLlqEnH7GrECJjbbXX0.sWOLKFxCcXQkUcPvTjYceXBp39hDF3-Snc
        '400':
          description: Solicitação inválida.
          content:
            application/json:
              schema:
                type: object
                properties:
                  username:
                    type: array
                    description: >-
                      Seu nome de usuário da Localpayment. Ele foi fornecido a
                      você durante o processo de onboarding.
                    items:
                      type: string
                  password:
                    type: array
                    description: >-
                      Sua senha da Localpayment. Ela foi fornecida a você
                      durante o processo de onboarding.
                    items:
                      type: string
                x-examples:
                  Example 1:
                    username:
                      - This field is required.
                    password:
                      - This field is required.
              examples:
                400 - Username field is required.:
                  value:
                    username:
                      - This field is required.
                400 - Not a valid string.:
                  value:
                    password:
                      - Not a valid string.
                400 - Password field is required.:
                  value:
                    password:
                      - This field is required.
                400 - Required fields missing.:
                  value:
                    username:
                      - This field is required.
                    password:
                      - This field is required.
        '401':
          description: Não autorizado
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Detalhes adicionais da resposta.
                required:
                  - detail
                x-examples:
                  Example 1:
                    detail: No active account found with the given credentials
              examples:
                401 - No active account found with the given credentials:
                  value:
                    detail: No active account found with the given credentials
                401 - Invalid IP for user.:
                  value:
                    detail: >-
                      Invalid IP for user. Please validate that 189.200.97.11 is
                      whitelisted in your account settings.
      security: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.