Getting undefined method `all' for ShopifyAPI::Order:Class

Topic summary

A developer is encountering a NoMethodError when trying to call ShopifyAPI::Order.all with an active session.

Setup Details:

  • ShopifyAPI Context configured with API version “2024-04”
  • Scopes: read_locations, read_orders, read_users
  • Session created with shop URL and access token
  • Using response_as_struct: true

The Error:
Calling ShopifyAPI::Order.all(session: @session, ...) with parameters like status, financial_status, created_at dates, fields, and limit triggers an undefined method error for the all method on the Order class.

Status: The issue remains unresolved with no responses yet. The problem suggests either an API version compatibility issue, incorrect gem usage, or a potential breaking change in how orders are retrieved in the shopify_api gem.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

Hi,

So I have a class and in its constructor I set up the context and get an active session

def setup_shopify_context
  ShopifyAPI::Context.setup(
    api_key: app_id,
    api_secret_key: app_secret,
    api_version: "2024-04",
    scope: "read_locations,read_orders,read_users",
    is_private: false,
    is_embedded: true,
    response_as_struct: true
  )
end

def setup_shopify_active_session

    @session = ShopifyAPI::Auth::Session.new(
        shop: api_url,
        access_token: access_token
    )
end

But when I do

collection = ShopifyAPI::Order.all(session: @session,  { 
        limit: ORDERS_LIMIT,
        created_at_min: start_date,
        created_at_max: end_date,
        status: "any",
        financial_status: "paid",
        fields: "id,created_at,subtotal_price,location_id"
    }

)

I get the following error:

undefined method `all’ for ShopifyAPI::Order:Class (NoMethodError) collection = ShopifyAPI::Order.all(session: @session,…