Fetching orders by transaction date ASC

Is it possible to get all orders from a specific date range ordered by transaction date ascending? I did try to user created_at_max and created_at_min but I couldn’t see anything related to order.

Hey @Bruno_Alves! The created_at_min/created_at_max params on the REST API filter by when the order was created in Shopify, not when the transaction was processed.

If you need ascending sort, GraphQL is the way to go. The orders query supports a sortKey argument (which actually defaults to PROCESSED_AT) and a reverse flag. Combined with a processed_at filter in the query string, you can get exactly what you’re looking for:

{
  orders(first: 50, sortKey: PROCESSED_AT, reverse: false, query: "processed_at:>='2025-01-01' AND processed_at:<='2025-12-31'") {
    edges {
      node {
        id
        name
        processedAt
        createdAt
      }
    }
  }
}

Setting reverse: false gives you ascending order. You can swap in your own date range and adjust the fields you need. The search syntax docs cover the full filter syntax if you need more complex queries.

Hope this helps, let me know if you have any other questions!

1 Like

When I fetch a list of orders from REST Api, it looks like I only get last 30 days. Is it possible to fetch order from last 90 days through REST API?

Hmm, 30 days is odd! Public apps can only access the last 60 days of orders unless they have the read_all_orders scope.

To access older orders, you need to request access to the read_all_orders scope through the Partner Dashboard. Go to Apps > your app > API access, and you’ll see an “Access requests” section where you can apply. Once approved, add read_all_orders alongside your existing read_orders or write_orders scope in your OAuth flow.

If you’re using Merchant-owned custom app created via the Dev Dash this restriction doesn’t apply and you automatically have full order history access. If that’s your setup and you’re still only seeing recent orders, double-check that you’re passing status=any in your REST request, since the default only returns open orders.

Feel free to send an x-request-id header from a call that only returned 30 days of orders and I can take a closer look!