POST /v2/orders/search
Search all orders for one or more locations. Orders include all sales, returns, and exchanges regardless of how or when they entered the Square ecosystem (such as Point of Sale, Invoices, and Connect APIs).
SearchOrders
requests need to specify which locations to search and define a
SearchOrdersQuery object that controls
how to sort or filter the results. Your SearchOrdersQuery
can:
Set filter criteria.
Set the sort order.
Determine whether to return results as complete Order
objects or as
OrderEntry objects.
Note that details for orders processed with Square Point of Sale while in
offline mode might not be transmitted to Square for up to 72 hours. Offline
orders have a created_at
value that reflects the time the order was created,
not the time it was subsequently transmitted to Square.
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 |
---|---|---|---|
query |
Object | No |
Contains query criteria for the search. |
query.filter |
Object | No |
Filtering criteria to use for a |
query.filter.date_time_filter |
Object | No |
Filter for For each time range, the start time and end time are inclusive. If the end time is absent, it defaults to the time of the first request for the cursor. Important: If you use the |
query.filter.date_time_filter.created_at |
Object | No |
Represents a generic time range. The start and end values are represented in RFC 3339 format. Time ranges are customized to be inclusive or exclusive based on the needs of a particular endpoint. Refer to the relevant endpoint-specific documentation to determine how time ranges are handled. |
query.filter.date_time_filter.created_at.start_at |
String | No |
A datetime value in RFC 3339 format indicating when the time range starts. |
query.filter.date_time_filter.created_at.end_at |
String | No |
A datetime value in RFC 3339 format indicating when the time range ends. |
query.filter.date_time_filter.closed_at |
Object | No |
Represents a generic time range. The start and end values are represented in RFC 3339 format. Time ranges are customized to be inclusive or exclusive based on the needs of a particular endpoint. Refer to the relevant endpoint-specific documentation to determine how time ranges are handled. |
query.filter.date_time_filter.closed_at.start_at |
String | No |
A datetime value in RFC 3339 format indicating when the time range starts. |
query.filter.date_time_filter.closed_at.end_at |
String | No |
A datetime value in RFC 3339 format indicating when the time range ends. |
query.filter.date_time_filter.updated_at |
Object | No |
Represents a generic time range. The start and end values are represented in RFC 3339 format. Time ranges are customized to be inclusive or exclusive based on the needs of a particular endpoint. Refer to the relevant endpoint-specific documentation to determine how time ranges are handled. |
query.filter.date_time_filter.updated_at.start_at |
String | No |
A datetime value in RFC 3339 format indicating when the time range starts. |
query.filter.date_time_filter.updated_at.end_at |
String | No |
A datetime value in RFC 3339 format indicating when the time range ends. |
query.filter.customer_filter |
Object | No |
A filter based on the order |
query.filter.customer_filter.customer_ids[] |
Array | No |
A list of customer IDs to filter by. Max: 10 customer IDs. |
query.filter.source_filter |
Object | No |
A filter based on order |
query.filter.source_filter.source_names[] |
Array | No |
Filters by the Source Max: 10 source names. |
query.filter.fulfillment_filter |
Object | No |
Filter based on order fulfillment information. |
query.filter.fulfillment_filter.fulfillment_states[] |
Array | No |
A list of fulfillment states to filter for. The list returns orders if any of its fulfillments match any of the fulfillment states listed in this field. |
query.filter.fulfillment_filter.fulfillment_types[] |
Array | No |
A list of fulfillment types to filter for. The list returns orders if any of its fulfillments match any of the fulfillment types listed in this field. |
query.filter.state_filter |
Object | No |
Filter by the current order |
query.filter.state_filter.states[] |
Array | Yes |
States to filter for. |
query.sort |
Object | No |
Sorting criteria for a |
query.sort.sort_order |
String | No |
The chronological order in which results are returned. Defaults to |
query.sort.sort_field |
String | Yes |
The field to sort by. Important: When using a DateTimeFilter,
Default: |
limit |
Integer | No |
The maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page. Default: |
location_ids[] |
Array | No |
The location IDs for the orders to query. All locations must belong to the same merchant. Min: 1 location ID. Max: 10 location IDs. |
cursor |
String | No |
A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for your original query. For more information, see Pagination. |
return_entries |
Boolean | No |
A Boolean that controls the format of the search results. If Default: |
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.