Shopify/shopify-api-ruby
69.1
Adequate · 6 November 2026
3.6k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
Features
Add 2022-07 REST API resources
The library now includes auto-generated Ruby resource classes for the Shopify REST API version 2022-07. This update adds support for interacting with resources such as AbandonedCheckout, AccessScope, AndroidPayKey, ApplePayCertificate, ApplicationCharge, ApplicationCredit, Article, Asset, AssignedFulfillmentOrder, Balance, Blog, CancellationRequest, CarrierService, and Checkout, enabling developers to use the latest API endpoints and data structures in their applications.
_lib/shopify\_api/rest/resources/2022\07 · high confidence
Add 2023-04 REST API resource definitions
This release adds the auto-generated Ruby resource classes for the Shopify Admin API version 2023-04. The new files in lib/shopify\_api/rest/resources/2023\_04 provide type-safe access to REST endpoints, including resources such as AbandonedCheckout, AccessScope, ApplePayCertificate, ApplicationCharge, Article, Asset, AssignedFulfillmentOrder, Balance, Blog, CancellationRequest, CarrierService, and Checkout. These classes enable developers to interact with the 2023-04 API version using the library's standard REST client patterns.
_lib/shopify\_api/rest/resources/2023\04 · high confidence
Add 2025-04 REST API resource models
The library now includes auto-generated Ruby resource classes for the Shopify 2025-04 REST API release. This update adds support for managing key commerce entities, including AbandonedCheckouts, Checkouts, Articles, Blogs, Assets, ApplicationCharges, ApplicationCredits, ApplePayCertificates, AccessScopes, AssignedFulfillmentOrders, CancellationRequests, CarrierServices, and Balances, enabling developers to interact with the latest API endpoints and data structures.
_lib/shopify\_api/rest/resources/2024\_07, lib/shopify\_api/rest/resources/2025\04 · high confidence
Add Ruby REST resource classes for Shopify API version 2026-07
New auto-generated Ruby classes for the 2026-07 REST API version have been added to the library, enabling developers to interact with Shopify endpoints using this specific release. This update introduces resource models for key entities including AbandonedCheckout, AccessScope, ApplePayCertificate, ApplicationCharge, ApplicationCredit, Article, Asset, AssignedFulfillmentOrder, Balance, Blog, CancellationRequest, CarrierService, and Checkout, each providing the necessary methods and attributes to perform standard CRUD operations and specific API actions for the 2026-07 release.
_lib/shopify\_api/rest/resources/2026\07 · high confidence
Add Shopify REST API resources for the 2024-04 version
This change introduces the complete set of auto-generated REST resource classes for the Shopify 2024-04 API version. The new files in \lib/shopify\_api/rest/resources/2024\_04\ provide type-safe access to Shopify entities such as AbandonedCheckout, AccessScope, ApplePayCertificate, ApplicationCharge, Article, Asset, Balance, Blog, CancellationRequest, CarrierService, and Checkout, among others. Each resource class includes defined attributes, relationships (has\_one/has\_many), and API path configurations for standard CRUD operations, enabling developers to interact with the 2024-04 API endpoints using the library's existing REST client infrastructure.
_lib/shopify\_api/rest/resources/2022\_04, lib/shopify\_api/rest/resources/2024\_04, lib/shopify\_api/rest/resources/2025\_10, lib/shopify\_api/rest/resources/2024\_01, lib/shopify\_api/rest/resources/2025\_07, lib/shopify\_api/rest/resources/2026\01 · high confidence
Added 2022-10 REST API resource classes
The library now includes auto-generated Ruby resource classes for the Shopify 2022-10 REST API release. This adds support for interacting with resources such as AbandonedCheckout, AccessScope, AndroidPayKey, ApplePayCertificate, ApplicationCharge, ApplicationCredit, Article, Asset, AssignedFulfillmentOrder, Balance, Blog, CancellationRequest, CarrierService, and Checkout, enabling developers to query, create, update, and delete these entities via the updated API version.
_lib/shopify\_api/rest/resources/2022\10 · high confidence
Added Shopify REST API resources for the 2024-10 version
This update introduces a new set of auto-generated Ruby classes for the Shopify 2024-10 REST API release. Located in lib/shopify\_api/rest/resources/2024\_10, these files provide object-oriented wrappers for interacting with Shopify endpoints, including AbandonedCheckout, AccessScope, ApplePayCertificate, ApplicationCharge, ApplicationCredit, Article, Asset, AssignedFulfillmentOrder, Balance, Blog, CancellationRequest, CarrierService, and Checkout. Users can now utilize these resources to perform standard CRUD operations and specific actions (such as accepting or rejecting cancellation requests) against the 2024-10 API version.
_lib/shopify\_api/rest/resources/2024\10 · high confidence
Added Sorbet RBI shims for FakeFS, Hash, and OpenSSL
New RBI shim files have been added to the \sorbet/rbi/shims\ directory to provide type definitions for external libraries and Ruby standard library methods that Sorbet does not automatically infer. Specifically, \fakefs.rbi\ defines the \FakeFS\ module, \hash.rb\ adds the \with\_indifferent\_access\ method to the \Hash\ class, and \openssl.rb\ defines the \secure\_compare\ class method on the \OpenSSL\ module. These shims allow the type checker to understand these symbols without requiring runtime changes.
sorbet/rbi/shims · high confidence
Added Sorbet RBI type definitions for project dependencies
Autogenerated Sorbet RBI files have been added for several gems used in the project, including activesupport (7.0.1), addressable (2.8.0), ast (2.4.2), concurrent-ruby (1.1.9), crack (0.4.5), diff-lcs (1.5.0), fakefs (1.4.1), hash\_diff (1.0.0), hashdiff (1.0.1), httparty (0.20.0), i18n (1.8.11), jwt (2.3.0), mime-types (3.4.1), and minitest (5.15.0). These files provide static type signatures for the gems, enabling Sorbet to type-check code that interacts with these libraries. Some gems like coderay and method\_source have empty RBI files, likely requiring manual configuration or specific Tapioca settings to generate full signatures.
sorbet/rbi/gems · high confidence
Added Tapioca executable wrapper
A new executable script for the Tapioca gem has been added to the bin directory. This wrapper facilitates running the Tapioca command-line tool by loading the gem's binary path through Bundler, ensuring the correct environment and dependencies are used when invoking the tool.
bin · high confidence
Added auto-generated 2023-01 REST API resources
The library now includes the full set of auto-generated Ruby resource classes for the Shopify 2023-01 REST API release. This adds support for interacting with 2023-01 endpoints, including resources such as AbandonedCheckout, AccessScope, ApplePayCertificate, ApplicationCharge, Article, Asset, AssignedFulfillmentOrder, Balance, Blog, CancellationRequest, CarrierService, and Checkout, enabling developers to use the latest API features and data structures in their applications.
_lib/shopify\_api/rest/resources/2023\01 · high confidence
Adds Shopify REST API resources for the 2025-01 version
The library now includes auto-generated Ruby resource classes for the Shopify 2025-01 REST API release. This update adds support for managing key entities such as AbandonedCheckouts, Checkouts, Articles, Blogs, ApplicationCharges, and ApplePayCertificates, enabling developers to interact with the latest API endpoints and data structures in their integrations.
_lib/shopify\_api/rest/resources/2025\01 · high confidence
Initial Sorbet configuration added
Sorbet has been added to the project with a configuration file that sets the root directory to the project root and excludes the test/rest directory from type checking.
sorbet · high confidence
Initial Tapioca configuration and runtime requirements
Added the initial Tapioca configuration file and runtime requirement list to support Sorbet type checking. The configuration explicitly sets the 'openssl' gem to untyped, and the require file lists the specific gems and libraries (such as ActiveSupport, HTTParty, JWT, and Sorbet-runtime) that must be loaded for the type checker to function correctly.
sorbet/tapioca · high confidence
Introduce OAuth authentication data structures
Added new classes to the \ShopifyAPI::Auth::Oauth\ module to model OAuth flow data: \AccessTokenResponse\ now includes \refresh\_token\ and \refresh\_token\_expires\_in\ fields alongside existing access details, \AuthQuery\ parses and validates incoming OAuth callback parameters (code, shop, hmac, etc.), and \SessionCookie\ manages the \shopify\_app\_session\ cookie structure for session tracking.
_lib/shopify\api/auth/oauth · high confidence
Introduce dedicated GraphQL Admin and Storefront clients
This change introduces new \ShopifyAPI::Clients::Graphql::Admin\ and \ShopifyAPI::Clients::Graphql::Storefront\ classes to handle GraphQL API interactions. The Admin client accepts a session and an optional API version, delegating to an underlying HTTP client. The Storefront client supports both public and private access tokens, validates the shop domain, and automatically injects the appropriate authentication header (\X-Shopify-Storefront-Access-Token\ or \Shopify-Storefront-Private-Token\) into requests. Both clients support query variables, custom headers, retry logic, debug mode, and configurable response structuring.
_lib/shopify\api/clients/graphql · high confidence
Introduce new low-level HTTP client for Shopify API requests
This change introduces a new \ShopifyAPI::Clients::HttpClient\ along with supporting \HttpRequest\ and \HttpResponse\ classes, providing a dedicated, typed interface for making HTTP requests to the Shopify API. The new client handles session management, constructs requests with appropriate headers (including user-agent and access tokens), and manages response parsing, including JSON body handling and pagination link extraction. It also implements retry logic for 429 and 500 errors, captures deprecation headers, and gracefully handles non-JSON responses (like HTML) by raising specific errors. This replaces or supplements previous HTTP handling mechanisms with a more robust, structured approach.
_lib/shopify\api/clients · high confidence
New Admin REST API client with deprecation guard and version override
A new \ShopifyAPI::Clients::Rest::Admin\ client has been introduced to handle REST API requests. This client includes a safety check that raises a \DisabledResourceError\ if the REST client is disabled via configuration, directing users to the GraphQL Admin API. It allows specifying an API version either at initialization or via global context, with logging for redundant or overridden versions. The client supports standard HTTP methods (GET, POST, PUT, DELETE) and constructs JSON API paths automatically.
_lib/shopify\api/clients/rest · high confidence
New authentication primitives and token exchange capabilities
The \lib/shopify\_api/auth\ directory now introduces several new classes and modules to support modern Shopify authentication flows. \JwtPayload\ handles session token decoding with configurable leeway and supports API key rotation via \old\_api\_secret\_key\. \AuthScopes\ provides logic for managing and validating API scopes, including implied read/write relationships. \TokenExchange\ enables exchanging session tokens for online or offline access tokens and migrating non-expiring offline tokens to expiring ones. \ClientCredentials\ allows private apps to obtain access tokens using client credentials. \RefreshToken\ facilitates refreshing expired access tokens. \Session\ now includes fields for \refresh\_token\ and \refresh\_token\_expires\, and supports temporary session activation via \Session.temp\. \AssociatedUser\ and \Oauth\ modules are also introduced to handle user context and OAuth callback validation, respectively.
_lib/shopify\api/auth · high confidence
New utility modules for session handling, validation, and GraphQL proxying
The library introduces several new utility modules in the \ShopifyAPI::Utils\ namespace to support core API operations. \SessionUtils\ provides methods to extract session IDs from Shopify ID tokens (supporting both 'id\_token' and 'Bearer id\_token' formats) and cookies, distinguishing between online and offline sessions. \HmacValidator\ adds HMAC signature verification logic that checks against both the current and old API secret keys to support key rotation. \ShopValidator\ introduces domain validation and sanitization, ensuring shop domains belong to trusted Shopify domains (including support for Unified Admin). \GraphqlProxy\ enables proxying GraphQL queries through the API, handling both \application/graphql\ and \application/json\ content types while enforcing online session requirements. Additionally, \AttributesComparator\ provides logic for comparing and diffing REST resource attributes, including support for atomic hash updates, and \HttpUtils\ offers header normalization.
_lib/shopify\api/utils · high confidence
Behavioural changes
Add support for Shopify REST Admin API version 2026-04
This release adds the new 2026-04 REST Admin API version to the library, providing auto-generated resource classes for the updated quarterly release. Users can now interact with Shopify's 2026-04 endpoints using the standard client interface. This update includes a breaking change for the FulfillmentService resource: the \permits\_sku\_sharing\ attribute has been removed, as all fulfillment services now implicitly permit SKU sharing.
_lib/shopify\_api/rest/resources/2026\04 · high confidence
Added RBI todo file for unresolved constants
A new \sorbet/rbi/todo.rbi\ file has been added to track unresolved constants, specifically defining empty modules for \Rack::Request::Env\ and \Rack::Request::Helpers\. This file is auto-generated and should be updated by running \bin/tapioca todo\ rather than edited manually, ensuring Sorbet can resolve these external dependencies without type errors.
sorbet/rbi · high confidence
Clearer error messages when REST resources are missing for the configured API version
When using the REST Admin API, the gem now provides specific, actionable error messages instead of generic "uninitialized constant" errors if the configured API version lacks bundled resource definitions. This occurs when the API version is not set, is set to "unstable", or is a stable version not yet bundled in the current gem release. The change helps users quickly identify whether they need to call \Context.setup\, switch to a stable API version, upgrade the gem, or use the GraphQL API instead.
lib · high confidence
Enforce code quality and type-safety standards with RuboCop and Sorbet
The project now enforces consistent code style and static type checking by introducing a \.rubocop.yml\ configuration that inherits from \rubocop-shopify\ and enables \rubocop-sorbet\ rules, alongside a \.ruby-version\ file pinning the runtime to Ruby 3.3.7. This ensures all new contributions adhere to the library's specific linting and Sorbet typing requirements.
(repo-wide) · high confidence
Introduce structured webhook registration and handling API
The library now provides a dedicated webhook management system via the \ShopifyAPI::Webhooks::Registry\, allowing developers to register webhook topics with support for HTTP, Pub/Sub, and Event Bridge delivery methods. This new API supports advanced filtering options, including \fields\, \metafield\namespaces\, and custom \filter\ strings, enabling more precise data control. The \WebhookHandler\ interface and \WebhookMetadata\ struct standardize how incoming webhook payloads are processed, while the \Request\ class ensures robust parsing of both legacy and new \shopify-\\ header formats. Registration results are returned via a typed \RegisterResult\ object, simplifying error handling and status checking for users.
_lib/shopify\api/webhooks · high confidence
Introduces specific error classes for API operations
The library now provides distinct error classes within the ShopifyAPI::Errors namespace to handle specific failure scenarios, replacing generic exceptions with more precise types. This includes HttpResponseError, which exposes HTTP status codes and response bodies, and specialized errors for authentication and session issues (such as InvalidJwtTokenError, NoActiveSessionError, and SessionNotFoundError), validation failures (InvalidShopError, InvalidOauthError), and webhook management (InvalidWebhookError, WebhookRegistrationError). Notably, RestResourceNotLoadedError inherits from NameError to maintain compatibility with existing rescue blocks, while MaxHttpRetriesExceededError extends HttpResponseError to provide context on failed requests.
_lib/shopify\api/errors · high confidence
New REST resource base class and error handling structure
The \lib/shopify\_api/rest\ area now introduces a new \ShopifyAPI::Rest::Base\ class that serves as the foundation for REST resources, featuring Sorbet type strictness, support for custom HTTP headers, and specific handling for read-only and atomic hash attributes. Alongside this, a new \ShopifyAPI::Rest::BaseErrors\ class has been added to aggregate HTTP response errors and provide access to error codes, replacing the previous error handling mechanism in this layer.
_lib/shopify\api/rest · high confidence
Release Shopify API gem version 16.3.0
This update releases version 16.3.0 of the Shopify API library. It introduces a new \AdminVersions\ module that defines the list of supported Admin API versions, including the new 2026-10, 2026-07, 2026-04, and 2026-01 releases, while removing the previous \LATEST\_SUPPORTED\_ADMIN\_VERSION\ and \RELEASE\_CANDIDATE\_ADMIN\_VERSION\ constants. The \Context\ class now enforces that the configured \api\_version\ exists in this supported list, raising an \UnsupportedVersionError\ if it does not. Additionally, the library adds an \Auth\ module with an \embedded\_app\_url\ helper to construct host app URLs and includes a dedicated \Logger\ class to manage logging levels and deprecation warnings.
_lib/shopify\api · high confidence
Support for metafield namespaces and filters in webhook registrations
The webhook registration logic in \lib/shopify\_api/webhooks/registrations\ has been extended to support \metafield\_namespaces\ and \filter\ parameters for HTTP, EventBridge, and Pub/Sub webhook types. This allows users to register webhooks that include specific fields and apply filters, with the registry now correctly checking and updating these attributes when they change.
_lib/shopify\api/webhooks/registrations · high confidence
Test coverage
Added REST API tests for the 2025-10 version; Added automated tests for 2023-01 REST resources; Added generated REST API tests for the 2024-10 version; Added test coverage for Admin Versions, Auth, Context, Logger, and REST resource loading; Added test coverage for authentication components; Added test coverage for the new HTTP client and REST resource layers; Added test coverage for utility modules; Added test helpers for REST resources, GraphQL client, and webhook handling; Added tests for 2022-04 REST API resources; Added tests for 2022-07 REST API resources; Added tests for 2022-10 REST resources; Added tests for BaseErrors error handling; Added tests for GraphQL Admin and Storefront clients; Added tests for OAuth access token response and auth query validation; Added tests for the 2026-04 REST Admin API version; Added tests for the Admin REST client; Added tests for webhook registry and request handling.
Dependencies
Initial release of shopify\_api gem v16.3.0
This entry introduces the shopify\_api gem (version 16.3.0) for Ruby developers, enabling programmatic access to the Shopify Admin API. The package requires Ruby 3.2 or higher and relies on runtime dependencies including activesupport, addressable, concurrent-ruby, httparty, jwt, oj, openssl, securerandom, sorbet-runtime, and zeitwerk. Development tooling is provided via rubocop, sorbet, tapioca, and minitest.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 62 → 69 (+6.7)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 90 → 90 (+0.3)
- Architecture 93 → 93 (-0.1)
- Maturity 46 → 54 (+8.1)
- Readiness 76 → 76 (+0.0)
- Security 72 → 88 (+16.0)
Resolved (13)
- Duplicated block (10 lines × 3) (lib/shopify_api/auth/client_credentials.rb)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Inconsistent equality method naming. Most types use the standard Ruby == operator, but ShopifyAPI.Auth itself exposes const_missing which is a hook, not an equality check. However, within the Auth sub-namespace, the naming is consistent (==). The real inconsistency is between ShopifyAPI.Auth.==(other) (if it exists as a class method or instance method on the Auth module/class) and the specific sub-types. Looking closely, ShopifyAPI.Auth is a module/class, while Session, JwtPayload etc are classes. The signature Auth.==(other) suggests an instance method on the Auth class, whereas AuthScopes.==(other) is on AuthScopes. This is actually consistent Ruby style.
Wait, looking closer at ShopifyAPI.Auth.AssociatedUser having Method: AssociatedUser.==(other) and ShopifyAPI.Auth.Session having Method: Session.==(other). This is consistent.
Let's look for actual duplicates.
ShopifyAPI.Clients.Graphql.Admin and ShopifyAPI.Clients.Rest.Admin both have initialize(session, api_version). This is consistent.
ShopifyAPI.Clients.Graphql.Client and ShopifyAPI.Clients.Graphql.Storefront both have query(...). This is consistent.
ShopifyAPI.Rest.Base has base_find(session, ids, params). Many resource classes like ApplicationCharge have find(id, fields, session). This is a significant inconsistency. The base class exposes a low-level base_find, while the concrete resources expose a high-level find with different argument ordering and semantics (e.g., id vs ids, fields vs params).
ShopifyAPI.Rest.Base has save!() and save(update_object). Concrete resources inherit this, so it's consistent.
ShopifyAPI.Rest.Base has delete(params). Concrete resources like ApplicationCharge have find(id, ...) but do they have delete? Article has delete(id, blog_id, session). AndroidPayKey has delete(id, session). The base class delete takes params, while concrete classes take specific IDs and session. This is an inconsistency in the public API surface of the resources vs the base.
Actually, the most glaring issue is ShopifyAPI.Auth.==(other) vs ShopifyAPI.Auth.Session.==(other). If Auth is a module, Auth.== is weird. If it's a class, it's fine. But ShopifyAPI.Auth is listed as a type. ShopifyAPI.Auth.AssociatedUser is a type.
Let's look at ShopifyAPI.Clients.HttpClient.request(request, response_as_struct) vs ShopifyAPI.Clients.Graphql.Client.query(...). These are different domains (HTTP vs GraphQL), so not inconsistent.
Let's look at ShopifyAPI.Rest.Base.base_find vs ShopifyAPI.ApplicationCharge.find. Base.base_find(session, ids, params) ApplicationCharge.find(id, fields, session)
The base class method is named base_find and takes ids (plural) and params. The resource method is named find and takes id (singular) and fields. This is a naming and signature inconsistency for the same logical operation (retrieving a resource).
Also, ShopifyAPI.Rest.Base has delete(params). Article has delete(id, blog_id, session). AndroidPayKey has delete(id, session). The base class delete is likely a helper or internal, but it's exposed. The resource delete methods vary in arguments (some take blog_id, some don't). This is an inconsistency in the delete operation signature across resources.
However, the prompt asks for operations that appear to do the same thing under different names. base_find vs find is the strongest candidate. base_find is clearly the implementation of find for the base class, but it's exposed publicly with a different name and signature.
Another one: ShopifyAPI.Auth.Session.temp vs ShopifyAPI.Auth.Session.from. These are distinct.
ShopifyAPI.Clients.Graphql.Admin and ShopifyAPI.Clients.Rest.Admin are distinct clients.
Let's stick with base_find vs find.
- Inconsistent naming and signature for resource retrieval. The base class exposes base_find with ids (plural) and params, while concrete resource classes expose find with id (singular) and fields. This forces developers to use different method names and argument structures for the same logical operation depending on whether they are using the base class or a specific resource.
- No SBOM
- No artifact signing
- No build provenance
- Orphaned file (lib/shopify_api/auth/token_exchange.rb)
- Orphaned file (lib/shopify_api/clients/http_client.rb)
- Unpinned build actions
- Workflow token permissions not restricted (.github/workflows/close-waiting-for-response-issues.yml)
New (1)
- Duplicated block (10 lines × 2) (lib/shopify_api/auth/refresh_token.rb)
Changes since last survey
- 13 commits — 13 feature/other, 0 fixes
By area
- (repo) — 6 commits
- (root) — 3 commits
- .github/workflows — 3 commits
- lib/shopify_api — 1 commit
Notable commits
- change: Add JWT client assertion support to client credentials
- change: Merge branch 'main' into gardener/cleanup-dead-workflows
- change: Merge pull request #1473 from Shopify/v16.3.1
- change: Merge pull request #1474 from Shopify/gardener/cleanup-dead-workflows
- change: Merge pull request #1475 from Shopify/zl/client-assertions
- change: Merge pull request #1480 from Shopify/v16.4.0
- change: Merge pull request #1481 from jsaubry/js-11-05-token-exchange-invalid-identity-session
- change: Prepare release v16.3.1
- change: Release v16.4.0
- change: Remove gardener Slack notification and auto-labelling workflows
- change: Remove unused gardener investigate workflow
- change: Replace blocked issues-helper action with actions/stale in the waiting-for-response closer
- change: Treat invalid_identity_session token exchange errors as invalid JWT
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Shopify/shopify-api-ruby was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit bf75c566c9bd961550ec78a96264b13e12d8afaf — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.