Search for invoices

Search for invoices with search criteria and retrieve a paged list of invoices.

Valid filters are:

  • All valid parameters of /invoice/list
  • Filters specific to /invoice/search as detailed below. TODO

Pagination has the defaults as specified in its schema, but 'pagination' is an optional search request attribute! Filters can have three items that apply to pagination (Supported by /invoice/list and factored in for compatibility):

  • offset
  • limit
  • ignoreLimit The precedence of these filter items and pagination attributes are as follows:
  • No attributes from either set provided: Pagination defaults apply
  • No Pagination and some 'pagination' filters: Pagination defaults with overrides as follows when applicable: PageNumber: offset / ItemsPerPage TotalItems: limit if ignoreLimit==false else ItemsPerPage TotalPages: 1 ItemsPerPage: 20
  • Pagination provided: limit filters are completely ignored

NOTE: The following pattern in the request body/shape constitutes a request for "the default Pagination settings" and will cause 'limit' filters to be IGNORED because you are providing explicit Pagination: { "pagination": "" }

Filters:

  • Valid parameters of /invoice/list Examples: Include voided invoices:

    "filters": [
      {
        "type": "boolean",
        "field": "includevoided",
        "value": "true"
      }
    ]
    

    Multiple, specific invoices:

    "filters": [
      {
        "type": "list",
        "field": "invoiceids",
        "value": "A1A1A1A1A1A1A1A1,B2B2B2B2B2B2B2B2,C3C3C3C3C3C3C3C3"
      }
    ]
    

    Weak pagination via limit and offset:

    "filters": [
      {
        "type": "integer",
        "field": "limit",
        "value": "10"
      },
      {
        "type": "integer",
        "field": "offset",
        "value": "10"
      },
      {
        "type": "boolean",
        "field": "includevoided",
        "value": "true"
      }
    ]
    

    Better pagination:

    "filters": [
      {
        "type": "boolean",
        "field": "includevoided",
        "value": "true"
      }
    ],
    "pagination": {
      "TotalItems": 20,
      "ItemsPerPage": 10,
      "PageNumber": 2
    }
    
Securityapi_key or session_token
Request
Request Body schema: application/json

Search for invoices

asyncResult
boolean
Default: true

Turn on/off the asynchronous result set for this request if the timeout time is exceeded during the execution of this search.

Array of objects (FilterItem)
object (Pagination)
resultToken
string <= 256 characters /^.*$/

Optionally indicate on subsequent search request (typically with the same filters) where the search in the master list of invoices should be resumed.

searchStart
integer <int64> >= 0
Default: 0

Optionally indicate on subsequent search request (typically with the same filters) where the search in the master list of invoices should be resumed.

timeout
number <float> [ 1 .. 29 ]
Default: 19

Timeout in seconds for searching for invoices that meet the criteria. If the search exceeds this limit a Continuation response will be sent and optionally (if asyncResult == true and asynchronous results are availble) an asyncronous result set token.

Responses
200

An invoice list response

401

API key is missing or invalid

403

Request is completely forbidden. API not provided or method and or endpoint not supported

404

404 Not found

429

429 too many requests response

500

Service Error

default

unexpected error response

post/invoice/search
Request samples
application/json
{
  • "asyncResult": true,
  • "filters": [
    ],
  • "pagination": {
    },
  • "resultToken": "string",
  • "searchStart": 0,
  • "timeout": 19
}
Response samples
application/json
{
  • "code": "Success",
  • "message": "string",
  • "continuation": {
    },
  • "invoice_list": [
    ],
  • "pagination": {
    },
  • "parameters": { },
  • "result_token": "string",
  • "stats": { }
}
Copyright © RoadSync 2023. All right reserved.