ordersCount
Requires access scope or
access scope.
Returns the count of orders for the given shop. Limited to a maximum of 10000.
Arguments
- Anchor to limitlimit•
The upper bound on count value before returning a result.
- Anchor to queryquery•
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
- Anchor to default•string
Filter by a case-insensitive search of multiple fields in a document.
query=Bob Norman
query=title:green hoodie
- Anchor to cart_token•string
Filter by the cart token's unique value, which references the cart that's associated with an order.
cart_token:abc123
- Anchor to channel•string
Filter by the channel information
handle
() field.
channel:web
channel:web,pos
- Anchor to chargeback_status•string
Filter by the order's chargeback status. A chargeback occurs when a customer questions the legitimacy of a charge with their financial institution.
accepted
charge_refunded
lost
needs_response
under_review
won
chargeback_status:accepted
- Anchor to checkout_token•string
Filter by the checkout token's unique value, which references the checkout that's associated with an order.
checkout_token:abc123
- Anchor to confirmation_number•string
Filter by the randomly generated alpha-numeric identifier for an order that can be displayed to the customer instead of the sequential order name. This value isn't guaranteed to be unique.
confirmation_number:ABC123
- Anchor to created_at•time
Filter by the date and time when the order was created in Shopify's system.
created_at:2020-10-21T23:39:20Z
created_at:<now
created_at:<=2024
- Anchor to credit_card_last4•string
Filter by the last four digits of the credit card that was used to pay for the order.
credit_card_last4:1234
- Anchor to delivery_method•string
shipping
pick-up
retail
local
pickup-point
none
delivery_method:shipping
- Anchor to discount_code•string
Filter by the case-insensitive discount code that was applied to the order at checkout. Maximum characters: 255.
discount_code:ABC123
- Anchor to email•string
Filter by the email address that's associated with the order.
email:example@shopify.com
- Anchor to financial_status•string
paid
pending
authorized
partially_paid
partially_refunded
refunded
voided
expired
financial_status:authorized
- Anchor to fraud_protection_level•string
Filter by the level of fraud protection that's applied to the order.
fully_protected
partially_protected
not_protected
pending
not_eligible
not_available
fraud_protection_level:fully_protected
- Anchor to fulfillment_location_id•id
Filter by the fulfillment location
id
(Fulfillment.location.id
) field.fulfillment_location_id:123
- Anchor to fulfillment_status•string
Filter by the order's fulfillment status.
unshipped
shipped
fulfilled
partial
scheduled
on_hold
unfulfilled
request_declined
fulfillment_status:fulfilled
- Anchor to location_id•id
Filter by the ID of the location that's associated with the order.
location_id:123
- Anchor to payment_id•string
Filter by the ID of the payment that's associated with the order.
payment_id:abc123
- Anchor to payment_provider_id•id
Filter by the ID of the payment provider that's associated with the order.
payment_provider_id:123
- Anchor to reference_location_id•id
Filter by the ID of a location that's associated with the order, such as locations from fulfillments, refunds, or the shop's primary location.
reference_location_id:123
- Anchor to return_status•string
Filter by the order's return status.
return_requested
in_progress
inspection_complete
returned
return_failed
no_return
return_status:in_progress
- Anchor to sales_channel•string
Filter by the sales channel that the order is attributed to.
sales_channel: some_sales_channel
- Anchor to sku•string
Filter by the product variant
sku
field. Learn more about SKUs.sku:ABC123
- Anchor to source_identifier•string
Filter by the ID of the order placed on the originating platform, such as a unique POS or third-party identifier. This value doesn't correspond to the Shopify ID that's generated from a completed draft order.
source_identifier:1234-12-1000
- Anchor to source_name•string
Filter by the name of the originating platform that's associated with the checkout for the order.
source_name:web
source_name:shopify_draft_order
- Anchor to status•string
Filter by the order status.
open
closed
cancelled
not_closed
status:open
- Anchor to subtotal_line_items_quantity•string
- Anchor to test•boolean
Filter by test orders. Test orders are made using the Shopify Bogus Gateway or a payment provider with test mode enabled.
test:true
- Anchor to updated_at•time
Filter by the date and time when the order was last updated in Shopify's system.
updated_at:2020-10-21T23:39:20Z
updated_at:<now
updated_at:<=2024
Example:
Example:
Example:
Valid values:
Example:
Example:
Example:
Example:
Example:
Valid values:
Example:
Example:
Example:
Valid values:
Example:
Valid values:
Example:
Example:
Valid values:
Example:
Example:
Example:
Example:
Example:
Valid values:
Example:
Example:
Example:
Example:
Example:
Valid values:
Example:
Example:
Example:
- Anchor to savedSearchIdsaved•
Search Id
Anchor to Possible returnsPossible returns
- Anchor to CountCount•
Details for count of elements.
Retrieve an order count
query OrdersCount {
ordersCount(limit: 2000) {
count
precision
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query OrdersCount { ordersCount(limit: 2000) { count precision } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query OrdersCount {
ordersCount(limit: 2000) {
count
precision
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query OrdersCount {
ordersCount(limit: 2000) {
count
precision
}
}`,
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query OrdersCount {
ordersCount(limit: 2000) {
count
precision
}
}
QUERY
response = client.query(query: query)