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

# Pagar boleto

> Cria pagamentos de boleto.

## Opções
- **Individual ou lote**: Pague um ou múltiplos boletos em uma única requisição
- **Valor**: Informe o valor ou deixe ser extraído do código de barras



## OpenAPI

````yaml /api-reference/banking/openapi.pt.json post /v1/boleto-payments
openapi: 3.1.0
info:
  title: API Conta Digital
  description: API pública para gerenciamento de conta, extrato e operações PIX
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://conta-public-api.kiwify.com
    description: Production environment
security: []
tags:
  - name: Conta
    description: Detalhes da conta, saldo, limites e chaves PIX
  - name: Extrato
    description: Extrato e histórico de transações
  - name: Enviar Pix
    description: Enviar dinheiro via transferências PIX
  - name: Receber Pix
    description: Reembolsar transações PIX
  - name: Pagar boletos
    description: Pagar boletos via API
  - name: QR Codes PIX
    description: Geração de QR codes PIX para receber pagamentos
  - name: Webhooks
    description: >-
      Gerenciamento de assinaturas de webhook para recebimento de notificações
      de eventos
paths:
  /v1/boleto-payments:
    post:
      tags:
        - Pagar boletos
      summary: Pagar boleto
      description: >-
        Cria pagamentos de boleto.


        ## Opções

        - **Individual ou lote**: Pague um ou múltiplos boletos em uma única
        requisição

        - **Valor**: Informe o valor ou deixe ser extraído do código de barras
      operationId: create_boleto_payments
      parameters:
        - name: X-Idempotency-Key
          in: header
          description: >-
            Optional idempotency key for safe retries. When provided, requests
            with the same key return the same result. Without this header,
            duplicate external_reference_id values will fail with 400 Bad
            Request.
          required: false
          schema:
            type:
              - string
              - 'null'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBoletoPaymentsRequest'
        required: true
      responses:
        '201':
          description: Boleto payments batch created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBoletoPaymentsResponse'
        '400':
          description: >-
            Invalid request. Error codes: INVALID_REQUEST (field validation in
            error.details), DUPLICATE_EXTERNAL_REFERENCE_ID, TOO_MANY_ITEMS,
            INVALID_AMOUNT, TAX_ID_NOT_IN_ALLOWED_LIST, VALIDATION_ERROR,
            DUPLICATE_BATCH
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No account found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Idempotency conflict — same X-Idempotency-Key with different
            payload. Error code: IDEMPOTENCY_CONFLICT
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - AccessId: []
          PoPChallenge: []
          PoPFormat: []
          PoPSignature: []
components:
  schemas:
    CreateBoletoPaymentsRequest:
      type: object
      required:
        - payments
      properties:
        allowed_tax_ids:
          type: array
          items:
            type: string
          description: >-
            Optional list of CPF/CNPJ that restricts the allowed beneficiary
            documents for this batch.

            When provided, the `tax_id` in each payment must be present in the
            list.

            When empty, payments to any document are accepted.
        payments:
          type: array
          items:
            $ref: '#/components/schemas/BoletoPaymentRequest'
          description: Boleto payments to create in this batch (1–100 items).
      example:
        allowed_tax_ids:
          - '12345678909'
        payments:
          - amount_in_cents: 11631
            description: Pagamento boleto
            external_reference_id: boleto-001
            line: '34191091070544794730971544640008884660000011631'
            tax_id: '12345678909'
    CreateBoletoPaymentsResponse:
      type: object
      required:
        - batch
        - payments
      properties:
        batch:
          $ref: '#/components/schemas/BatchResponse'
        payments:
          type: array
          items:
            $ref: '#/components/schemas/BoletoPaymentItemResponse'
    ErrorResponse:
      type: object
      required:
        - error
        - timestamp
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetails'
          description: Error payload.
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 / RFC 3339 UTC timestamp of when the error occurred.
          example: '2026-05-28T14:30:00Z'
    BoletoPaymentRequest:
      type: object
      required:
        - line
        - tax_id
      properties:
        amount_in_cents:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Payment amount in centavos. Optional — if omitted, the amount is
            extracted from the barcode during processing.
          example: 11631
          minimum: 1
        description:
          type:
            - string
            - 'null'
          description: Payment description (1–255 characters).
          example: Pagamento boleto
        external_reference_id:
          type:
            - string
            - 'null'
          description: >-
            Client-provided unique reference for this payment within the account
            (1–127 characters).
          example: boleto-001
        line:
          type: string
          description: >-
            Boleto barcode line (47 or 48 digits). Supports standard boletos and
            utility bills (concessionárias).
          example: '34191091070544794730971544640008884660000011631'
        scheduled_date:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Scheduled execution date (`YYYY-MM-DD`, America/São Paulo). Must be
            after today's date in that timezone.
          example: '2026-06-01'
        tax_id:
          type: string
          description: Beneficiary CPF or CNPJ (with or without formatting).
          example: '12345678909'
    BatchResponse:
      type: object
      required:
        - id
        - payment_type
        - status
        - total_items
        - total_amount_in_cents
        - created_at
        - origin_bank_account_id
      properties:
        allowed_tax_ids:
          type: array
          items:
            type: string
          description: >-
            List of CPF/CNPJ that restricts the allowed beneficiary documents
            for this batch. Empty if unrestricted.
        created_at:
          type: string
          format: date-time
          description: Batch creation timestamp (UTC, RFC 3339).
          example: '2026-05-28T14:30:00Z'
        id:
          type: integer
          format: int64
        idempotency_key:
          type:
            - string
            - 'null'
        origin_bank_account_id:
          type: integer
          format: int64
        payment_type:
          $ref: '#/components/schemas/PaymentTypeResponse'
        status:
          $ref: '#/components/schemas/BatchStatusResponse'
        total_amount_in_cents:
          type: integer
          format: int64
        total_items:
          type: integer
          format: int32
    BoletoPaymentItemResponse:
      type: object
      required:
        - id
        - status
        - barcode_line
        - tax_id
        - created_at
      properties:
        amount_in_cents:
          type:
            - integer
            - 'null'
          format: int64
        barcode_line:
          type: string
        created_at:
          type: string
          format: date-time
          description: Payment creation timestamp (UTC, RFC 3339).
          example: '2026-05-28T14:30:00Z'
        description:
          type:
            - string
            - 'null'
        external_reference_id:
          type:
            - string
            - 'null'
        failed_message:
          type:
            - string
            - 'null'
        id:
          type: integer
          format: int64
        scheduled_date:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Scheduled execution date (`YYYY-MM-DD`). Null when executed
            immediately.
          example: '2026-06-01'
        status:
          $ref: '#/components/schemas/BoletoPaymentItemStatusResponse'
        tax_id:
          type: string
        transaction_id:
          type:
            - integer
            - 'null'
          format: int64
    ErrorDetails:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            Machine-readable error code. Use this for branching logic, not
            `message`.
          example: INVALID_REQUEST
        details:
          type: object
          description: >-
            Optional structured details. For `INVALID_REQUEST`, may be an array
            of field validation errors or a `validation_failed` object depending
            on the endpoint.
        message:
          type: string
          description: >-
            Human-readable error description. Do not rely on this text for
            programmatic handling.
    PaymentTypeResponse:
      type: string
      enum:
        - pix_transfer
        - boleto_payment
    BatchStatusResponse:
      type: string
      enum:
        - created
        - ready
        - scheduled
        - cancelled
        - completed
        - partially_failed
        - failed
    BoletoPaymentItemStatusResponse:
      type: string
      enum:
        - awaiting_approval
        - pending
        - processing
        - success
        - cancelled
        - failed
  securitySchemes:
    AccessId:
      type: apiKey
      in: header
      name: x-access-id
      description: UUID of the service account (e.g., 550e8400-e29b-41d4-a716-446655440000)
    PoPChallenge:
      type: apiKey
      in: header
      name: X-PoP-Challenge
      description: >-
        Unix timestamp in milliseconds (e.g., 1704636800000). Must be within 5
        minutes of server time.
    PoPFormat:
      type: apiKey
      in: header
      name: X-PoP-Format
      description: Must be 'service-account' for service account authentication
    PoPSignature:
      type: apiKey
      in: header
      name: X-PoP-Signature
      description: >-
        EdDSA signature of the request in base64 format. Signs:
        uri:method:body:timestamp

````