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

# Export receivables

> Start a CSV export of the invoices that match the given filters.

The export accepts the same query parameters as `GET /receivables` (filters, `sort` and `order`), so the current list query can be sent unchanged; `limit` and `pagination_token` are ignored. Only invoices are exported: `type` must be omitted or `invoice`. The file holds one row per line item (an invoice without line items is one row) and may contain at most 100000 rows.

The export runs in the background. Poll `GET /data-exports/{id}` for its status and, once it has succeeded, `GET /data-exports/{id}/download` for a download link. Dates are in UTC.



## OpenAPI

````yaml /.tooling/schemas/rest/tags/product-finops.json post /receivables/export
openapi: 3.1.0
info:
  title: Tesouro Partner API
  version: '2025-06-23'
  description: The Tesouro REST API, for Tesouro partners to integrate with our solution.
  termsOfService: https://tesouro.com/terms
  contact:
    name: Tesouro team
    url: https://tesouro.com/about/
    email: developers@tesouro.com
servers:
  - url: https://api.sandbox.tesouro.com
    description: Sandbox
security: []
tags:
  - name: Accounting connections
  - name: Accounting data pull
  - name: Accounting synchronized records
  - name: Accounting tax rates
  - name: Analytics
  - name: Approval policies
  - name: Approval requests
  - name: Bank details
  - name: Comments
  - name: Cost centers
  - name: Counterpart addresses
  - name: Counterpart bank accounts
  - name: Counterpart contacts
  - name: Counterpart VAT IDs
  - name: Counterparts
  - name: Credit notes
  - name: Custom tax rates
  - name: Data exports
  - name: Delivery notes
  - name: Departments
  - name: Disclosures
  - name: Documents
  - name: Events
  - name: Expenses
  - name: Files
  - name: Ledger accounts
  - name: Locations
  - name: Mail templates
  - name: Mailbox domains
  - name: Mailboxes
  - name: Measure units
  - name: OCR
  - name: OIDC applications
  - name: Organizations
  - name: Overdue reminders
  - name: Payable duplicates
  - name: Payable line items
  - name: Payables
  - name: Payment intents
  - name: Payment links
  - name: Payment methods
  - name: Payment records
  - name: Payment reminders
  - name: Payment terms
  - name: PDF templates
  - name: Products
  - name: Projects
  - name: Purchase orders
  - name: Receipts
  - name: Receivables
  - name: Recurrences
  - name: Roles
  - name: Tags
  - name: Text templates
  - name: Transactions
  - name: Users
  - name: Webhook deliveries
  - name: Webhook subscriptions
paths:
  /receivables/export:
    servers:
      - url: https://api.sandbox.tesouro.com/finops/v1
        description: Sandbox
    post:
      tags:
        - Receivables
      summary: Export receivables
      description: >-
        Start a CSV export of the invoices that match the given filters.


        The export accepts the same query parameters as `GET /receivables`
        (filters, `sort` and `order`), so the current list query can be sent
        unchanged; `limit` and `pagination_token` are ignored. Only invoices are
        exported: `type` must be omitted or `invoice`. The file holds one row
        per line item (an invoice without line items is one row) and may contain
        at most 100000 rows.


        The export runs in the background. Poll `GET /data-exports/{id}` for its
        status and, once it has succeeded, `GET /data-exports/{id}/download` for
        a download link. Dates are in UTC.
      operationId: post_receivables_export
      parameters:
        - required: true
          schema:
            type: string
            format: date
          example: '2025-06-23'
          name: x-finops-version
          in: header
        - name: sort
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ReceivableCursorFields'
              - type: 'null'
          description: >-
            The field to sort the results by. Typically used together with the
            `order` parameter.
        - name: order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/OrderEnum'
            default: asc
          description: >-
            Sort order (ascending by default). Typically used together with the
            `sort` parameter.
        - name: id__in
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                  format: uuid
                type: array
              - type: 'null'
          description: >-
            Return only receivables with the specified IDs. Valid but
            nonexistent IDs do not raise errors but produce no results.


            To specify multiple IDs, repeat this parameter for each value:

            `id__in=<id1>&id__in=<id2>`
        - name: counterpart_id__in
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                  format: uuid
                type: array
              - type: 'null'
          description: >-
            Return only receivables created for the counterparts with the
            specified IDs.


            To specify multiple IDs, repeat this parameter for each value:

            `counterpart_id__in=<id1>&counterpart_id__in=<id2>`


            Valid but nonexistent IDs do not raise errors but produce no
            results.
        - name: status__in
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
                  enum:
                    - draft
                    - issued
                    - failed
                    - accepted
                    - expired
                    - declined
                    - recurring
                    - partially_paid
                    - paid
                    - overdue
                    - uncollectible
                    - canceled
              - type: 'null'
          description: >-
            Return only receivables that have the specified statuses. See the
            applicable [invoice
            statuses](https://docs.tesouro.com/finops/guides/accounts-receivable/invoices),
            [quote
            statuses](https://docs.tesouro.com/finops/guides/accounts-receivable/quotes),
            and [credit note
            statuses](https://docs.tesouro.com/finops/guides/accounts-receivable/credit-notes#credit-note-lifecycle).


            To specify multiple statuses, repeat this parameter for each value:

            `status__in=draft&status__in=issued`
        - name: entity_user_id__in
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                  format: uuid
                type: array
              - type: 'null'
          description: >-
            Return only receivables created by the entity users with the
            specified IDs.To specify multiple user IDs, repeat this parameter
            for each ID:

            `entity_user_id__in=<user1>&entity_user_id__in=<user2>`


            If the request is authenticated using an entity user token, this
            user must have the `receivable.read.allowed` (rather than
            `allowed_for_own`) permission to be able to query receivables
            created by other users.


            IDs of deleted users will still produce results here if those users
            had associated receivables. Valid but nonexistent user IDs do not
            raise errors but produce no results.
        - name: tag_ids__in
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                  format: uuid
                type: array
              - type: 'null'
          description: >-
            Return only receivables whose
            [tags](https://docs.tesouro.com/finops/guides/common/tags) include
            at least one of the tags with the specified IDs.


            For example, given receivables with the following tags:

            1. tagA

            2. tagB

            3. tagA, tagB

            4. tagC

            5. tagB, tagC



            `tag_ids__in=<tagA>&tag_ids__in=<tagB>` will return receivables 1,
            2, 3, and 5.


            Valid but nonexistent tag IDs do not raise errors but produce no
            results.
        - name: tag_ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                  format: uuid
                type: array
              - type: 'null'
          description: >-
            Return only receivables whose
            [tags](https://docs.tesouro.com/finops/guides/common/tags) include
            all of the tags with the specified IDs and optionally other tags
            that are not specified.


            For example, given receivables with the following tags:

            1. tagA

            2. tagB

            3. tagA, tagB

            4. tagC

            5. tagA, tagB, tagC



            `tag_ids=<tagA>&tag_ids=<tagB>` will return receivables 3 and 5.
        - name: product_ids__in
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                  format: uuid
                type: array
              - type: 'null'
          description: >-
            Return only receivables whose line items include at least one of the
            product IDs with the specified IDs. 


            To specify multiple product IDs, repeat this parameter for each ID:

            `product_ids__in=<product1>&product_ids__in=<product2>`


            For example, given receivables with the following product IDs:

            1. productA

            2. productB

            3. productA, productB

            4. productC

            5. productB, productC



            `product_ids__in=<productA>&product_ids__in=<productB>` will return
            receivables 1, 2, 3, and 5.Valid but nonexistent product IDs do not
            raise errors but produce no results.
        - name: product_ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                  format: uuid
                type: array
              - type: 'null'
          description: >+
            Return only receivables whose line items include all of the product
            IDs with the specified IDs and optionally other products that are
            not specified. 


            To specify multiple product IDs, repeat this parameter for each ID:

            `product_ids=<product1>&product_ids=<product2>`


            For example, given receivables with the following product IDs:

            1. productA

            2. productB

            3. productA, productB

            4. productC

            5. productA, productB, productC



            `product_ids=<productA>&product_ids=<productB>` will return
            receivables 3 and 5.

        - name: project_id__in
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                  format: uuid
                type: array
              - type: 'null'
          description: >-
            Return only receivables whose `project_id` include at least one of
            the project_id with the specified IDs. Valid but nonexistent project
            IDs do not raise errors but produce no results.
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ReceivableType'
              - type: 'null'
        - name: bank_account_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/BankAccountTypeEnum'
              - type: 'null'
        - name: document_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: document_id__contains
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: document_id__icontains
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: issue_date__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: issue_date__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: issue_date__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: issue_date__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: created_at__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: created_at__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: created_at__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: created_at__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: paid_at__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: paid_at__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
        - name: counterpart_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
        - name: counterpart_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: counterpart_name__contains
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: counterpart_name__icontains
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: total_amount
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: total_amount__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: total_amount__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: total_amount__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: total_amount__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: discounted_subtotal
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: discounted_subtotal__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: discounted_subtotal__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: discounted_subtotal__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: discounted_subtotal__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - draft
                  - issued
                  - failed
                  - accepted
                  - expired
                  - declined
                  - recurring
                  - partially_paid
                  - paid
                  - overdue
                  - uncollectible
                  - canceled
              - type: 'null'
        - name: entity_user_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
        - name: based_on
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
        - name: due_date__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
        - name: due_date__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
        - name: due_date__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
        - name: due_date__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
        - name: has_due_date
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
        - name: project_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
        - name: search_text
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: x-organization-id
          in: header
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - 9d2b4c8f-2087-4738-ba91-7359683c49a4
          description: The ID of the entity that owns the requested resource.
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReceivablesExportResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '409':
          description: >-
            Possible responses: `Action for {object_type} at permissions not
            found: {action}`,`Object type at permissions not found:
            {object_type}`,`Action {action} for {object_type} not allowed`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '503':
          description: The export could not be started. Try again later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ReceivableCursorFields:
      type: string
      enum:
        - counterpart_name
        - counterpart_id
        - amount
        - total_amount
        - discounted_subtotal
        - status
        - due_date
        - issue_date
        - document_id
        - created_at
        - project_id
    OrderEnum:
      type: string
      enum:
        - asc
        - desc
    ReceivableType:
      type: string
      enum:
        - quote
        - invoice
        - credit_note
    BankAccountTypeEnum:
      type: string
      enum:
        - INTERNAL
        - EXTERNAL
        - BANK_DETAILS
    ReceivablesExportResponse:
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The ID of the created export. Poll `GET /data-exports/{id}` for its
            status and download link.
      additionalProperties: false
      type: object
      required:
        - id
    ErrorSchemaResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorSchema'
      type: object
      required:
        - error
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    ErrorSchema:
      properties:
        message:
          type: string
      type: object
      required:
        - message
    ValidationError:
      properties:
        ctx:
          type: object
        input: {}
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
      type: object
      required:
        - loc
        - msg
        - type
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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