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

# Export payment links

> Exports the payment links of your organization as a CSV or XLSX file.

The file has every link that matches the same filters and order as the payment-link list, one per row, with eleven columns whose headers are in Portuguese: `Identificador` (the ID), `Nome`, `Descrição`, `Status` (`Ativo`, `Desativado` or `Expirado`), `Produtos` (each product as `{"produto": <ID>, "quantidadae": <quantity>}`, comma-separated), `Data de expiração`, `Método de pagamento`, `Métodos de pagamento secundários`, `Primeiro pagamento`, `Numero de parcelas` and `Criado em`. Dates are written as `DD/MM/YYYY HH:mm` in Brasília time. A link with no expiration date or no secondary payment methods reads `Não disponível` there, one with no description an empty `Descrição`, and one with no number of installments `0`. When no link matches, the file has the header and one placeholder row: empty `Identificador`, `Nome` and `Descrição`, `Numero de parcelas` `0`, and `Não disponível` in every other column.

`?type=csv` answers a UTF-8 CSV file; `?type=xlsx` an Excel workbook, base64-encoded. An export is limited to 50,000 links and 4 MiB (a little less for a CSV with many quotes or line breaks): narrow the filters to export more. Only an admin of the organization, or of the realm, can export them.


## OpenAPI

````yaml /api-reference/billing.openapi.json get /realms/{realmId}/organizations/{organizationId}/payment-links/report
openapi: 3.0.3
info:
  title: Billing
  version: 1.0.0
  description: >-
    Portão 3 billing API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). Full billing surface —
    contracts, deals, invoices, statements, payment links, checkout and NFSe
    orchestration. (The product/supplier catalog moved to registry.) Confidence
    tiers: generated:typed=74 copied:manual=0 unknown=5.
servers:
  - url: https://api.billing.v2.portao3.com.br/
    description: production
  - url: https://api.billing.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Contracts
  - name: Deals
  - name: Invoices
  - name: Invoice Entries
  - name: Invoice Statements
  - name: NFSe Configuration
  - name: Payment Links
paths:
  /realms/{realmId}/organizations/{organizationId}/payment-links/report:
    get:
      tags:
        - Payment Links
      summary: Export payment links
      description: Exports the payment links of your organization as a CSV or XLSX file.
      operationId: getRealmsByRealmIdOrganizationsByOrganizationIdPaymentLinksReport
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of your organization: the one that sells through the links.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: type
          in: query
          required: true
          description: 'File format: `csv` or `xlsx`.'
          schema:
            type: string
            enum:
              - csv
              - xlsx
          example: csv
        - name: name
          in: query
          required: false
          description: Only links whose name contains this text, ignoring case.
          schema:
            type: string
            minLength: 1
            maxLength: 56
          example: anual
        - name: status
          in: query
          required: false
          description: |-
            Only links in these statuses. Omit it for every status.

            ---

            Example (comma-separated list): `?status=ACTIVE,DEACTIVATED`
          schema:
            type: array
            items:
              type: string
              enum:
                - ACTIVE
                - DEACTIVATED
                - EXPIRED
          style: form
          explode: false
        - name: order
          in: query
          required: false
          description: Sort direction of the rows.
          schema:
            default: DESC
            type: string
            enum:
              - ASC
              - DESC
          example: DESC
        - name: orderBy
          in: query
          required: false
          description: Field the rows are sorted by.
          schema:
            default: createdAt
            type: string
            enum:
              - name
              - createdAt
          example: createdAt
        - name: startAt
          in: query
          required: false
          description: >-
            Only links created on or after this moment: an ISO 8601 date (read
            as midnight UTC) or a date-time with an offset.
          schema:
            anyOf:
              - type: string
                format: date
              - type: string
                format: date-time
          example: '2026-01-01'
        - name: endAt
          in: query
          required: false
          description: >-
            Only links created on or before this moment: an ISO 8601 date (read
            as midnight UTC) or a date-time with an offset.
          schema:
            anyOf:
              - type: string
                format: date
              - type: string
                format: date-time
          example: '2026-12-31T23:59:59.999Z'
      responses:
        '200':
          description: >-
            `application/csv` — The payment links as a UTF-8 CSV file, when
            `type` is `csv`.


            `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`
            — The Excel workbook, base64-encoded, when `type` is `xlsx`.
          content:
            application/csv:
              schema:
                type: string
                description: The payment links as a UTF-8 CSV file, when `type` is `csv`.
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: byte
                description: The Excel workbook, base64-encoded, when `type` is `xlsx`.
        '403':
          description: >-
            `FORBIDDEN_PAYMENT_LINK` — You are not an admin of the organization
            nor of the realm.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - FORBIDDEN_PAYMENT_LINK
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: FORBIDDEN_PAYMENT_LINK
                origin: BILLING
                message: Forbidden
        '422':
          description: >-
            `EXPORT_TOO_LARGE` — More than 50,000 links match, or the file would
            be too large to send.


            `BAD_REQUEST` — A path or query parameter is invalid, such as a
            missing `type`; `fields` lists each one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - EXPORT_TOO_LARGE
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: EXPORT_TOO_LARGE
                origin: BILLING
                message: >-
                  This export is too large to generate in a single request.
                  Narrow the filters (for example a shorter date range) and try
                  again.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.