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

# Query entries

> Search the documents of one GOBL type using a filter expression.

Unlike the other entry endpoints, this reads an indexed copy of your
documents rather than the documents themselves, which is what makes
filtering and sorting on document fields possible. Two consequences are
worth knowing:

- Results are eventually consistent. A document created a moment ago may
  not appear yet. Each response carries a "watermark" giving the time of
  the most recent change reflected in it.
- The fields you may filter and sort on depend on the document type. They
  are listed in full under "Fields" below.

Set "schema" to the document type to search: `bill/delivery`, `bill/invoice`, `bill/order`, `bill/payment`, `bill/status`, `note/message`, `org/item`, `org/party`.

Filter terms are combined with AND. OR is accepted only between values of
a single field, which is how a set membership test is written. For
free-text searching across documents, use the search endpoint instead.

"AND" and "OR" are keywords and must be written in capitals; "and", "&&"
and "||" are not accepted. The whole filter must be URL-encoded, because
an unencoded "&" ends the parameter and the rest of the filter would be
silently dropped — a request carrying the leftovers is rejected rather
than answered with a wider result set than was asked for.

For example, invoices for one customer in the sales folder. Note that
curl's -G with --data-urlencode does the encoding for you:

    curl -G https://api.invopop.com/silo/v1/entries/query -H "Authorization: Bearer $TOKEN" --data-urlencode 'schema=bill/invoice' --data-urlencode 'filter=customer_tax_code = "X3157928M" AND folder = "sales"'

A tax code is stored without its country prefix, which is held separately
as supplier_country or customer_country. Filter on "X3157928M", not on
"ESX3157928M".

Page through results by passing the previous response's "next_cursor" as
"cursor". A cursor is only valid for the same schema, filter and
order_by, and only in the workspace that produced it.

## Fields

Fields available to `filter`, `order_by` and `fields`, for each of the 8 document types.

**Indexed** means the field has a database index behind it. Several of those indexes also lead with `folder`, so a filter that names only the indexed field cannot always use one — if a response comes back with a note about index coverage, adding `folder` to the filter will usually resolve it. Filtering on a field with no index at all is still allowed, but runs under a shorter time limit.

### Common to every document type

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `id` | uuid | `=` `!=` `in` | yes | yes |
| `rev` | string | *not filterable* | — | — |
| `rev_num` | int | *not filterable* | — | — |
| `folder` | key | `=` `!=` `in` | yes | yes |
| `state` | key | `=` `!=` `in` | yes | yes |
| `state_at` | timestamp | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `doc_schema` | string | `=` `!=` `in` | — | — |
| `env_schema` | string | `=` `!=` `in` | — | — |
| `entry_key` | string | `=` `!=` `in` | — | — |
| `version` | string | `=` `!=` `in` | — | — |
| `digest_alg` | string | *not filterable* | — | — |
| `digest_val` | string | `=` `!=` `in` `starts_with` | — | — |
| `tags` | strings | `:` | — | — |
| `signed` | bool | `=` `!=` | yes | — |
| `invalid` | bool | `=` `!=` | yes | — |
| `relations_hash` | int | *not filterable* | — | — |
| `files` | json | *not filterable* | — | — |
| `faults` | json | *not filterable* | — | — |
| `snippet` | json | *not filterable* | — | — |
| `created_at` | timestamp | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |
| `updated_at` | timestamp | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |
| `synced_at` | timestamp | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `doc_uuid` | uuid | `=` `!=` `in` | — | — |
| `related` | uuid | `:` | — | — |
| `related.self` | uuid | `:` | — | — |

> `folder` and `state` accept values defined by your own workspace: the folders you have created, and any custom states you have added to the built-in ones. Those values are workspace data rather than part of this schema, so they are not listed here.

### `bill/delivery`

Default order: `created_at desc`.

In addition to the common fields above:

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `type` | key | `=` `!=` `in` | yes | — |
| `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |
| `currency` | string | `=` `!=` `in` | yes | — |
| `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |
| `despatch_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `order_code` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |
| `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `supplier_country` | string | `=` `!=` `in` | yes | — |
| `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `customer_uuid` | uuid | `=` `!=` `in` | — | yes |
| `customer_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `customer_country` | string | `=` `!=` `in` | yes | — |
| `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `total` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `total_with_tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `related.supplier` | uuid | `:` | — | — |
| `related.customer` | uuid | `:` | — | — |
| `related.lines` | uuid | `:` | — | — |
| `related.lines.item` | uuid | `:` | — | — |

### `bill/invoice`

Default order: `created_at desc`.

In addition to the common fields above:

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `type` | key | `=` `!=` `in` | yes | — |
| `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |
| `currency` | string | `=` `!=` `in` | yes | — |
| `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |
| `order_code` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |
| `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `supplier_country` | string | `=` `!=` `in` | yes | — |
| `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `customer_uuid` | uuid | `=` `!=` `in` | — | yes |
| `customer_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `customer_country` | string | `=` `!=` `in` | yes | — |
| `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `total` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `total_with_tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `payable` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `preceding_series` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `preceding_code` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `preceding_uuid` | uuid | `=` `!=` `in` | — | yes |
| `related.supplier` | uuid | `:` | — | — |
| `related.customer` | uuid | `:` | — | — |
| `related.lines` | uuid | `:` | — | — |
| `related.lines.item` | uuid | `:` | — | — |
| `related.preceding` | uuid | `:` | — | — |

### `bill/order`

Default order: `created_at desc`.

In addition to the common fields above:

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `type` | key | `=` `!=` `in` | yes | — |
| `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |
| `currency` | string | `=` `!=` `in` | yes | — |
| `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |
| `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |
| `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `supplier_country` | string | `=` `!=` `in` | yes | — |
| `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `customer_uuid` | uuid | `=` `!=` `in` | — | yes |
| `customer_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `customer_country` | string | `=` `!=` `in` | yes | — |
| `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `total` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `total_with_tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `related.supplier` | uuid | `:` | — | — |
| `related.customer` | uuid | `:` | — | — |
| `related.lines` | uuid | `:` | — | — |
| `related.lines.item` | uuid | `:` | — | — |

### `bill/payment`

Default order: `created_at desc`.

In addition to the common fields above:

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `type` | key | `=` `!=` `in` | yes | — |
| `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |
| `method_keys` | strings | `:` | — | — |
| `currency` | string | `=` `!=` `in` | yes | — |
| `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |
| `value_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |
| `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `supplier_country` | string | `=` `!=` `in` | yes | — |
| `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `customer_uuid` | uuid | `=` `!=` `in` | — | yes |
| `customer_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `customer_country` | string | `=` `!=` `in` | yes | — |
| `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `total` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `related.supplier` | uuid | `:` | — | — |
| `related.customer` | uuid | `:` | — | — |

### `bill/status`

Default order: `created_at desc`.

In addition to the common fields above:

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `type` | key | `=` `!=` `in` | yes | — |
| `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |
| `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |
| `issue_time` | time | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |
| `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |
| `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `supplier_country` | string | `=` `!=` `in` | yes | — |
| `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `customer_uuid` | uuid | `=` `!=` `in` | — | yes |
| `customer_name` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | — | — |
| `customer_country` | string | `=` `!=` `in` | yes | — |
| `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains` | — | yes |
| `related.supplier` | uuid | `:` | — | — |
| `related.customer` | uuid | `:` | — | — |

### `note/message`

Default order: `created_at desc`.

In addition to the common fields above:

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `title` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |

### `org/item`

Default order: `created_at desc`.

In addition to the common fields above:

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `name` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |
| `currency` | string | `=` `!=` `in` | yes | — |
| `price` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

### `org/party`

Default order: `created_at desc`.

In addition to the common fields above:

| Field | Type | Operators | Sortable | Indexed |
| --- | --- | --- | --- | --- |
| `name` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |
| `alias` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |
| `country` | string | `=` `!=` `in` | yes | — |
| `tax_code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |




## OpenAPI

````yaml GET /silo/v1/entries/query
openapi: 3.0.0
info:
  contact:
    email: dev@invopop.com
    name: Invopop Developers
  description: >-
    Store and manage GOBL documents along with their attachments in "Silo
    Entries".
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  title: Silo Service API
  version: 1.0.0
servers:
  - description: production
    url: https://api.invopop.com
security:
  - authToken: []
paths:
  /silo/v1/entries/query:
    get:
      description: >
        Search the documents of one GOBL type using a filter expression.


        Unlike the other entry endpoints, this reads an indexed copy of your

        documents rather than the documents themselves, which is what makes

        filtering and sorting on document fields possible. Two consequences are

        worth knowing:


        - Results are eventually consistent. A document created a moment ago may
          not appear yet. Each response carries a "watermark" giving the time of
          the most recent change reflected in it.
        - The fields you may filter and sort on depend on the document type.
        They
          are listed in full under "Fields" below.

        Set "schema" to the document type to search: `bill/delivery`,
        `bill/invoice`, `bill/order`, `bill/payment`, `bill/status`,
        `note/message`, `org/item`, `org/party`.


        Filter terms are combined with AND. OR is accepted only between values
        of

        a single field, which is how a set membership test is written. For

        free-text searching across documents, use the search endpoint instead.


        "AND" and "OR" are keywords and must be written in capitals; "and", "&&"

        and "||" are not accepted. The whole filter must be URL-encoded, because

        an unencoded "&" ends the parameter and the rest of the filter would be

        silently dropped — a request carrying the leftovers is rejected rather

        than answered with a wider result set than was asked for.


        For example, invoices for one customer in the sales folder. Note that

        curl's -G with --data-urlencode does the encoding for you:

            curl -G https://api.invopop.com/silo/v1/entries/query -H "Authorization: Bearer $TOKEN" --data-urlencode 'schema=bill/invoice' --data-urlencode 'filter=customer_tax_code = "X3157928M" AND folder = "sales"'

        A tax code is stored without its country prefix, which is held
        separately

        as supplier_country or customer_country. Filter on "X3157928M", not on

        "ESX3157928M".


        Page through results by passing the previous response's "next_cursor" as

        "cursor". A cursor is only valid for the same schema, filter and

        order_by, and only in the workspace that produced it.


        ## Fields


        Fields available to `filter`, `order_by` and `fields`, for each of the 8
        document types.


        **Indexed** means the field has a database index behind it. Several of
        those indexes also lead with `folder`, so a filter that names only the
        indexed field cannot always use one — if a response comes back with a
        note about index coverage, adding `folder` to the filter will usually
        resolve it. Filtering on a field with no index at all is still allowed,
        but runs under a shorter time limit.


        ### Common to every document type


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `id` | uuid | `=` `!=` `in` | yes | yes |

        | `rev` | string | *not filterable* | — | — |

        | `rev_num` | int | *not filterable* | — | — |

        | `folder` | key | `=` `!=` `in` | yes | yes |

        | `state` | key | `=` `!=` `in` | yes | yes |

        | `state_at` | timestamp | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `doc_schema` | string | `=` `!=` `in` | — | — |

        | `env_schema` | string | `=` `!=` `in` | — | — |

        | `entry_key` | string | `=` `!=` `in` | — | — |

        | `version` | string | `=` `!=` `in` | — | — |

        | `digest_alg` | string | *not filterable* | — | — |

        | `digest_val` | string | `=` `!=` `in` `starts_with` | — | — |

        | `tags` | strings | `:` | — | — |

        | `signed` | bool | `=` `!=` | yes | — |

        | `invalid` | bool | `=` `!=` | yes | — |

        | `relations_hash` | int | *not filterable* | — | — |

        | `files` | json | *not filterable* | — | — |

        | `faults` | json | *not filterable* | — | — |

        | `snippet` | json | *not filterable* | — | — |

        | `created_at` | timestamp | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes
        |

        | `updated_at` | timestamp | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes
        |

        | `synced_at` | timestamp | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `doc_uuid` | uuid | `=` `!=` `in` | — | — |

        | `related` | uuid | `:` | — | — |

        | `related.self` | uuid | `:` | — | — |


        > `folder` and `state` accept values defined by your own workspace: the
        folders you have created, and any custom states you have added to the
        built-in ones. Those values are workspace data rather than part of this
        schema, so they are not listed here.


        ### `bill/delivery`


        Default order: `created_at desc`.


        In addition to the common fields above:


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `type` | key | `=` `!=` `in` | yes | — |

        | `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |

        | `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |

        | `currency` | string | `=` `!=` `in` | yes | — |

        | `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |

        | `despatch_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `order_code` | string | `=` `!=` `in` `starts_with` `contains` | — | —
        |

        | `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `supplier_country` | string | `=` `!=` `in` | yes | — |

        | `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `customer_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `customer_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `customer_country` | string | `=` `!=` `in` | yes | — |

        | `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `total` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `total_with_tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | —
        |

        | `related.supplier` | uuid | `:` | — | — |

        | `related.customer` | uuid | `:` | — | — |

        | `related.lines` | uuid | `:` | — | — |

        | `related.lines.item` | uuid | `:` | — | — |


        ### `bill/invoice`


        Default order: `created_at desc`.


        In addition to the common fields above:


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `type` | key | `=` `!=` `in` | yes | — |

        | `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |

        | `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |

        | `currency` | string | `=` `!=` `in` | yes | — |

        | `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |

        | `order_code` | string | `=` `!=` `in` `starts_with` `contains` | — | —
        |

        | `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `supplier_country` | string | `=` `!=` `in` | yes | — |

        | `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `customer_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `customer_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `customer_country` | string | `=` `!=` `in` | yes | — |

        | `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `total` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `total_with_tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | —
        |

        | `payable` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `preceding_series` | string | `=` `!=` `in` `starts_with` `contains` |
        — | — |

        | `preceding_code` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `preceding_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `related.supplier` | uuid | `:` | — | — |

        | `related.customer` | uuid | `:` | — | — |

        | `related.lines` | uuid | `:` | — | — |

        | `related.lines.item` | uuid | `:` | — | — |

        | `related.preceding` | uuid | `:` | — | — |


        ### `bill/order`


        Default order: `created_at desc`.


        In addition to the common fields above:


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `type` | key | `=` `!=` `in` | yes | — |

        | `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |

        | `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |

        | `currency` | string | `=` `!=` `in` | yes | — |

        | `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |

        | `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `supplier_country` | string | `=` `!=` `in` | yes | — |

        | `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `customer_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `customer_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `customer_country` | string | `=` `!=` `in` | yes | — |

        | `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `total` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `total_with_tax` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | —
        |

        | `related.supplier` | uuid | `:` | — | — |

        | `related.customer` | uuid | `:` | — | — |

        | `related.lines` | uuid | `:` | — | — |

        | `related.lines.item` | uuid | `:` | — | — |


        ### `bill/payment`


        Default order: `created_at desc`.


        In addition to the common fields above:


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `type` | key | `=` `!=` `in` | yes | — |

        | `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |

        | `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |

        | `method_keys` | strings | `:` | — | — |

        | `currency` | string | `=` `!=` `in` | yes | — |

        | `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |

        | `value_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `supplier_country` | string | `=` `!=` `in` | yes | — |

        | `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `customer_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `customer_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `customer_country` | string | `=` `!=` `in` | yes | — |

        | `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `total` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `related.supplier` | uuid | `:` | — | — |

        | `related.customer` | uuid | `:` | — | — |


        ### `bill/status`


        Default order: `created_at desc`.


        In addition to the common fields above:


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `type` | key | `=` `!=` `in` | yes | — |

        | `series` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |

        | `code` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |

        | `issue_date` | date | `=` `!=` `<` `<=` `>` `>=` `in` | yes | yes |

        | `issue_time` | time | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |

        | `supplier_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `supplier_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `supplier_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `supplier_country` | string | `=` `!=` `in` | yes | — |

        | `supplier_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `customer_uuid` | uuid | `=` `!=` `in` | — | yes |

        | `customer_name` | string | `=` `!=` `in` `starts_with` `contains` |
        yes | — |

        | `customer_alias` | string | `=` `!=` `in` `starts_with` `contains` | —
        | — |

        | `customer_country` | string | `=` `!=` `in` | yes | — |

        | `customer_tax_code` | string | `=` `!=` `in` `starts_with` `contains`
        | — | yes |

        | `related.supplier` | uuid | `:` | — | — |

        | `related.customer` | uuid | `:` | — | — |


        ### `note/message`


        Default order: `created_at desc`.


        In addition to the common fields above:


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `title` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |


        ### `org/item`


        Default order: `created_at desc`.


        In addition to the common fields above:


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `name` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |

        | `currency` | string | `=` `!=` `in` | yes | — |

        | `price` | decimal | `=` `!=` `<` `<=` `>` `>=` `in` | yes | — |


        ### `org/party`


        Default order: `created_at desc`.


        In addition to the common fields above:


        | Field | Type | Operators | Sortable | Indexed |

        | --- | --- | --- | --- | --- |

        | `name` | string | `=` `!=` `in` `starts_with` `contains` | yes | yes |

        | `alias` | string | `=` `!=` `in` `starts_with` `contains` | yes | — |

        | `country` | string | `=` `!=` `in` | yes | — |

        | `tax_code` | string | `=` `!=` `in` `starts_with` `contains` | yes |
        yes |
      parameters:
        - description: >-
            GOBL document type to search. See the field reference in this
            endpoint's description for the fields available on each type.
          in: query
          name: schema
          required: true
          schema:
            $ref: '#/components/schemas/SiloSchemaName'
        - description: >-
            Filter expression. Combine terms with AND; use OR only between
            values of a single field. See this endpoint's field reference for
            the fields available and the operators each accepts.
          in: query
          name: filter
          schema:
            description: >-
              Filter expression. Combine terms with AND; use OR only between
              values of a single field. See this endpoint's field reference for
              the fields available and the operators each accepts.
            example: state = "sent" AND issue_date > "2026-01-01"
            title: Filter
            type: string
        - description: >-
            Sort order, as a field name optionally followed by asc or desc.
            Defaults to the schema's own order.
          in: query
          name: order_by
          schema:
            description: >-
              Sort order, as a field name optionally followed by asc or desc.
              Defaults to the schema's own order.
            example: issue_date desc
            title: Order By
            type: string
        - description: Maximum number of entries in a page of results, up to 100.
          in: query
          name: limit
          schema:
            description: Maximum number of entries in a page of results, up to 100.
            example: 20
            title: Limit
            type: integer
        - description: >-
            Position marker from a previous result's next_cursor. Only valid for
            the same schema, filter and order_by.
          in: query
          name: cursor
          schema:
            description: >-
              Position marker from a previous result's next_cursor. Only valid
              for the same schema, filter and order_by.
            title: Cursor
            type: string
        - description: >-
            Comma-separated list of fields to populate on each entry. Fewer
            fields means less work for the database, not merely a smaller
            response. Defaults to the standard set.
          in: query
          name: fields
          schema:
            description: >-
              Comma-separated list of fields to populate on each entry. Fewer
              fields means less work for the database, not merely a smaller
              response. Defaults to the standard set.
            example: id,code,state,issue_date
            title: Fields
            type: string
        - description: >-
            When true, the response includes the number of matching entries.
            This costs an additional query, so it is off by default.
          in: query
          name: count
          schema:
            description: >-
              When true, the response includes the number of matching entries.
              This costs an additional query, so it is off by default.
            title: Count
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiloQueryEntryCollection'
          description: OK
components:
  schemas:
    SiloSchemaName:
      enum:
        - bill/delivery
        - bill/invoice
        - bill/order
        - bill/payment
        - bill/status
        - note/message
        - org/item
        - org/party
      type: string
    SiloQueryEntryCollection:
      properties:
        count:
          description: Number of matching entries, when count was requested.
          example: 42
          title: Count
          type: integer
        count_capped:
          description: >-
            When true, counting stopped at an internal limit and the real total
            is at least count.
          title: Count Capped
          type: boolean
        count_unavailable:
          description: >-
            When true, the count could not be produced in time. The entries in
            this page are still valid.
          title: Count Unavailable
          type: boolean
        cursor:
          description: Cursor that produced this page, when one was given.
          title: Cursor
          type: string
        filter:
          description: Filter expression that was applied.
          title: Filter
          type: string
        limit:
          description: Maximum number of entries in this page of results.
          example: 20
          title: Limit
          type: integer
        list:
          description: Array of matching entries.
          items:
            $ref: '#/components/schemas/SiloEntry'
          nullable: true
          title: List
          type: array
        next_cursor:
          description: Cursor for the next page. Absent on the last page.
          title: Next Cursor
          type: string
        notes:
          description: >-
            Non-fatal advisories about the query, such as a filter that no index
            covers.
          items:
            type: string
          title: Notes
          type: array
        order_by:
          description: Sort order that was applied.
          title: Order By
          type: string
        schema:
          description: Document type that was searched.
          example: bill/invoice
          title: Schema
          type: string
        watermark:
          description: >-
            Timestamp of the most recent change known to be reflected in these
            results. Results are eventually consistent, so a recently created
            entry may not appear until the watermark passes its creation time.
          example: '2026-01-01T00:00:00.000Z'
          title: Watermark
          type: string
      type: object
    SiloEntry:
      properties:
        attachments:
          description: List of files for this entry.
          items:
            $ref: '#/components/schemas/SiloFile'
          title: Attachments
          type: array
        context:
          description: >-
            When entry provided within a related query, this is the context
            within the document.
          example: line.item
          title: Context
          type: string
        created_at:
          description: The date and time the silo entry was created.
          example: '2018-01-01T00:00:00.000Z'
          title: Created At
          type: string
        data:
          description: >-
            JSON envelope contents. Included when fetching, creating or updating
            an entry and in entry lists.
          title: Data
          type: object
        digest:
          $ref: '#/components/schemas/DsigDigest'
        doc_schema:
          description: Schema URL for the envelope's payload.
          example: https://gobl.org/draft-0/bill/invoice
          title: Object Schema
          type: string
        draft:
          description: Deprecated. When true, indicates that the envelope is not signed.
          example: true
          title: Draft
          type: boolean
        env_schema:
          description: Schema URL for the envelope.
          example: https://gobl.org/draft-0/envelope
          title: Envelope Schema
          type: string
        faults:
          description: >-
            List of faults that occurred during the processing of the job
            associated with the last state.
          items:
            $ref: '#/components/schemas/SiloFault'
          title: Faults
          type: array
        folder:
          description: Key for the folder where the entry is located.
          example: sales
          title: Folder
          type: string
        id:
          description: UUID of the silo entry.
          example: 347c5b04-cde2-11ed-afa1-0242ac120002
          title: ID
          type: string
        invalid:
          description: >-
            When true, the envelope's contents are invalid and need to be
            reviewed.
          example: true
          title: Invalid
          type: boolean
        key:
          description: Key used to identify the entry idempotently within a workspace.
          example: invoice-101
          title: Key
          type: string
        meta:
          description: Additional meta fields associated with the entry.
          items:
            $ref: '#/components/schemas/SiloMeta'
          title: Meta
          type: array
        signed:
          description: When true, the envelope has been signed and should not be modified.
          example: true
          title: Signed
          type: boolean
        snippet:
          description: JSON object containing a snippet of the document.
          example:
            title: Sample Title
          title: Snippet
          type: object
        state:
          description: Current state of the silo entry if not a draft.
          example: sent
          title: State
          type: string
        tags:
          description: Copy of tags stored in the envelope header.
          items:
            type: string
          title: Tags
          type: array
        updated_at:
          description: The date and time the silo entry was last updated.
          example: '2018-01-01T00:00:00.000Z'
          title: Updated At
          type: string
        version:
          description: Version of the latest envelope data.
          example: 76f845c125
          title: Version
          type: string
        versions:
          description: Available envelope data versions, newest first.
          items:
            $ref: '#/components/schemas/SiloDataVersion'
          title: Versions
          type: array
      type: object
    SiloFile:
      properties:
        category:
          description: Category of the file.
          example: version
          title: Category
          type: string
        created_at:
          description: The date and time this file was created.
          example: '2018-01-01T00:00:00.000Z'
          title: Created At
          type: string
        desc:
          description: Description of the file.
          example: Invoice for January 2021.
          title: Description
          type: string
        embeddable:
          description: When true, the file can be embedded inside another file, like a PDF.
          example: true
          title: Embeddable
          type: boolean
        entry_id:
          description: The UUID of the entry this file belongs to.
          example: 347c5b04-cde2-11ed-afa1-0242ac120002
          title: Entry ID
          type: string
        hash:
          description: SHA256 hash of the file.
          example: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
          title: Hash
          type: string
        id:
          description: The UUID that identifies the file in the entry.
          title: ID
          type: string
        key:
          description: >-
            Key used to identify the file by the service or app that generated
            it.
          example: pdf
          title: Key
          type: string
        meta:
          additionalProperties:
            type: string
          description: Any additional meta data about the file.
          title: Meta
          type: object
        mime:
          description: MIME type of the file.
          example: application/pdf
          title: MIME
          type: string
        name:
          description: Name of the file.
          example: invoice.pdf
          title: Name
          type: string
        previous:
          description: Set of previous versions of the file.
          items:
            $ref: '#/components/schemas/SiloFileVersion'
          title: Previous
          type: array
        private:
          description: When true, the file will not have a public link.
          title: Private
          type: boolean
        size:
          description: Size of the file in bytes.
          example: 12345
          title: Size
          type: integer
        stored:
          description: >-
            When true, indicates that the file's contents have been uploaded
            successfully.
          example: true
          title: Stored
          type: boolean
        url:
          description: URL where the file's contents can be downloaded.
          title: Public URL
          type: string
      type: object
    DsigDigest:
      properties:
        alg:
          type: string
        val:
          type: string
      type: object
    SiloFault:
      properties:
        code:
          description: >-
            Code assigned by the provider that may provide additional
            information about the fault.
          title: Code
          type: string
        message:
          description: >-
            Message assigned by the provider that may provide additional
            information about the fault.
          title: Message
          type: string
        paths:
          description: JSON Paths to the properties affected by the fault.
          items:
            type: string
          title: Paths
          type: array
        provider:
          description: ID of the provider that generated the fault.
          example: pdf
          title: Provider
          type: string
      type: object
    SiloMeta:
      properties:
        created_at:
          description: Timestamp of when the row was created.
          example: '2018-01-01T00:00:00.000Z'
          title: Created At
          type: string
        entry_id:
          description: ID of the entry this meta row belongs to
          example: 347c5b04-cde2-11ed-afa1-0242ac120002
          title: Entry ID
          type: string
        id:
          description: Compound ID of the meta row.
          example: 347c5b04-cde2-11ed-afa1-0242ac120002:source:key
          title: ID
          type: string
        indexed:
          description: When true, the meta entry is indexed for search.
          example: true
          title: Indexed
          type: boolean
        key:
          description: Key used to identify the meta entry by the source.
          example: service-id
          title: Key
          type: string
        link_scope:
          description: Describes the context in which the link should be made available.
          example: public
          title: Link Scope
          type: string
        link_url:
          description: >-
            URL associated with the meta row that may be used to perform
            additional actions or view more details.
          example: https://example.com/info
          title: Link URL
          type: string
        owned:
          description: When true, the meta entry is indexed by owner ID.
          example: true
          title: Owned
          type: boolean
        owner_id:
          description: >-
            UUID of the owner of the silo entry, typically a workspace ID.
            Included for reference when the authentication token does not
            already include the owner such as for lookups by reference.
          title: Owner ID
          type: string
        ref:
          description: >-
            Indexable value used to locate the meta entry if a silo entry ID is
            not available.
          title: Reference
          type: string
        secure:
          description: >-
            When true, the meta entry is never included in lists and needs to be
            specifically requested.
          example: true
          title: Secure
          type: boolean
        shared:
          description: When true, the meta entry may be shared with other applications.
          example: true
          title: Shared
          type: boolean
        src:
          description: The service or source that created this meta entry.
          example: source
          title: Source
          type: string
        updated_at:
          description: Timestamp of when the row was last updated.
          example: '2018-01-01T00:00:00.000Z'
          title: Updated At
          type: string
        value:
          description: The JSON data stored with the meta row.
          example:
            key: value
          title: Value
          type: object
      type: object
    SiloDataVersion:
      properties:
        at:
          description: Timestamp when this version was created.
          example: '2018-01-01T00:00:00.000Z'
          title: At
          type: string
        invalid:
          description: When true, this version's envelope is invalid.
          title: Invalid
          type: boolean
        signed:
          description: When true, this version's envelope is signed.
          title: Signed
          type: boolean
        src:
          description: Service or source that created this version.
          example: api
          title: Source
          type: string
        src_id:
          description: Identifier of the source object that created this version.
          title: Source ID
          type: string
        version:
          description: Content-derived identifier for this envelope version.
          example: 76f845c125
          title: Version
          type: string
      type: object
    SiloFileVersion:
      properties:
        created_at:
          description: The date and time this file was created.
          example: '2018-01-01T00:00:00.000Z'
          title: Created At
          type: string
        hash:
          description: The SHA256 of the file's contents.
          title: Hash
          type: string
        id:
          description: The UUID that identifies the file when it was originally uploaded.
          title: ID
          type: string
        size:
          description: Size of the file.
          title: Size
          type: integer
      type: object
  securitySchemes:
    authToken:
      bearerFormat: JWT
      description: >-
        Use the `Bearer` scheme with a valid JWT token to authenticate requests.
        Example: `Authorization: Bearer <token>`
      scheme: bearer
      type: http

````

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