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

Autoriza un Payout para liberar fondos a su beneficiario actualizando su estado a `Received`. Este endpoint está diseñado para aprobar Payouts que se encuentran en estado `pending` o `on-hold`.

Puedes identificar el Payout que deseas autorizar mediante uno de los siguientes métodos:

* **Por `internalId`:** Identificador único de transacción de Localpayment.

* **Por `externalId`:** Tu propia referencia única para la transacción.

* **Por intervalo de fechas:** Autoriza todos los Payouts elegibles dentro de un período especificado.

Una solicitud exitosa actualizará el estado del Payout a `Received` e iniciará la transferencia de fondos. La respuesta confirmará el estado de la autorización o proporcionará los detalles de error correspondientes.


## OpenAPI

````yaml openapi/es/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 acceso Bearer para la autenticación. Este token se obtiene
            de los endpoints [Get Access Token](/es/reference/get-token) o
            [Refresh Access Token](/es/reference/refresh-token).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              anyOf:
                - type: object
                  properties:
                    dateFrom:
                      type: string
                      description: Día de inicio en formato `yyyy-mm-dd`.
                    dateTo:
                      type: string
                      description: Último día en formato `yyyy-mm-dd`.
                  required:
                    - dateFrom
                    - dateTo
                - type: object
                  properties:
                    externalId:
                      type: string
                      description: >-
                        Un identificador único generado por tu sistema para
                        rastrear la transacción (alfanumérico y con guiones).
                        Recomendamos usar UUID4 para garantizar su unicidad.
                  required:
                    - externalId
                - type: object
                  properties:
                    internalId:
                      type: string
                      description: Identificador de transacción de 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 estado.\r\n\r\n"
                  message:
                    type: string
                    description: Mensaje con información adicional.
                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: No autorizado.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Información adicional sobre la respuesta.
                  code:
                    type: string
                    description: Código de estado.
                  messages:
                    type: array
                    description: Lista de mensajes.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Clase de token.
                        token_type:
                          type: string
                          description: Tipo de token.
                        message:
                          type: string
                          description: Mensaje con información adicional.
                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: No encontrado
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      errors:
                        type: object
                        description: Información de error.
                        properties:
                          payOutBy:
                            type: array
                            items:
                              type: string
                          '[0].internalId':
                            type: array
                            items:
                              type: string
                      type:
                        type: string
                      title:
                        type: string
                        description: "Información adicional sobre la respuesta.\r\n\r\n"
                      status:
                        type: integer
                        description: Código de estado.
                      traceId:
                        type: string
                        description: Identificador de seguimiento del error.
                    required:
                      - errors
                      - type
                      - title
                      - status
                      - traceId
                  - type: object
                    properties:
                      Status:
                        type: integer
                        description: Código de estado.
                      Message:
                        type: string
                        description: Mensaje con información adicional.
                      TraceId:
                        type: string
                        description: Identificador de seguimiento.
                    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.