Order Count

📘

The data returned by the list interface may not necessarily be consistent with the order data displayed by the store admin. The store admin will filter out orders with a status of canceled and those without a shipping address and more filters.

🔒

Requires read_order access scope. More access scope

The Order Count API provides the total number of orders matching the specified query parameters. This enables users to retrieve aggregate order data for analytics or filtering purposes.

This API is especially useful for:

  1. Monitoring the total number of orders in a given time period.
  2. Filtering orders based on specific statuses like opened, placed, finished, or cancelled.
  3. Analyzing orders based on financial and fulfillment statuses.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Request Query Parameters

Parameter NameTypeRequiredDescriptionExample Value
created_at_minstringNoFilters orders created at or after the specified date and time.2016-01-18T23:41:00Z
created_at_maxstringNoFilters orders created at or before the specified date and time.2016-01-18T23:41:00Z
updated_at_minstringNoFilters orders updated at or after the specified date and time.2016-01-18T23:41:00Z
updated_at_maxstringNoFilters orders updated at or before the specified date and time.2016-01-18T23:41:00Z
statusstringNoFilters orders by their current status. Possible values: opened (active), placed (not yet processed), finished (completed), cancelled (canceled).opened
financial_statusstringNoFilters orders by their financial status. Possible values: waiting (awaiting payment), paying (in progress), paid (completed), cancelled (canceled), failed (payment failed), refunding (refund in progress), refund_failed (refund failed), refunded (completed), partially_refunded (partial refund issued).paid
fulfillment_statusstringNoFilters orders by their fulfillment status. Possible values: initialled (initialized), waiting (awaiting fulfillment), partially_shipped (partially shipped), shipped (fully shipped), partially_finished (partially completed), finished (fully completed), cancelled (canceled), returning (in return process), returned (fully returned), partially_returned (partially returned).shipped

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

NameTypeDescriptionExample
countintTotal number of records in this query.7

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray[ "file number error"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
422Unprocessable Entityinvalid time field input"created_at_min time format error",
"created_at_max time format error",
"UpdatedAtMin time format error",
"UpdatedAtMax time format error",
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!