All things Shopify and commerce
I want to filter orders by shipping address country code (such as SE, US, IN etc.,) from
{
orders(first: 10, reverse: true, query: "created_at:>=1900-01-01") {
edges {
node {
id
name
createdAt
shippingAddress {
countryCode
}
customer {
firstName
lastName
}
totalPriceSet {
shopMoney {
currencyCode
amount
}
}
currentTotalPriceSet {
shopMoney {
amount
currencyCode
}
}
displayFinancialStatus
metafields(first: 10) {
edges {
node {
key
value
}
}
}
shippingLine {
title
code
source
}
}
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Hi Moorthi,
You can filter using country name.
Query:
query OrdersByCountry($query: String!) {
orders(first: 10, query: $query) {
edges {
node {
id
name
createdAt
shippingAddress {
countryCodeV2
}
customer {
firstName
lastName
}
totalPriceSet {
shopMoney {
currencyCode
amount
}
}
currentTotalPriceSet {
shopMoney {
amount
currencyCode
}
}
displayFinancialStatus
metafields(first: 10) {
edges {
node {
key
value
}
}
}
shippingLine {
title
code
source
}
}
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Variables:
{
"query": "shipping_address:country:'United States'"
}
Best Regards,
Brian McKinley
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025