orders connection to build a customer’s order history across their subscriptions. Filter by email and request the fields needed for the visible page in the same query.
This avoids listing each subscription, paging through each subscription’s orders, and then fetching the selected orders separately.
Query a page of history
Authenticate on your server with a project API access token with read access. Derive the customer’s email from their authenticated storefront session. Keep the project token on your server and verify customer identity before returning their orders.hasNextPage is true, pass endCursor as after with the same filters to retrieve the next page. Fetch a page when the customer opens it; a history page does not require downloading their entire order history first.
Filter behavior
emailmatches the subscription’s current email address exactly, ignoring letter case, within the authenticated project. It can match multiple subscriptions, including cancelled subscriptions with historical orders. Subscription-token requests use that subscription’s project and remain limited to orders the caller can read.- Omitting
emailleaves the existing authorized order scope unchanged. A project token can read other customers’ orders, so always supply the authenticated customer’s email for a customer-facing history page. statusesincludes orders matching any listed status. An empty list returns no orders; omitting the list leaves statuses unrestricted.- The existing
statusargument still works. If bothstatusandstatusesare supplied, orders must satisfy both filters. createdSincefilters the order creation time, independently of when its subscription was updated. Omit it to include older orders.
ordersV2 connection, where results remain limited to that subscription.