> ## 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.

# Autorizar Payout

Autorize um payout para liberar os fundos ao seu beneficiário atualizando o status dele para `Received`. Este endpoint foi projetado para aprovar payouts que estejam em estado `pending` ou `on-hold`.

Você pode identificar o payout a ser autorizado usando um dos seguintes métodos:

* **Por `internalId`:** Identificador único de transação do Localpayment.

* **Por `externalId`:** Sua própria referência única para a transação.

* **Por intervalo de datas:** Autorize todos os payouts elegíveis dentro de um período especificado.

Uma requisição bem-sucedida atualizará o status do payout para `Received` e iniciará a transferência dos fundos. A resposta confirmará o status da autorização ou fornecerá detalhes relevantes do erro.


## OpenAPI

````yaml openapi/pt-br/localpayment.json POST /api/payout/authorize
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/payout/authorize:
    post:
      summary: Autorizar Payout
      operationId: authorize-payout
      parameters:
        - name: Authorization
          in: header
          description: >-
            Token de acesso Bearer para autenticação. Este token é obtido nos
            endpoints [Obter token de acesso](/pt-br/reference/get-token) ou
            [Renovar token de acesso](/pt-br/reference/refresh-token).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              anyOf:
                - type: object
                  properties:
                    dateFrom:
                      type: string
                      description: Dia de início no formato `yyyy-mm-dd`.
                    dateTo:
                      type: string
                      description: Dia final no formato `yyyy-mm-dd`.
                  required:
                    - dateFrom
                    - dateTo
                - type: object
                  properties:
                    externalId:
                      type: string
                      description: >-
                        Um identificador único gerado pelo seu sistema para
                        rastrear a transação (alfanumérico e com hífens).
                        Recomendamos o uso do UUID4 para garantir a unicidade.
                  required:
                    - externalId
                - type: object
                  properties:
                    internalId:
                      type: string
                      description: Identificador de transação da Localpayment.
                  required:
                    - internalId
              x-examples:
                Example 1:
                  dateFrom: '2025-01-09'
                  dateTo: '2025-01-09'
            examples:
              Date:
                value:
                  dateFrom: '2025-01-09'
                  dateTo: '2025-01-09'
              externalID:
                description: Localpayment transaction identifier.
                value:
                  externalId: 1939b376-2aed-4c7a-bc2b-1157702f00b0
              internalId:
                description: >-
                  A unique identifier generated by your system to track the
                  transaction (alphanumeric and hyphens). We recommend using
                  UUID4 to ensure uniqueness.
                value:
                  internalID: 7d7f7fca-e411-4ba6-b46f-b9fed4d5f3d0
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: Código de status.
                  message:
                    type: string
                    description: Mensagem com informações adicionais.
                required:
                  - status
                  - message
                x-examples:
                  Example 1:
                    status: 200
                    message: The request will be processed.
              examples:
                The request will be processed:
                  value:
                    status: 200
                    message: The request will be processed.
        '401':
          description: Não autorizado.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Informações adicionais sobre a resposta.
                  code:
                    type: string
                    description: Código de status.
                  messages:
                    type: array
                    description: Lista de mensagens.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Classe Token.
                        token_type:
                          type: string
                          description: Tipo de token.
                        message:
                          type: string
                          description: Mensagem com informações adicionais.
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                Example 1:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
        '404':
          description: Não encontrado
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      errors:
                        type: object
                        description: Informações sobre o erro.
                        properties:
                          payOutBy:
                            type: array
                            items:
                              type: string
                          '[0].internalId':
                            type: array
                            items:
                              type: string
                      type:
                        type: string
                      title:
                        type: string
                        description: "Informações adicionais sobre a resposta.\r\n\r\n"
                      status:
                        type: integer
                        description: Código de status.
                      traceId:
                        type: string
                        description: Identificador de rastreamento do erro.
                    required:
                      - errors
                      - type
                      - title
                      - status
                      - traceId
                  - type: object
                    properties:
                      Status:
                        type: integer
                        description: Código de status.
                      Message:
                        type: string
                        description: Mensagem com informações adicionais.
                      TraceId:
                        type: string
                        description: Identificador de rastreamento.
                    required:
                      - Status
                      - Message
                      - TraceId
                    x-examples:
                      Example 1:
                        Status: 404
                        Message: This transacion does not exists.
                        TraceId: d11cea70-7f14-4f11-b66e-13f5f56c2e56
                x-examples:
                  Example 1:
                    errors:
                      payOutBy:
                        - The payOutBy field is required.
                      '[0].internalId':
                        - >-
                          Error converting value
                          "7d7f7fca-e411-4ba6-b4f-b9fed4d5f3d2" to type
                          'System.Guid'. Path '[0].internalId', line 1, position
                          53.
                    type: https://tools.ietf.org/html/rfc7231#section-6.5.1
                    title: One or more validation errors occurred.
                    status: 400
                    traceId: 00-6af59d173e66ad4eb215987cd15d57af-bea3981476c0f347-00
              examples:
                The payOutBy field is required:
                  value:
                    errors:
                      payOutBy:
                        - The payOutBy field is required.
                      '[0].internalId':
                        - >-
                          Error converting value
                          "7d7f7fca-e411-4ba6-b4f-b9fed4d5f3d2" to type
                          'System.Guid'. Path '[0].internalId', line 1, position
                          53.
                    type: https://tools.ietf.org/html/rfc7231#section-6.5.1
                    title: One or more validation errors occurred.
                    status: 400
                    traceId: 00-6af59d173e66ad4eb215987cd15d57af-bea3981476c0f347-00
      security:
        - token: []
      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.