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

> Envia documentos da subconta para análise/aprovação.

Cada arquivo deve ser um dos formatos: **JPEG, JPG, PNG, GIF, BMP, WEBP ou PDF**, com no máximo **50MB** por arquivo.
Após a subconta ser **aprovada**, novos uploads são **bloqueados** (retorna `422`).

**Diferenciação por sócio:** esta rota **não** diferencia sócios — os documentos
de pessoa (`responsible_document_front`, `responsible_document_back`,
`selfie_with_document`) são sempre vinculados ao **representante legal**
(principal). Se a subconta tem **apenas um representante** (sem sócios
adicionais), esta rota é tudo o que você precisa — integrações existentes
continuam funcionando sem nenhuma mudança. Para enviar os documentos de um
**sócio adicional**
(`additionalRepresentatives`), use o fluxo com token:
`POST /v1/submerchants/{merchantId}/document/upload-token` informando o
`legalRepresentativeId` do sócio, e envie os arquivos em
`POST /v1/document-uploads`. Documentos de empresa (`cnpj_card`,
`social_contract`, `irs_letter`) valem para a subconta como um todo,
por qualquer uma das rotas.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/submerchants/{id}/document
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/submerchants/{id}/document:
    post:
      tags:
        - FastConnect
      summary: Upload submerchant documents
      description: >-
        Envia documentos da subconta para análise/aprovação.


        Cada arquivo deve ser um dos formatos: **JPEG, JPG, PNG, GIF, BMP, WEBP
        ou PDF**, com no máximo **50MB** por arquivo.

        Após a subconta ser **aprovada**, novos uploads são **bloqueados**
        (retorna `422`).


        **Diferenciação por sócio:** esta rota **não** diferencia sócios — os
        documentos

        de pessoa (`responsible_document_front`, `responsible_document_back`,

        `selfie_with_document`) são sempre vinculados ao **representante legal**

        (principal). Se a subconta tem **apenas um representante** (sem sócios

        adicionais), esta rota é tudo o que você precisa — integrações
        existentes

        continuam funcionando sem nenhuma mudança. Para enviar os documentos de
        um

        **sócio adicional**

        (`additionalRepresentatives`), use o fluxo com token:

        `POST /v1/submerchants/{merchantId}/document/upload-token` informando o

        `legalRepresentativeId` do sócio, e envie os arquivos em

        `POST /v1/document-uploads`. Documentos de empresa (`cnpj_card`,

        `social_contract`, `irs_letter`) valem para a subconta como um todo,

        por qualquer uma das rotas.
      parameters:
        - name: id
          in: path
          required: true
          description: Unique identifier of the merchant.
          schema:
            type: string
            example: 36OO3bcGjhPjjF3tzrqOGcmQuKo
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadSubMerchantDocuments'
      responses:
        '201':
          description: Successfully uploaded documents
        '401':
          description: Unauthorized - invalid credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 401
                  message:
                    type: string
                    example: Unauthorized
        '403':
          description: Forbidden - insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 403
                  message:
                    type: string
                    example: Forbidden
        '422':
          description: >-
            Unprocessable Entity — tipo/formato de arquivo inválido, arquivo
            acima de 50MB, ou upload após a subconta já ter sido aprovada
            (bloqueado).
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 422
                  error:
                    type: string
                    example: Unprocessable Entity
                  message:
                    type: string
                    example: >-
                      The items list contains one of more items with invalid
                      type.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 500
                  message:
                    type: string
                    example: Internal server error
      security:
        - basic: []
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:
    basic:
      type: http
      scheme: basic
      description: |-
        HTTP Basic authentication. Use your secret key as the
        username and an empty string as password. The API key
        should be base64 encoded in the format 'username:' when
        sending the Authorization header.

````