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

# Get expenses for a company

> By default does not return expenses with Transaction State AUTHORIZATION or AUTHORIZATION_REVERSAL.



## OpenAPI

````yaml get /expenses
openapi: 3.0.0
info:
  description: Pleo.io API
  version: 0.0.1
  title: Pleo.io API
servers:
  - url: https://openapi.pleo.io/v1/
    description: Production
  - url: https://openapi.staging.pleo.io/v1/
    description: Staging
security:
  - BearerToken: []
tags: []
paths:
  /expenses:
    get:
      tags:
        - Expenses
      summary: Get expenses for a company
      description: >-
        By default does not return expenses with Transaction State AUTHORIZATION
        or AUTHORIZATION_REVERSAL.
      operationId: getExpenses
      parameters:
        - name: pageOffset
          in: query
          required: false
          schema:
            type: number
            example: '150'
          description: >-
            This is the pagination offset value. The record number you would
            like to start from. This offset value starts at 0.
        - name: pageSize
          in: query
          required: false
          schema:
            type: number
            example: '10'
          description: The number of expenses to return for each page.
        - name: dateFrom
          in: query
          required: false
          schema:
            type: string
            example: '2021-02-10T14:00:00.000Z'
            format: date-time
          description: >-
            Date and time to start the expense search from. Format is:
            YYYY-MM-DDTHH:mi:ss.SSSZ
        - name: dateTo
          in: query
          required: false
          schema:
            type: string
            example: '2021-02-10T19:00:00.000Z'
            format: date-time
          description: >-
            Date and time to start the expense search from. Format is:
            YYYY-MM-DDTHH:mi:ss.SSSZ
        - name: types
          in: query
          required: false
          schema:
            type: array
            example: '["CARD", "MANUAL_TRANSFER"]'
            items:
              type: string
              enum:
                - CARD
                - PERSONAL_TRANSFER
                - BILL_INVOICE
                - LOAD
                - MANUAL
                - MANUAL_TRANSFER
                - PLEO_INVOICE
                - EMPLOYEE_BANK_TRANSFER
                - CASHBACK
            uniqueItems: true
          description: An array of the expense types to filter on.
        - name: accountId
          in: query
          required: false
          schema:
            type: string
            example: 0f0e000-000d-0d00-000b-00db0d000fae
          description: >-
            Unique UUID of the expense category account to filter the expenses
            by.
        - name: tagId
          in: query
          required: false
          schema:
            type: string
            example: 0f0e000-000d-0d00-000b-00db0d000fae
          description: >-
            Unique UUID of the tag the expense belongs to, to filter the
            expenses by.
        - name: transactionStates
          in: query
          required: false
          schema:
            type: array
            example: '["AUTHORIZATION", "PRESENTMENT"]'
            items:
              type: string
              enum:
                - AUTHORIZATION
                - AUTHORIZATION_REVERSAL
                - CHARGE_BACK
                - CHARGE_BACK_REVERSAL
                - PRESENTMENT
                - SECOND_PRESENTMENT
                - REFUND
                - LOAD
                - UNLOAD
                - FAILED
            uniqueItems: true
          description: An array of transaction states to filter the expenses by.
        - name: status
          in: query
          required: false
          schema:
            type: array
            example: '["NOT_EXPORTED", "EXPORTED"]'
            items:
              type: string
              enum:
                - NOT_EXPORTED
                - QUEUED
                - EXPORTING
                - EXPORTED
            uniqueItems: true
          description: An array of the export status to filter on.
      responses:
        '200':
          description: Expenses have been returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpensesResponse'
        '401':
          description: request unauthorized
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/DefaultUnauthorizedResponse'
        '403':
          description: Request forbidden; user has insufficient rights to a resource.
          content:
            application/json; charset=utf-8:
              schema:
                $ref: '#/components/schemas/DefaultForbiddenResponse'
        '404':
          description: route not found
          content:
            application/json; charset=utf-8:
              example: route not found
        '500':
          description: >-
            Something went wrong. Please contact the administrator if problems
            persist.
          content:
            application/json; charset=utf-8:
              example: >-
                Something went wrong. Please contact the administrator if
                problems persist.
      deprecated: true
components:
  schemas:
    ExpensesResponse:
      type: object
      properties:
        expenses:
          type: array
          description: A list of expenses fetched for the requested page
          items:
            type: object
            properties:
              id:
                type: string
                description: The unique UUID identifier of the expense
              employeeId:
                type: string
                description: >-
                  Unique UUID identifier of the employee that performed the
                  expense
              employeeCode:
                type: string
                description: External identifier of the employee that performed the expense
              departmentId:
                type: string
                description: >-
                  Unique UUID identifier of the department for which the
                  employee executing the expense belongs to
              performedAt:
                type: string
                description: >-
                  The date the expense was performed in the format
                  YYYY-MM-DDTHH:mi:ss.SSSZ
                format: date-time
              amountOriginal:
                type: object
                description: The amount and currency the transaction was originally in
                properties:
                  value:
                    type: number
                  currency:
                    type: string
                    description: 3-Letter currency code
                required:
                  - value
                  - currency
              amountSettled:
                type: object
                description: The settlement amount and currency
                properties:
                  value:
                    type: number
                  currency:
                    type: string
                    description: 3-Letter currency code
                required:
                  - value
                  - currency
              note:
                type: string
                description: >-
                  Additional comments on the expense added to enhance the
                  purpose of the expense
              type:
                type: string
                description: The type of this expense.
                enum:
                  - CARD
                  - PERSONAL_TRANSFER
                  - BILL_INVOICE
                  - LOAD
                  - MANUAL
                  - MANUAL_TRANSFER
                  - PLEO_INVOICE
                  - EMPLOYEE_BANK_TRANSFER
                  - CASHBACK
              cardTransaction:
                type: object
                description: >-
                  This is the card transaction details of this expense
                  specifically related CARD expense types.
                properties:
                  state:
                    type: string
                    description: This is the transaction state of this card transaction.
                    enum:
                      - AUTHORIZATION
                      - AUTHORIZATION_REVERSAL
                      - CHARGE_BACK
                      - CHARGE_BACK_REVERSAL
                      - PRESENTMENT
                      - SECOND_PRESENTMENT
                      - REFUND
                      - LOAD
                      - UNLOAD
                      - FAILED
                  authorizedAt:
                    type: string
                    description: >-
                      Date and time the transaction was authorized in the format
                      YYYY-MM-DDTHH:mi:ss.SSSZ.
                    format: date-time
                  settledAt:
                    type: string
                    description: >-
                      Date and time the transaction was settled in the pleo
                      wallet currency in the format YYYY-MM-DDTHH:mi:ss.SSSZ.
                    format: date-time
                  reversedAt:
                    type: string
                    description: >-
                      Date and time the transaction was reversed if the
                      transaction is in a reversal state in the format
                      YYYY-MM-DDTHH:mi:ss.SSSZ.
                    format: date-time
                  merchant:
                    type: object
                    description: Merchant the transaction was executed at
                    properties:
                      id:
                        type: string
                        description: Merchant payment processor merchant identifier
                      name:
                        type: string
                        description: Name of the merchant
                    required:
                      - name
                required:
                  - state
                  - merchant
              accountId:
                type: string
                description: >-
                  This is the UUID pleo accounting category identifier for this
                  expense, e.g. entertainment, travel etc.
              taxCodeId:
                type: string
                description: This is the UUID tax code identifier for this expense
              tagIds:
                type: array
                description: >-
                  These are additional accounting-related information pertaining
                  to the expense, these are usually extracted from the external
                  accounting system.
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: This is the UUID of the tag attached to the expense
                    tagGroupId:
                      type: string
                      description: >-
                        UUID for the tag group to which expense tags are
                        attached
              lines:
                type: array
                description: >-
                  This is a breakdown of the expense lines for this expense,
                  could also be potentially empty for non-card related expenses
                items:
                  type: object
                  properties:
                    amountSettled:
                      type: object
                      description: >-
                        The breakdown settlement amount and currency for this
                        expense line
                      properties:
                        value:
                          type: number
                        currency:
                          type: string
                          description: 3-Letter currency code
                      required:
                        - value
                        - currency
                    accountId:
                      type: string
                      description: >-
                        This is the UUID pleo accounting category identifier for
                        this expense line, e.g. entertainment, travel etc.
                    taxCodeId:
                      type: string
                      description: >-
                        This is the UUID tax code identifier for this expense
                        line
                    tagIds:
                      type: array
                      description: >-
                        These are additional accounting-related information
                        pertaining to the expense, these are usually extracted
                        from the external accounting system.
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            description: >-
                              This is the UUID of the tag attached to the
                              expense
                          tagGroupId:
                            type: string
                            description: >-
                              UUID for the tag group to which expense tags are
                              attached
                  required:
                    - amountSettled
              receiptIds:
                type: array
                description: >-
                  Unique identifiers (UUIDs) for the receipts attached to this
                  expense
                items:
                  type: string
              settledExpenseIds:
                type: array
                description: >-
                  Unique identifiers (UUIDs) of the related settled Expenses in
                  case the expense is a reimbursement of *TRANSFER family
                items:
                  type: string
              status:
                type: string
                description: This is related to export status information
                enum:
                  - NOT_EXPORTED
                  - QUEUED
                  - EXPORTING
                  - EXPORTED
              supplier:
                type: object
                description: Expense supplier information.
                properties:
                  CIF:
                    type: string
                    description: CIF code of the expense
                  documentNumber:
                    type: string
                    description: Document number of the expense
              createdAt:
                type: string
                description: >-
                  Date and time this record was created in the pleo system in
                  the format YYYY-MM-DDTHH:mi:ss.SSSZ
                format: date-time
              updatedAt:
                type: string
                description: >-
                  Date and time this record was last updated in the pleo system
                  in the format YYYY-MM-DDTHH:mi:ss.SSSZ
                format: date-time
              deletedAt:
                type: string
                description: >-
                  Date and time this record was deleted in the pleo system in
                  the format YYYY-MM-DDTHH:mi:ss.SSSZ
                format: date-time
            required:
              - id
              - performedAt
              - amountOriginal
              - type
              - lines
              - status
              - createdAt
              - updatedAt
        metadata:
          type: object
          description: Additional metadata including pagination information
          properties:
            pageInfo:
              type: object
              description: Pagination information.
              properties:
                nextPageOffset:
                  type: number
                  description: >-
                    The row number that should be used in the next fetch for the
                    next page offset
                pageSize:
                  type: number
                  description: The number of items returned in this page
                totalCount:
                  type: number
                  description: >-
                    The total number of items mapped to the filter criteria
                    supplied
              required:
                - pageSize
                - totalCount
      required:
        - expenses
        - metadata
    DefaultUnauthorizedResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
          description: http response status code
        error:
          type: string
          example: Forbidden
          description: error type
        message:
          type: string
          example: user_scope_insufficient
          description: error message
    DefaultForbiddenResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 403
          description: http response status code
        error:
          type: string
          example: Forbidden
          description: error type
        message:
          type: string
          example: user_scope_insufficient
          description: error message
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      description: Open API Bearer token

````