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
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024