> ## 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.

# Get OCR tasks



## OpenAPI

````yaml /.tooling/schemas/rest/tags/product-finops.json get /finops/v1/ocr-tasks
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 VAT IDs
  - name: Counterpart addresses
  - name: Counterpart bank accounts
  - name: Counterpart contacts
  - name: Counterparts
  - name: Credit notes
  - name: Custom tax rates
  - name: Delivery notes
  - name: Documents
  - name: Entities
  - name: Entity users
  - name: Events
  - name: Files
  - name: Identity
  - name: Ledger accounts
  - name: Mail templates
  - name: Mailbox domains
  - name: Mailboxes
  - name: Measure units
  - name: OCR
  - name: Overdue reminders
  - name: PDF templates
  - 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: Products
  - name: Projects
  - name: Purchase orders
  - name: Receipts
  - name: Receivables
  - name: Recurrences
  - name: Tags
  - name: Text templates
  - name: Transactions
  - name: VAT rates
  - name: Webhook deliveries
  - name: Webhook subscriptions
paths:
  /finops/v1/ocr-tasks:
    get:
      tags:
        - OCR
      summary: Get OCR tasks
      operationId: get_ocr-tasks
      parameters:
        - required: true
          schema:
            type: string
            format: date
          example: '2025-06-23'
          name: x-finops-version
          in: header
        - description: >-
            Sort order (ascending by default). Typically used together with the
            `sort` parameter.
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/OrderEnum'
            default: asc
          name: order
          in: query
        - description: >-
            The number of items (0 .. 100) to return in a single page of the
            response. The response may contain fewer items if it is the last or
            only page.
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 100
          name: limit
          in: query
        - description: >-
            A pagination token obtained from a previous call to this endpoint.
            Use it to get the next or previous page of results for your initial
            query. If `pagination_token` is specified, all other query
            parameters are ignored and inferred from the initial query.


            If not specified, the first page of results will be returned.
          required: false
          schema:
            type: string
          name: pagination_token
          in: query
        - description: >-
            The field to sort the results by. Typically used together with the
            `order` parameter.
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/CursorFields'
          name: sort
          in: query
        - description: >-
            Return only ocr tasks created after the specified date and time. The
            value must be in the ISO 8601 format
            YYYY-MM-DDThh:mm[:ss[.ffffff]][Z|±hh:mm].
          required: false
          schema:
            type: string
            format: date-time
          name: created_at__gt
          in: query
        - description: >-
            Return only ocr tasks created in Monite before the specified date
            and time.
          required: false
          schema:
            type: string
            format: date-time
          name: created_at__lt
          in: query
        - description: >-
            Return only ocr tasks created on or after the specified date and
            time.
          required: false
          schema:
            type: string
            format: date-time
          name: created_at__gte
          in: query
        - description: >-
            Return only ocr tasks created before or on the specified date and
            time.
          required: false
          schema:
            type: string
            format: date-time
          name: created_at__lte
          in: query
        - description: Return only ocr tasks that have the specified status.
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/OCRTaskStatus'
          name: status
          in: query
        - description: Return only OCR tasks related to documents of a specific type.
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/OCRDocumentTypeEnum'
          name: document_type
          in: query
        - description: >-
            Return only OCR tasks created by the specified source (internal or
            external).
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/OCRRequestSource'
          name: source
          in: query
        - description: >-
            Return only ocr tasks with 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>`
          required: false
          schema:
            items:
              type: string
              format: uuid
            type: array
          name: id__in
          in: query
        - description: The ID of the entity that owns the requested resource.
          required: false
          schema:
            type: string
            format: uuid
            examples:
              - 9d2b4c8f-2087-4738-ba91-7359683c49a4
          name: x-organization-id
          in: header
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OCRTasksPaginationResponse'
        '404':
          description: OCR request is not found
        '405':
          description: Method 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'
      security:
        - HTTPBearer: []
components:
  schemas:
    OrderEnum:
      type: string
      enum:
        - asc
        - desc
    CursorFields:
      type: string
      enum:
        - id
        - created_at
    OCRTaskStatus:
      type: string
      enum:
        - processing
        - success
        - error
    OCRDocumentTypeEnum:
      type: string
      enum:
        - invoice
        - credit_note
        - receipt
    OCRRequestSource:
      type: string
      enum:
        - internal
        - external
    OCRTasksPaginationResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/OcrTaskResponseSchema'
          type: array
        next_pagination_token:
          type: string
          description: >-
            A token that can be sent in the `pagination_token` query parameter
            to get the next page of results, or `null` if there is no next page
            (i.e. you've reached the last page).
        prev_pagination_token:
          type: string
          description: >-
            A token that can be sent in the `pagination_token` query parameter
            to get the previous page of results, or `null` if there is no
            previous page (i.e. you've reached the first page).
      type: object
      required:
        - data
      description: A paginated list of ocr requests.
    ErrorSchemaResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorSchema'
      type: object
      required:
        - error
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    OcrTaskResponseSchema:
      properties:
        id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        document_type:
          $ref: '#/components/schemas/OCRDocumentTypeEnum'
        recognized_data:
          anyOf:
            - $ref: '#/components/schemas/OCRInvoice'
            - $ref: '#/components/schemas/OCRCreditNote'
            - $ref: '#/components/schemas/OCRReceipt'
        source:
          $ref: '#/components/schemas/OCRRequestSource'
        status:
          $ref: '#/components/schemas/OCRTaskStatus'
      type: object
      required:
        - id
        - created_at
        - updated_at
        - status
        - source
    ErrorSchema:
      properties:
        message:
          type: string
      type: object
      required:
        - message
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
      type: object
      required:
        - loc
        - msg
        - type
    OCRInvoice:
      properties:
        amount_paid:
          type: number
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        document_number:
          type: string
        due_date:
          type: string
          format: date
        issue_date:
          type: string
          format: date
        line_items:
          items:
            $ref: '#/components/schemas/OCRLineItem'
          type: array
        payment_terms:
          type: string
        recipient:
          $ref: '#/components/schemas/OCRCounterpartDetails'
        sender:
          $ref: '#/components/schemas/OCRCounterpartDetails'
        subtotal:
          type: number
        tax_amount:
          type: number
        tax_rate:
          type: number
        total_amount:
          type: number
        type:
          type: string
          enum:
            - invoice
          default: invoice
      additionalProperties: false
      type: object
      required:
        - sender
        - recipient
    OCRCreditNote:
      properties:
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        document_number:
          type: string
        issue_date:
          type: string
          format: date
        line_items:
          items:
            $ref: '#/components/schemas/OCRLineItem'
          type: array
        original_invoice_number:
          type: string
        recipient:
          $ref: '#/components/schemas/OCRCounterpartDetails'
        sender:
          $ref: '#/components/schemas/OCRCounterpartDetails'
        subtotal:
          type: number
        tax_amount:
          type: number
        tax_rate:
          type: number
        total_amount:
          type: number
        type:
          type: string
          enum:
            - credit_note
          default: credit_note
      additionalProperties: false
      type: object
      required:
        - sender
        - recipient
        - line_items
    OCRReceipt:
      properties:
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        discount:
          type: number
        document_number:
          type: string
        issued_at:
          type: string
          format: date-time
        line_items:
          items:
            $ref: '#/components/schemas/OCRReceiptLineItem'
          type: array
        sender:
          $ref: '#/components/schemas/OCRCounterpartDetails'
        subtotal:
          type: number
        tax_amount:
          type: number
        tax_rate:
          type: number
        tax_type:
          type: string
        total_amount:
          type: number
        type:
          type: string
          enum:
            - receipt
          default: receipt
      additionalProperties: false
      type: object
      required:
        - line_items
        - sender
    CurrencyEnum:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SEK
        - SGD
        - SHP
        - SLE
        - SOS
        - SRD
        - SSP
        - SVC
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
    OCRLineItem:
      properties:
        description:
          type: string
        line_reference:
          type: string
        name:
          type: string
        quantity:
          type: number
        subtotal:
          type: number
        tax_amount:
          type: number
        tax_rate:
          type: number
        total_amount:
          type: number
        unit:
          type: string
        unit_price:
          type: number
      additionalProperties: false
      type: object
    OCRCounterpartDetails:
      properties:
        address:
          $ref: '#/components/schemas/OCRAddressDetails'
        bank_account:
          $ref: '#/components/schemas/OCRBankDetails'
        email:
          type: string
        name:
          type: string
        tax_number:
          type: string
        vat_number:
          type: string
      additionalProperties: false
      type: object
      required:
        - address
        - bank_account
    OCRReceiptLineItem:
      properties:
        description:
          type: string
        discount_amount:
          type: number
        line_reference:
          type: string
        name:
          type: string
        quantity:
          type: number
        subtotal:
          type: number
        tax_amount:
          type: number
        tax_rate:
          type: number
        total_amount:
          type: number
        unit:
          type: string
        unit_price:
          type: number
      additionalProperties: false
      type: object
    OCRAddressDetails:
      properties:
        city:
          type: string
        country:
          $ref: '#/components/schemas/AllowedCountries'
        postal_code:
          type: string
        state:
          type: string
        street_and_number:
          type: string
      additionalProperties: false
      type: object
    OCRBankDetails:
      properties:
        bank_account_number:
          type: string
        iban:
          type: string
        swift_bic:
          type: string
      additionalProperties: false
      type: object
    AllowedCountries:
      type: string
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - IC
        - CV
        - KY
        - CF
        - EA
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - SZ
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - AN
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MP
        - MK
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - SH
        - KN
        - LC
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SK
        - SI
        - SB
        - SO
        - ZA
        - SS
        - GS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - US
        - UM
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
        - BL
        - BQ
        - CW
        - MF
        - SX
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````