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

# Upload documents with an upload token

> Consome o token escopado emitido por `POST /v1/submerchants/{merchantId}/document/upload-token`
e envia os documentos em **multipart/form-data** — o **fieldname de cada arquivo é o
nome do documento** (`cnpj_card`, `social_contract`, `responsible_document_front`,
`responsible_document_back`, `selfie_with_document`, `irs_letter`).

Autentique com o token no header `Authorization: Bearer <token>` (não é a chave de API).
A subconta alvo e o eventual sócio vêm **de dentro do token** — nunca do corpo.

Formatos: JPEG, JPG, PNG, GIF, BMP, WEBP ou PDF, máx. **50MB** por arquivo.
Reenviar um documento de pessoa **substitui apenas o documento daquele sócio**;
documentos de empresa (`cnpj_card`, `social_contract`, `irs_letter`) não usam o
vínculo por sócio.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/document-uploads
openapi: 3.0.0
info:
  title: FastPay API
  version: 1.0.0
  description: >-
    API for creating and managing payment charges.


    ## Authentication


    This API uses **Basic Authentication** for direct API access, such as
    creating charges.

    Use your API key as the username and an empty string as password.

    The header should be formatted as:


    `Authorization: Basic {base64(apiKey:)}`.


    For example:


    ```

    Authorization: Basic YWxleG91dG9uOiIi

    ```


    ## Webhooks


    FastPay sends webhooks to notify your application about charge status
    changes in real-time.

    Webhooks are sent via HTTP POST requests to your configured webhook
    endpoints.


    ### Webhook Events


    The following webhook events are available for charges:


    - `charge.created` - Sent when a new charge is created

    - `charge.pending` - Sent when a charge is pending payment

    - `charge.paid` - Sent when a charge is successfully paid

    - `charge.updated` - Sent when a charge is updated


    ### Webhook Payload Structure


    All webhook payloads follow this structure:


    ```json

    {
      "id": "webhook_event_id",
      "event": "charge.paid",
      "data": {
        // Complete charge object
      }
    }

    ```


    ### Webhook Delivery


    - Webhooks are sent via HTTP POST requests

    - Content-Type: `application/json`

    - Retry logic is implemented for failed deliveries

    - Webhook events are stored in the database for audit purposes

    - Delivery logs are maintained for debugging and monitoring


    ### Webhook Security


    - Webhooks are sent to pre-configured endpoints

    - Endpoints can be enabled/disabled per merchant

    - Event filtering is supported (only receive specific events)

    - Failed deliveries are retried with exponential backoff
servers:
  - url: https://api-global.fastpaybrasil.com
    description: Produção e Sandbox (diferenciados pela API key)
security: []
paths:
  /v1/document-uploads:
    post:
      tags:
        - FastConnect
      summary: Upload documents with an upload token
      description: >-
        Consome o token escopado emitido por `POST
        /v1/submerchants/{merchantId}/document/upload-token`

        e envia os documentos em **multipart/form-data** — o **fieldname de cada
        arquivo é o

        nome do documento** (`cnpj_card`, `social_contract`,
        `responsible_document_front`,

        `responsible_document_back`, `selfie_with_document`, `irs_letter`).


        Autentique com o token no header `Authorization: Bearer <token>` (não é
        a chave de API).

        A subconta alvo e o eventual sócio vêm **de dentro do token** — nunca do
        corpo.


        Formatos: JPEG, JPG, PNG, GIF, BMP, WEBP ou PDF, máx. **50MB** por
        arquivo.

        Reenviar um documento de pessoa **substitui apenas o documento daquele
        sócio**;

        documentos de empresa (`cnpj_card`, `social_contract`, `irs_letter`) não
        usam o

        vínculo por sócio.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadSubMerchantDocuments'
      responses:
        '201':
          description: Documentos enviados com sucesso
        '400':
          description: Nenhum arquivo enviado
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 400
                  message:
                    type: string
                    example: No file sent
        '403':
          description: Token inválido, expirado ou ausente
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 403
                  message:
                    type: string
                    example: Forbidden
        '422':
          description: Tipo/formato de arquivo inválido ou arquivo acima de 50MB
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 422
                  message:
                    type: string
                    example: >-
                      The items list contains one of more items with invalid
                      type.
      security:
        - bearer: []
components:
  schemas:
    UploadSubMerchantDocuments:
      type: object
      properties:
        cnpj_card:
          type: string
          format: binary
          description: CNPJ registration card.
        social_contract:
          type: string
          format: binary
          description: Company social contract document.
        responsible_document_front:
          type: string
          format: binary
          description: Front image of the legal representative document.
        responsible_document_back:
          type: string
          format: binary
          description: Back image of the legal representative document.
        selfie_with_document:
          type: string
          format: binary
          description: Selfie of the legal representative holding the document.
        irs_letter:
          type: string
          format: binary
          description: IRS letter — used in the LLC onboarding flow.
      minProperties: 1
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        JWT Bearer token authentication. Use the JWT token obtained
        from the login endpoint in the Authorization header as 'Bearer {token}'.

````