--- title: abandonedCheckoutsCount - GraphQL Admin description: Returns the count of abandoned checkouts for the given shop. Limited to a maximum of 10000 by default. api_version: 2025-10 api_name: admin type: query api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/queries/abandonedCheckoutsCount?example=retrieves-a-count-of-checkouts md: https://shopify.dev/docs/api/admin-graphql/latest/queries/abandonedCheckoutsCount.md?example=retrieves-a-count-of-checkouts --- # abandoned​Checkouts​Count query Requires `read_orders` access scope. Also: The user must have manage\_abandoned\_checkouts permission. Returns the count of abandoned checkouts for the given shop. Limited to a maximum of 10000 by default. ## Arguments * limit [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int) Default:10000 The upper bound on count value before returning a result. Use `null` to have no limit. * query [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) 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](https://shopify.dev/api/usage/search-syntax). * * default string * created\_at time - Filter by a case-insensitive search of multiple fields in a document. - Example: * `query=Bob Norman` * `query=title:green hoodie` The date and time (in [ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) when the abandoned cart was created. * email\_state string Filter by `abandoned_email_state` value. Possible values: `sent`, `not_sent`, `scheduled` and `suppressed`. * * id id * recovery\_state string - Filter by `id` range. - Example: * `id:1234` * `id:>=1234` * `id:<=1234` Possible values: `recovered` and `not_recovered`. * status string Possible values: `open` and `closed`. * updated\_at time The date and time (in [ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) when the abandoned cart was last updated. * saved​Search​Id [ID](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) The ID of an existing saved search. The search’s query string is used as the query argument. Refer to the [`SavedSearch`](https://shopify.dev/api/admin-graphql/latest/objects/savedsearch) object. *** ## Possible returns * Count [Count](https://shopify.dev/docs/api/admin-graphql/latest/objects/Count) Details for count of elements. *** ## Examples * ### Retrieves a count of checkouts #### Query ```graphql query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby 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 AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } }`, }); ``` #### Response ```json { "abandonedCheckoutsCount": { "count": 38, "precision": "EXACT" } } ``` ## Retrieves a count of checkouts [Open in GraphiQL](http://localhost:3457/graphiql?query=query%20AbandonedCheckoutsCount%20%7B%0A%20%20abandonedCheckoutsCount\(limit%3A%201000\)%20%7B%0A%20%20%20%20count%0A%20%20%20%20precision%0A%20%20%7D%0A%7D) ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } }`, ); const json = await response.json(); return json.data; } ``` ##### GQL ``` query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } } ``` ##### cURL ``` curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } }" }' ``` ##### React Router ``` import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } }`, ); const json = await response.json(); return json.data; } ``` ##### Node.js ``` const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } }`, }); ``` ##### Ruby ``` 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 AbandonedCheckoutsCount { abandonedCheckoutsCount(limit: 1000) { count precision } } QUERY response = client.query(query: query) ``` ## Response JSON ```json { "abandonedCheckoutsCount": { "count": 38, "precision": "EXACT" } } ```