POST /v2/catalog/search
Searches for CatalogObject of any type by matching supported search attribute values, excluding custom attribute values on items or item variations, against one or more of the specified query expressions.
This (SearchCatalogObjects
) endpoint differs from the SearchCatalogItems
endpoint in the following aspects:
SearchCatalogItems
can only search for items or item variations, whereasSearchCatalogObjects
can search for any type of catalog objects.SearchCatalogItems
supports the custom attribute query filters to return items or item variations that contain custom attribute values, whereSearchCatalogObjects
does not.SearchCatalogItems
does not support theinclude_deleted_objects
filter to search for deleted items or item variations, whereasSearchCatalogObjects
does.- The both endpoints have different call conventions, including the query filter formats.
Servers
- https://connect.squareup.com
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
begin_time |
String | No |
Return objects modified after this timestamp, in RFC 3339
format, e.g., |
query |
Object | No |
A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the 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:
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.
For example, to search for CatalogItem objects by searchable attributes, you can use
the |
query.items_for_modifier_list_query |
Object | No |
The query filter to return the items containing the specified modifier list IDs. |
query.items_for_modifier_list_query.modifier_list_ids[] |
Array | Yes |
A set of |
query.prefix_query |
Object | No |
The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. |
query.prefix_query.attribute_name |
String | Yes |
The name of the attribute to be searched. |
query.prefix_query.attribute_prefix |
String | Yes |
The desired prefix of the search attribute value. |
query.set_query |
Object | No |
The query filter to return the search result(s) by exact match of the specified |
query.set_query.attribute_name |
String | Yes |
The name of the attribute to be searched. Matching of the attribute name is exact. |
query.set_query.attribute_values[] |
Array | Yes |
The desired values of the search attribute. Matching of the attribute values is exact and case insensitive. A maximum of 250 values may be searched in a request. |
query.exact_query |
Object | No |
The query filter to return the search result by exact match of the specified attribute name and value. |
query.exact_query.attribute_value |
String | Yes |
The desired value of the search attribute. Matching of the attribute value is case insensitive and can be partial. For example, if a specified value of "sma", objects with the named attribute value of "Small", "small" are both matched. |
query.exact_query.attribute_name |
String | Yes |
The name of the attribute to be searched. Matching of the attribute name is exact. |
query.sorted_attribute_query |
Object | No |
The query expression to specify the key to sort search results. |
query.sorted_attribute_query.initial_attribute_value |
String | No |
The first attribute value to be returned by the query. Ascending sorts will return only objects with this value or greater, while descending sorts will return only objects with this value or less. If unset, start at the beginning (for ascending sorts) or end (for descending sorts). |
query.sorted_attribute_query.sort_order |
String | No |
The desired sort order, |
query.sorted_attribute_query.attribute_name |
String | Yes |
The attribute whose value is used as the sort key. |
query.range_query |
Object | No |
The query filter to return the search result whose named attribute values fall between the specified range. |
query.range_query.attribute_name |
String | Yes |
The name of the attribute to be searched. |
query.range_query.attribute_min_value |
Integer | No |
The desired minimum value for the search attribute (inclusive). |
query.range_query.attribute_max_value |
Integer | No |
The desired maximum value for the search attribute (inclusive). |
query.text_query |
Object | No |
The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case. |
query.text_query.keywords[] |
Array | Yes |
A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 characters are ignored. |
query.item_variations_for_item_option_values_query |
Object | No |
The query filter to return the item variations containing the specified item option value IDs. |
query.item_variations_for_item_option_values_query.item_option_value_ids[] |
Array | No |
A set of |
query.items_for_tax_query |
Object | No |
The query filter to return the items containing the specified tax IDs. |
query.items_for_tax_query.tax_ids[] |
Array | Yes |
A set of |
query.items_for_item_options_query |
Object | No |
The query filter to return the items containing the specified item option IDs. |
query.items_for_item_options_query.item_option_ids[] |
Array | No |
A set of |
limit |
Integer | No |
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. |
include_deleted_objects |
Boolean | No |
If |
object_types[] |
Array | No |
The desired set of object types to appear in the search results. |
include_related_objects |
Boolean | No |
If If a CatalogItem is returned in the object field of the response,
its associated CatalogCategory, CatalogTax objects,
CatalogImage objects and CatalogModifierList objects
will be included in the If a CatalogItemVariation is returned in the object field of the
response, its parent CatalogItem will be included in the |
cursor |
String | No |
The pagination cursor returned in the previous response. Leave unset for an initial request. See Pagination for more information. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.