Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 4.74 KB

search-catalog-objects-request.md

File metadata and controls

36 lines (28 loc) · 4.74 KB

Search Catalog Objects Request

Structure

SearchCatalogObjectsRequest

Fields

Name Type Tags Description
cursor string | undefined Optional The pagination cursor returned in the previous response. Leave unset for an initial request.
See Pagination for more information.
objectTypes string[] | undefined Optional The desired set of object types to appear in the search results.

If this is unspecified, the operation returns objects of all the top level types at the version
of the Square API used to make the request. Object types that are nested onto other object types
are not included in the defaults.

At the current API version the default object types are:
ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST,
PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,
SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.
includeDeletedObjects boolean | undefined Optional If true, deleted objects will be included in the results. Deleted objects will have their
is_deleted field set to true.
includeRelatedObjects boolean | undefined Optional If true, the response will include additional objects that are related to the
requested objects. Related objects are objects that are referenced by object ID by the objects
in the response. This is helpful if the objects are being fetched for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included.
For example:

If the objects field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the related_objects field of the
response. If the objects field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the related_objects field of
the response.

Default value: false
beginTime string | undefined Optional Return objects modified after this timestamp, in RFC 3339
format, e.g., 2016-09-04T23:59:33.123Z. The timestamp is exclusive - objects with a
timestamp equal to begin_time will not be included in the response.
query CatalogQuery | undefined Optional A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the SearchCatalogObjects endpoint.

Although a query can have multiple filters, only certain query types can be combined per call to SearchCatalogObjects.
Any combination of the following types may be used together:

- exact_query
- prefix_query
- range_query
- sorted_attribute_query
- text_query
All other query types cannot be combined with any others.

When a query filter is based on an attribute, the attribute must be searchable.
Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.

* Searchable attribute and objects queryable by searchable attributes **

- name: CatalogItem, CatalogItemVariation, CatalogCategory, CatalogTax, CatalogDiscount, CatalogModifier, 'CatalogModifierList,CatalogItemOption,CatalogItemOptionValue<br>- description: CatalogItem, CatalogItemOptionValue<br>- abbreviation: CatalogItem<br>- upc: CatalogItemVariation<br>- sku: CatalogItemVariation<br>- caption: CatalogImage<br>- display_name: CatalogItemOption<br><br>For example, to search for [CatalogItem](../../doc/models/catalog-item.md) objects by searchable attributes, you can use<br>the "name", "description", or "abbreviation"` attribute in an applicable query filter.
limit number | undefined Optional A limit on the number of results to be returned in a single page. The limit is advisory -
the implementation may return more or fewer results. If the supplied limit is negative, zero, or
is higher than the maximum limit of 1,000, it will be ignored.

Example (as JSON)

{
  "limit": 100,
  "object_types": [
    "ITEM"
  ],
  "query": {
    "prefix_query": {
      "attribute_name": "name",
      "attribute_prefix": "tea"
    }
  }
}