orders
Returns a list of orders placed in the store.
OrderConnection arguments
- Anchor to afterafter•
The elements that come after the specified cursor.
- Anchor to beforebefore•
The elements that come before the specified cursor.
- Anchor to firstfirst•
The first
n
elements from the paginated list.- Anchor to lastlast•
The last
n
elements from the paginated list.- 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.
- 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.
- Anchor to checkout_token•string
Filter by the checkout token's unique value, which references the checkout that's associated with an order.
- 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.
- Anchor to created_at•time
Filter by the date and time when the order was created in Shopify's system.
- Anchor to credit_card_last4•string
Filter by the last four digits of the credit card that was used to pay for the order.
- Anchor to discount_code•string
Filter by the case-insensitive discount code that was applied to the order at checkout. Maximum characters: 255.
- Anchor to email•string
Filter by the email address that's associated with the order.
email:example@shopify.com
- Anchor to fraud_protection_level•string
Filter by the level of fraud protection that's applied to the order.
- Anchor to fulfillment_location_id•id
Filter by the fulfillment location
id
(Fulfillment.location.id
) field.- Anchor to payment_id•string
Filter by the ID of the payment that's associated with the order.
- Anchor to payment_provider_id•id
Filter by the ID of the payment provider that's associated with the order.
- 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.
- 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.
- Anchor to source_name•string
Filter by the name of the originating platform that's associated with the checkout for the order.
- 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.
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
Example:
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to savedSearchIdsaved•
Search Id The ID of a saved search. The search’s query string is used as the query argument.
- Anchor to sortKeysort•
Key OrderSort Default:PROCESSED_ATKeys Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
Anchor to Possible returnsPossible returns
- Anchor to edgesedges•[Order
Edge!]! non-null The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node.
- Anchor to nodesnodes•[Order!]!non-null
A list of nodes that are contained in OrderEdge. You can fetch data about an individual node, or you can follow the edges to fetch data about a collection of related nodes. At each node, you specify the fields that you want to retrieve.
- Anchor to pageInfopage•
Info PageInfo! non-null An object that’s used to retrieve cursor information about the current page.
Examples
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 query {6 orders(first: 10, query: "updated_at:>2019-12-01") {7 edges {8 node {9 id10 updatedAt11 }12 }13 }14 }`,15);1617const data = await response.json();18
query {
orders(first: 10, query: "updated_at:>2019-12-01") {
edges {
node {
id
updatedAt
}
}
}
}
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 { orders(first: 10, query: \"updated_at:>2019-12-01\") { edges { node { id updatedAt } } } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
orders(first: 10, query: "updated_at:>2019-12-01") {
edges {
node {
id
updatedAt
}
}
}
}`,
);
const data = await response.json();
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 {
orders(first: 10, query: "updated_at:>2019-12-01") {
edges {
node {
id
updatedAt
}
}
}
}
QUERY
response = client.query(query: query)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
orders(first: 10, query: "updated_at:>2019-12-01") {
edges {
node {
id
updatedAt
}
}
}
}`,
});
Response
JSON1{2 "orders": {3 "edges": [4 {5 "node": {6 "id": "gid://shopify/Order/158040885",7 "updatedAt": "2024-01-01T12:34:43Z"8 }9 },10 {11 "node": {12 "id": "gid://shopify/Order/199007853",13 "updatedAt": "2024-01-01T12:34:43Z"14 }15 },16 {17 "node": {18 "id": "gid://shopify/Order/212949620",19 "updatedAt": "2024-01-01T12:34:43Z"20 }21 },22 {23 "node": {24 "id": "gid://shopify/Order/294238686",25 "updatedAt": "2024-01-01T12:34:43Z"26 }27 },28 {29 "node": {30 "id": "gid://shopify/Order/316002265",31 "updatedAt": "2024-01-01T12:34:43Z"32 }33 },34 {35 "node": {36 "id": "gid://shopify/Order/459506686",37 "updatedAt": "2024-01-01T12:34:43Z"38 }39 },40 {41 "node": {42 "id": "gid://shopify/Order/634584900",43 "updatedAt": "2024-01-01T12:34:43Z"44 }45 },46 {47 "node": {48 "id": "gid://shopify/Order/744797037",49 "updatedAt": "2024-01-01T12:34:43Z"50 }51 },52 {53 "node": {54 "id": "gid://shopify/Order/1001810659",55 "updatedAt": "2024-01-01T12:34:43Z"56 }57 },58 {59 "node": {60 "id": "gid://shopify/Order/1021030140",61 "updatedAt": "2024-01-01T12:34:43Z"62 }63 }64 ]65 }66}