I’m looking into fetching all orders for a B2B company from the last 30 days.
After checking out the documentation for both B2B company and orders, I see that it’s not possible to use a query on a company order and it’s not possible to query for the company specifically when accessing orders directly.
My query currently looks like
query GetCompanyOrders(
$query: String
) {
orders(first: 50, query: "created_at:>=2024-07-01 AND company_id:gid://shopify/Company/123456789") {
nodes {
id
displayFulfillmentStatus
name
createdAt
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
lineItems(first: 100) {
nodes {
name
id
variant {
sku
}
image {
url
width
height
altText
}
}
}
shippingAddress {
formatted
}
}
}
}
It would be great to see if anyone else has run into a similar issue.
Any help would be great. Thanks!