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

# Search Invoices

> Search for invoices by source system and source system ID



## OpenAPI

````yaml /api-reference/openapi.json post /api/rest/invoices/search
openapi: 3.1.0
info:
  description: >-
    Upwell is Accounts Receivable automation software for the logistics
    industry. We serve freight brokers, carriers, factors, and anyone who needs
    to get transportation invoices paid.


    Learn more at:


    - [Upwell.com](https://upwell.com)
  title: Upwell REST API
  version: 3.30.2
  termsOfService: https://upwell.com/legal
  contact:
    name: Upwell
    url: https://upwell.com
    email: contact@upwell.com
servers:
  - url: https://api.upwell.com
    description: Production server
  - url: https://staging.api.upwell.com
    description: Staging server
security: []
tags:
  - name: Invoice Approval
    description: Endpoints for managing customer invoice approval workflow
paths:
  /api/rest/invoices/search:
    post:
      tags:
        - Invoices
      summary: Search Invoices
      description: Search for invoices by source system and source system ID
      parameters:
        - description: >-
            Your API key will be used for authentication of the request.
            `Authorization: YOUR_API_KEY`
          in: header
          name: authorization
          schema:
            type: string
        - in: query
          name: limit
          schema:
            default: 10
            type: integer
        - in: query
          name: offset
          schema:
            default: 0
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              properties:
                limit:
                  default: 10
                  nullable: true
                  title: Int
                  type: integer
                offset:
                  default: 0
                  nullable: true
                  title: Int
                  type: integer
                orderBy:
                  default: []
                  items:
                    type: object
                    description: InvoicesOrderBy (simplified)
                  nullable: true
                  type: array
                where:
                  default: {}
                  description: >-
                    Boolean expression to filter rows from the table "invoices".
                    All fields are combined with a logical 'AND'.
                  nullable: true
                  properties:
                    _and:
                      items:
                        type: object
                        description: InvoicesBoolExp (simplified)
                      nullable: true
                      type: array
                    _not:
                      type: object
                      description: InvoicesBoolExp (simplified)
                    _or:
                      items:
                        type: object
                        description: InvoicesBoolExp (simplified)
                      nullable: true
                      type: array
                    approvedToSend:
                      type: object
                      description: BooleanComparisonExp (simplified)
                    balance:
                      type: object
                      description: BigintComparisonExp (simplified)
                    billOfLadingNumber:
                      type: object
                      description: StringComparisonExp (simplified)
                    billToCustomer:
                      type: object
                      description: CustomersBoolExp (simplified)
                    billToCustomerId:
                      type: object
                      description: StringComparisonExp (simplified)
                    carrierProNumber:
                      type: object
                      description: StringComparisonExp (simplified)
                    checkOrAchNumber:
                      type: object
                      description: StringComparisonExp (simplified)
                    companyDivision:
                      type: object
                      description: StringComparisonExp (simplified)
                    computedDaysOverdue:
                      type: object
                      description: IntComparisonExp (simplified)
                    computedDisplayStatus:
                      type: object
                      description: StringComparisonExp (simplified)
                    computedInvoiceDetails:
                      type: object
                      description: JsonbComparisonExp (simplified)
                    computedMissingDocuments:
                      type: object
                      description: StringComparisonExp (simplified)
                    computedPortalSlug:
                      type: object
                      description: StringComparisonExp (simplified)
                    createdAt:
                      type: object
                      description: TimestamptzComparisonExp (simplified)
                    createdFromEmailMessage:
                      type: object
                      description: EmailMessagesBoolExp (simplified)
                    createdFromEmailMessageId:
                      type: object
                      description: StringComparisonExp (simplified)
                    currency:
                      type: object
                      description: CurrencyCodeEnumComparisonExp (simplified)
                    customer:
                      type: object
                      description: CustomersBoolExp (simplified)
                    customerId:
                      type: object
                      description: StringComparisonExp (simplified)
                    customerPoNumber:
                      type: object
                      description: StringComparisonExp (simplified)
                    customerReferenceNumber:
                      type: object
                      description: StringComparisonExp (simplified)
                    debits:
                      type: object
                      description: DebitsBoolExp (simplified)
                    debitsAggregate:
                      type: object
                      description: DebitsAggregateBoolExp (simplified)
                    debitsUpdatedAt:
                      type: object
                      description: TimestampComparisonExp (simplified)
                    deliveryDate:
                      type: object
                      description: DateComparisonExp (simplified)
                    deliveryMethods:
                      type: object
                      description: StringArrayComparisonExp (simplified)
                    documentExceptions:
                      type: object
                      description: JsonbComparisonExp (simplified)
                    dueDate:
                      type: object
                      description: DateComparisonExp (simplified)
                    eval:
                      type: object
                      description: EvalsBoolExp (simplified)
                    exceptions:
                      type: object
                      description: ExceptionsBoolExp (simplified)
                    exceptionsAggregate:
                      type: object
                      description: ExceptionsAggregateBoolExp (simplified)
                    externallyManaged:
                      type: object
                      description: BooleanComparisonExp (simplified)
                    fileAssociations:
                      type: object
                      description: FileAssociationsBoolExp (simplified)
                    fileAssociationsAggregate:
                      type: object
                      description: FileAssociationsAggregateBoolExp (simplified)
                    fileAssociationsUpdatedAt:
                      type: object
                      description: TimestampComparisonExp (simplified)
                    finalCheckPassedAt:
                      type: object
                      description: TimestamptzComparisonExp (simplified)
                    holdForReview:
                      type: object
                      description: BooleanComparisonExp (simplified)
                    id:
                      type: object
                      description: StringComparisonExp (simplified)
                    invoiceActivities:
                      type: object
                      description: InvoiceActivityBoolExp (simplified)
                    invoiceActivitiesAggregate:
                      type: object
                      description: InvoiceActivityAggregateBoolExp (simplified)
                    invoiceCreationEvent:
                      type: object
                      description: InvoiceCreationEventsBoolExp (simplified)
                    invoiceCreationEventId:
                      type: object
                      description: StringComparisonExp (simplified)
                    invoiceErrors:
                      type: object
                      description: InvoiceErrorsBoolExp (simplified)
                    invoiceErrorsAggregate:
                      type: object
                      description: InvoiceErrorsAggregateBoolExp (simplified)
                    invoiceLineItems:
                      type: object
                      description: InvoiceLineItemsBoolExp (simplified)
                    invoiceLineItemsAggregate:
                      type: object
                      description: InvoiceLineItemsAggregateBoolExp (simplified)
                    invoicePriorityActions:
                      type: object
                      description: InvoicePriorityActionsBoolExp (simplified)
                    invoicePriorityActionsAggregate:
                      type: object
                      description: InvoicePriorityActionsAggregateBoolExp (simplified)
                    invoiceShipments:
                      type: object
                      description: InvoiceShipmentsBoolExp (simplified)
                    invoiceShipmentsAggregate:
                      type: object
                      description: InvoiceShipmentsAggregateBoolExp (simplified)
                    invoiceSnooze:
                      type: object
                      description: InvoiceSnoozesBoolExp (simplified)
                    invoiceSnoozes:
                      type: object
                      description: InvoiceSnoozesBoolExp (simplified)
                    invoiceSnoozesAggregate:
                      type: object
                      description: InvoiceSnoozesAggregateBoolExp (simplified)
                    issueDate:
                      type: object
                      description: DateComparisonExp (simplified)
                    lastUpdatedByEmailMessageId:
                      type: object
                      description: StringComparisonExp (simplified)
                    lineItemsLastUpdatedAt:
                      type: object
                      description: TimestamptzComparisonExp (simplified)
                    listBillDeliveryInvoices:
                      type: object
                      description: ListBillDeliveryInvoicesBoolExp (simplified)
                    listBillDeliveryInvoicesAggregate:
                      type: object
                      description: ListBillDeliveryInvoicesAggregateBoolExp (simplified)
                    metadata:
                      type: object
                      description: JsonbComparisonExp (simplified)
                    notes:
                      type: object
                      description: NotesBoolExp (simplified)
                    notesAggregate:
                      type: object
                      description: NotesAggregateBoolExp (simplified)
                    number:
                      type: object
                      description: StringComparisonExp (simplified)
                    paidDate:
                      type: object
                      description: TimestamptzComparisonExp (simplified)
                    paymentLineItems:
                      type: object
                      description: PaymentLineItemsBoolExp (simplified)
                    paymentLineItemsAggregate:
                      type: object
                      description: PaymentLineItemsAggregateBoolExp (simplified)
                    portalException:
                      type: object
                      description: StringComparisonExp (simplified)
                    portalInvoiceStatuses:
                      type: object
                      description: PortalInvoiceStatusesBoolExp (simplified)
                    portalInvoiceStatusesAggregate:
                      type: object
                      description: PortalInvoiceStatusesAggregateBoolExp (simplified)
                    portalSlug:
                      type: object
                      description: StringComparisonExp (simplified)
                    receivedAt:
                      type: object
                      description: TimestampComparisonExp (simplified)
                    receivedFromPortalSlug:
                      type: object
                      description: StringComparisonExp (simplified)
                    referenceNumbers:
                      type: object
                      description: JsonbComparisonExp (simplified)
                    reminders:
                      type: object
                      description: RemindersBoolExp (simplified)
                    remindersAggregate:
                      type: object
                      description: RemindersAggregateBoolExp (simplified)
                    remittance_line_item:
                      type: object
                      description: RemittanceLineItemsBoolExp (simplified)
                    scacCode:
                      type: object
                      description: StringComparisonExp (simplified)
                    scheduledPaymentDate:
                      type: object
                      description: DateComparisonExp (simplified)
                    sentAt:
                      type: object
                      description: TimestampComparisonExp (simplified)
                    sentToPortalSlug:
                      type: object
                      description: StringComparisonExp (simplified)
                    shipDate:
                      type: object
                      description: DateComparisonExp (simplified)
                    sourceSystem:
                      type: object
                      description: StringComparisonExp (simplified)
                    sourceSystemId:
                      type: object
                      description: StringComparisonExp (simplified)
                    sourceSystemMeta:
                      type: object
                      description: JsonbComparisonExp (simplified)
                    splitLineage:
                      type: object
                      description: InvoiceSplitLineageBoolExp (simplified)
                    statement:
                      type: object
                      description: StatementsBoolExp (simplified)
                    statementId:
                      type: object
                      description: StringComparisonExp (simplified)
                    statements:
                      type: object
                      description: StatementsBoolExp (simplified)
                    statementsAggregate:
                      type: object
                      description: StatementsAggregateBoolExp (simplified)
                    status:
                      type: object
                      description: InvoiceStatusEnumComparisonExp (simplified)
                    supportingDocPacketBuiltAgainstAt:
                      type: object
                      description: TimestampComparisonExp (simplified)
                    supportingDocPacketIsCurrent:
                      type: object
                      description: BooleanComparisonExp (simplified)
                    totalAmount:
                      type: object
                      description: BigintComparisonExp (simplified)
                    totalTaxAmount:
                      type: object
                      description: BigintComparisonExp (simplified)
                    updatedAt:
                      type: object
                      description: TimestamptzComparisonExp (simplified)
                  title: InvoicesBoolExp
                  type: object
                sourceSystem:
                  title: Source System
                  type: string
                  description: The source system identifier
                sourceSystemId:
                  title: Source System ID
                  type: string
                  description: The ID of the invoice in the source system
              type: object
              required:
                - sourceSystem
                - sourceSystemId
        description: >-
          Query parameters can also be provided in the request body as a JSON
          object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  invoices:
                    items:
                      description: columns and relationships of "invoices"
                      nullable: false
                      properties:
                        balance:
                          $ref: '#/components/schemas/bigint'
                        customer:
                          description: columns and relationships of "customers"
                          nullable: true
                          properties:
                            id:
                              nullable: false
                              title: String
                              type: string
                            name:
                              nullable: true
                              title: String
                              type: string
                          title: Customers
                          type: object
                        customerId:
                          nullable: true
                          title: String
                          type: string
                        dueDate:
                          $ref: '#/components/schemas/date'
                        id:
                          nullable: false
                          title: String
                          type: string
                        invoiceLineItems:
                          items:
                            description: columns and relationships of "invoice_line_items"
                            nullable: false
                            properties:
                              createdAt:
                                $ref: '#/components/schemas/timestamptz'
                              description:
                                nullable: true
                                title: String
                                type: string
                              id:
                                nullable: false
                                title: String
                                type: string
                              item:
                                nullable: true
                                title: String
                                type: string
                              lineNumber:
                                nullable: true
                                title: String
                                type: string
                              quantity:
                                $ref: '#/components/schemas/numeric'
                              sourceSystem:
                                nullable: true
                                title: String
                                type: string
                              sourceSystemId:
                                nullable: true
                                title: String
                                type: string
                              totalAmount:
                                nullable: true
                                title: Int
                                type: integer
                              unitPrice:
                                nullable: true
                                title: Int
                                type: integer
                              updatedAt:
                                $ref: '#/components/schemas/timestamptz'
                            title: InvoiceLineItems
                            type: object
                          nullable: false
                          type: array
                        issueDate:
                          $ref: '#/components/schemas/date'
                        number:
                          nullable: false
                          title: String
                          type: string
                        sourceSystem:
                          nullable: true
                          title: String
                          type: string
                        sourceSystemId:
                          nullable: true
                          title: String
                          type: string
                        status:
                          $ref: '#/components/schemas/InvoiceStatusEnum'
                        totalAmount:
                          $ref: '#/components/schemas/bigint'
                        invoiceNumber:
                          nullable: true
                          title: String
                          type: string
                        createdAt:
                          $ref: '#/components/schemas/timestamptz'
                        updatedAt:
                          $ref: '#/components/schemas/timestamptz'
                      title: Invoices
                      type: object
                    nullable: false
                    type: array
          description: Responses for POST /api/rest/invoices/search
components:
  schemas:
    bigint:
      nullable: false
      title: bigint
    date:
      nullable: false
      title: date
      type: string
      format: date
      description: A date string, such as 2024-02-03 (YYYY-MM-DD)
    timestamptz:
      nullable: false
      title: timestamptz
      type: string
      format: date-time
      description: >-
        A timestamp with timezone in ISO 8601 format, such as
        2024-12-16T21:57:14.525733+00:00
    numeric:
      nullable: false
      title: numeric
    InvoiceStatusEnum:
      enum:
        - APPROVED
        - CANCELLED
        - CREATED
        - DELIVERED
        - DISPUTED
        - DRAFT
        - OPEN
        - OVERDUE
        - PAID
        - PART_PAID
        - PORTAL_EXCEPTION
        - PORTAL_RESOLVED
        - PROCESSING
        - REFUNDED
        - REJECTED
        - SEND_ERROR
        - SENT
        - VIEWED
        - WRITE_OFF
      nullable: false
      title: InvoiceStatusEnum

````