Exploring the Magento Open Source REST API with Swagger

Use the Swagger documentation generated by your own Magento Open Source install to find the REST and asynchronous endpoints it actually exposes, then turn them off on production.

On this page

Exploring the Magento Open Source REST API with Swagger for your exact install

An integration or front-end team usually needs one answer before writing code: which REST and asynchronous endpoints does this specific Magento Open Source build expose, including the APIs added by custom modules? The built-in Swagger documentation answers that question from the install itself. Its endpoint list is generated from the modules and routes that are enabled on your codebase, so a module your developers added or a third-party extension you installed appears there only if it registers its own web API routes. Treat the output as the list of what your store actually serves, not as a copy of the public documentation for the release. It shows routes, methods and request and response schemas, but it does not show who may call each route, what business rules apply, or how the endpoint behaves under load. Those answers come from the ACL resources, the module code and your test results.

Teams should open the Swagger documentation at three points: when scoping an integration, when reviewing a custom module's API surface before release, and when onboarding a vendor who needs access. Before relying on the output, confirm two things with your own environment. First, confirm which 2.4.x line you run, because the supported PHP, MySQL or MariaDB, OpenSearch, Redis or Valkey, RabbitMQ and nginx versions differ between releases. The Adobe system requirements for 2.4.9 list PHP 8.5 and OpenSearch 3, while the 2.4.8-p5 requirements list PHP 8.4 or 8.3, so an install on 2.4.8 may not match what a 2.4.9 reference shows. Second, confirm the support end date for your line in the Adobe Commerce lifecycle policy, since an endpoint list is only useful while the release still receives security patches.

Use the generated list as an input to a review, not a finished contract. Record each endpoint an integration will call, the token type it needs, and the ACL resource that gates it, then test those calls against a non-production copy. Ask the module author to confirm which custom routes are intended for external clients. Keep the documentation route off production, or restricted to internal networks, because a complete map of your APIs is useful to an attacker as well as to your integration team.

Which exploration method fits which team

Integration developers use the Swagger pages to find the endpoints their connector needs, confirm the request and response shapes for their install, and test calls before writing client code. The documentation reflects the modules enabled on that instance, so it is the fastest way to see whether a given ERP, PIM or marketplace endpoint is present and what fields it expects.

  • Endpoint discovery: Search the documented paths for the resources the connector reads or writes, such as products, orders or stock items, and note the exact paths for your version.
  • Payload shapes: Use the schema views to capture required fields and data types, then compare them with a real response from a test order.
  • Authentication behavior: Confirm which token type each endpoint accepts and how the Authorize step is configured on your install before you script anything.
  • Asynchronous endpoints: Check which bulk or queued operations are listed and whether your client handles their status responses.
  • Scope of the connector: Record which resources the integration user is allowed to touch, since the documentation lists endpoints whether or not a given role can call them.

Before release, confirm the final behavior in the Magento source code for your exact version and in a staging run, because the Swagger page describes the interface, not every business rule behind it.

Configuration options and when each fits

This table compares four ways to handle the Swagger interface on a Magento Open Source install: keeping it on in non-production, restricting it, exporting the spec for review, and disabling it on production. Read each row against your team's need for developer speed, how much endpoint detail you can expose, and how much review effort you can staff.

OptionDeveloper speedInformation exposure and review effortWhen it fits
Enabled in non-productionHigh: developers can try endpoints against the exact install, including custom module APIsModerate: staging holds real module structure and sample data, so limit access to the team and confirm who can reach the hostBuild and integration phases where developers need live, version-accurate endpoint details
Restricted by network or admin roleModerate: remote teams and contractors still get access through VPN or allowed IP rangesLower: exposure narrows to approved networks, but role and network rules must be tested and kept currentShared staging or QA environments reachable by several vendors
Spec exported for reviewLower: reviewers work from a file, so live try-it-out testing waits for a sandboxLowest: the export can be versioned, diffed and reviewed without a running endpointSecurity reviews, API design sign-off and partner onboarding where no running server is needed
Disabled on productionNot applicable: production is not used for explorationLowest: no interactive documentation is served to the internet or to internal users who should not see itLive stores handling customer and payment-adjacent data; confirm the exact setting key for your version

Setting up Swagger exploration on a non-production install

This sequence gives your team a verified, read-only view of the REST and asynchronous endpoints on a copy of your store that matches production, including the endpoints your custom modules add. It keeps the documentation interface away from the live site.

  1. Confirm the release line and system requirements

    Before anything is installed, record the exact Magento Open Source version running in production and confirm it against the released versions and the system requirements for that release. Check the PHP, database, OpenSearch, Redis or Valkey, RabbitMQ, Composer and nginx versions your platform team uses, because Adobe supports only the listed combinations. Confirm every version against the Adobe documentation for the installed release rather than relying on older notes. Done when the team has a written version matrix signed off by the platform owner.

  2. Build a non-production instance from production code

    Deploy a staging instance from the same codebase, Composer lock file and build artifacts that run production, then restore a recent copy of the database and media into it. Keep the same custom modules and their versions so that any endpoint you see reflects what customers reach. Record the commit or build identifier on both environments. Done when a diff of the module list and configuration between staging and production shows only expected environment differences, such as hostnames and credentials.

  3. Enable the documentation interface only in staging

    Turn on the Swagger documentation interface in the staging instance only, using the configuration path documented for the installed version. Confirm the setting in production is off, and make sure the interface is not exposed through the public web server, CDN or load balancer rules. Restrict access to the staging hostname by network or identity controls. Done when the documentation page loads for an authorized tester in staging and returns a denial from the production hostname.

  4. Sign in with a least-privilege integration

    Create an integration or token for exploration that has only the resource permissions needed for the endpoints you plan to read, following the access setup documented for your release. Do not use a full administrator account. Record the token lifetime and who owns the credential, and plan its revocation when the exploration work ends. Done when a request with that credential succeeds on the intended resources and is refused on a resource outside its scope.

  5. Run a small set of read-only calls

    Start with a few GET requests against catalog, customer and store configuration resources, using the interactive documentation or a command-line client with the exact paths listed for your version. Check the status code, response shape and any pagination or search parameters, and note how errors are returned. Avoid write methods in this phase, and keep a log of each request. Done when every call returns the expected status and a response matching the documented schema for that resource.

  6. Check that custom module endpoints appear

    Compare the endpoints listed in the documentation with the routes declared in each custom module's webapi.xml file, including the service interfaces and the HTTP methods and resources they map to. Any route in webapi.xml that is missing from the list, or any listed route with no matching declaration, needs investigation before the module is signed off. Confirm the custom endpoints also respond to a read-only call with the permissions you granted. Done when the team has a reconciliation table with no unexplained differences.

  7. Check asynchronous endpoints and record the result

    Where your modules or the platform expose asynchronous endpoints, confirm they appear in the list, then confirm the documented way to read their status, following the Adobe documentation for the installed version. Store the reconciliation table, the request log and the configuration evidence showing the interface was disabled in production. Remove or revoke the exploration credential and disable the interface when the review ends. Done when the record shows the production setting is off and the credential is revoked.

Security risks of leaving API docs exposed

Swagger output describes every route, parameter and auth method your install exposes, which is useful to your own team and to anyone who finds it. The cards below cover the main ways that documentation becomes an attack aid, and the controls that keep it contained.

Revealing custom endpoints

Custom module APIs often carry business logic, parameter names and internal field meanings that never appear in public Magento documentation. If the Swagger UI is reachable from the internet, an outsider can map those routes without touching the application. Check which custom modules register REST routes, then confirm that none of their schema is served on a public hostname.

Docs paired with broad tokens

Someone browsing the Swagger UI can try calls with whatever credential is entered into it. An integration token scoped to many resources turns a documentation page into a working administrative client. Review each integration's resource list and confirm that no token with wide access is used from a browser session that the docs page can reach.

Proxy and CDN misconfiguration

Reverse proxies, load balancers and CDNs often route paths by prefix, so a rule written for the storefront can unintentionally pass a documentation path to the origin. Caching layers can also store a documentation response and serve it to other visitors. Test the documentation path from outside your network after every change to edge rules, and confirm the origin returns a refusal.

Docs drifting from the build

Swagger output is generated from the code deployed on that install. When a patch, a module upgrade or a removed route changes the surface, a copy saved in a wiki or ticket describes an API that no longer matches production. Teams that test against stale definitions can miss removed endpoints or changed required fields. Regenerate the specification after each release and retire saved copies.

Production data in test calls

Exploring endpoints with the live store creates real orders, customers and inventory changes, and the request and response bodies may be written to logs or shared in tickets. Personal data in those records brings the activity under your privacy obligations. Use a staging copy with masked customer data for exploration, and confirm which request bodies your logging configuration keeps.

Weak admin access to the docs

Where the documentation is reachable only by admin users, its security depends on the admin login, its two-factor settings and session lifetime. A single weak admin account then exposes the full route list. Confirm that admin accounts for documentation access use strong authentication, that former staff accounts are removed, and that the Content Security Policy configuration is reviewed when the admin pages change.

Reviewing custom module APIs before they reach production

A custom module that adds REST routes is only as safe as the route declarations behind it, so review those declarations before the module reaches production. In a Magento Open Source install, a module's web API routes are defined in its webapi.xml file, and each route names the HTTP method, the URL, the service method it calls and the resources it requires. For every route in your spec, confirm the <resources> block grants access only to what the endpoint needs, and check that the route is not set to anonymous unless it truly must be public. Anonymous access, customer access and admin access are different risk levels, so the reviewer should write down the intended audience for each route and compare it with what the spec shows.

Modules in Magento Open Source follow a PSR-4 compliant structure, as Adobe's developer documentation describes, so the service classes behind each route live in predictable namespaces and can be read in order. Start from the route, open the service interface it maps to, and then open the implementation. Look for input validation on every parameter, including IDs that could belong to another customer, and confirm that the service checks ownership or role before it reads or writes data. Also confirm that the route appears in the spec as intended. A route that exists in code but is missing from the spec, or a spec entry for a route you did not expect, both need explanation before release.

A clean spec does not prove the code is secure. The spec describes what the API accepts and returns, not whether the business logic enforces the rules behind it. Pair the spec review with a code review of the authorization and validation paths, and with security testing of the running endpoints, including attempts to access another customer's records and to call admin-only operations with a customer token. Ask your reviewers and testers to confirm the scope of their work in writing before testing begins, and keep the review results with the release record so the next change to the module is checked against the same questions.

Limits to confirm in your environment

The Swagger view reflects the code installed on your server, but it is not a complete contract for your store. The cards below cover what to check on your own install before you build an integration or test plan against it.

Whether the docs view is enabled

The Swagger interface is not something you can assume is present on every install. Confirm on your exact release whether the documentation view loads, which module or configuration controls it, and who can reach it from your network. Record the result per environment, since a staging build and a production build of the same version can differ in configuration. Treat the answer as a fact about your install, not about Magento Open Source in general.

Adobe PHP development docs

Endpoints the spec omits or describes loosely

Generated documentation lists the routes that are registered, but it may describe request bodies, optional fields or error responses incompletely. Compare each endpoint you plan to call against a real request and response on a test install. Pay particular attention to store-scoped routes, where the store code in the path changes behavior. Keep a list of gaps so your integration team does not treat the spec as the final word.

Asynchronous endpoint behavior and queues

Asynchronous endpoints accept a request and process it later through the message queue, so the response only confirms acceptance. Confirm which consumers must run on your install, how they are started, and what happens to queued messages when a consumer stops. Check how your team will track the outcome of each request. Queue services and their versions depend on your deployment, so confirm the supported combinations against the system requirements for your release.

System requirements

Open source and Adobe Commerce differences

The Swagger output comes from the code you run, so an endpoint present in Adobe Commerce may be absent in Magento Open Source, or the reverse. Before you design around a route, check it in the edition you will run. Treat any endpoint that appears only in one edition as a dependency on that edition. Ask your vendor or check the release notes for the features each edition ships.

Forks and third-party modules

A distribution such as Mage-OS, or an extension that adds its own routes, may not match upstream endpoints exactly. Export the spec from your own install and diff it against the upstream release you are targeting. Custom module APIs in your codebase should be documented in the same export so reviewers can see them together. Re-run this comparison after every extension update or distribution upgrade.

Mage-OS site

Questions buyers ask before exploring the API with Swagger

Can our own team explore the Magento REST API with Swagger without a partner?

Yes, if one or two engineers already know Magento, can run a staging copy of the store and can read the module code they are documenting. The Swagger interface is part of the install, so the work is mostly configuration, access and reading the output against your own custom modules. Teams usually need outside help when custom module APIs are poorly documented, when the install was built by someone who has left, or when the review has to be signed off by people outside engineering. Ask your team to name the staging environment, the module owners and the reviewer before deciding who does the work.

How much effort does a first Swagger review take, and what drives it?

The main driver is the number of endpoints the review must cover, which grows with each custom module, each installed extension that exposes REST routes and each third-party integration that calls the store. A store with a few standard integrations and one custom module is a smaller exercise than one with several custom APIs, asynchronous endpoints and multiple store views. Other drivers include how well the custom code is documented, how many roles and tokens must be tested and whether findings need fixes and a retest. Ask any provider for a quote that lists the modules, extensions and integrations in scope and the endpoints each one exposes.

What does the work need from our side?

Three things matter most. First, a staging environment that matches production closely enough for the results to mean something, with the same Magento Open Source version, extensions and configuration. Second, a test token with the permissions the reviewer needs, created for that purpose and not shared with production integrations. Third, a named reviewer on your side who can decide which endpoints are in scope, confirm expected behavior for custom modules and accept or reject findings. Without the reviewer, the output tends to stall at the point where someone must decide what a response should look like.

Can Swagger output replace a code review of our custom APIs?

No. Swagger shows the routes, parameters and schemas the running install exposes, which is useful for finding undocumented endpoints, checking request formats and spotting accidental exposure. It does not show how a controller authorizes a request, how it handles malicious input, how it writes to the database or whether a plugin changes behavior in an unsafe way. Those questions need code review and testing against the running endpoints. Treat the Swagger output as an inventory that tells the reviewers where to look, and plan the code review as a separate step.

Which Magento versions and release lines does this affect?

The Swagger documentation depends on the Magento Open Source version and on the modules installed on that exact install, so the output for one release line can differ from another. Adobe's lifecycle policy sets how long each 2.4.x release line receives standard support, which matters if you plan to keep the docs pipeline running for years. Check the release you run against Adobe's released versions page and the lifecycle policy before you plan the review, and confirm whether your custom modules have been tested on that release.

How do we keep the API docs off production on an ongoing basis?

Set the rule in your deployment process rather than relying on memory. Keep the Swagger interface enabled only in staging or development builds, check the production configuration as part of each release, and add an automated test that fails if the docs endpoint responds on production. Restrict who can view the docs in any non-production environment and remove test tokens when a review ends. Re-check after each patch, because an upgrade or a new module can reintroduce exposure that was previously closed. Ask your provider or internal team to write this check into the release runbook with a named owner.

Does DeployOpen handle the review and the remediation?

DeployOpen plans and runs fixed-scope security testing of self-hosted platforms in your own infrastructure, so a Swagger-based review can be scoped as part of that work. The written scope sets which endpoints, modules and roles are covered, what the findings report contains and whether a retest is included. Fixes to custom code are agreed in that scope before work starts. Ongoing checks after each patch or release can be handled under a retainer. A quote follows from the written scope, and DeployOpen does not publish a price list.

How a developer moves from install to a tested endpoint

The path starts with a non-production instance built on a supported release line, where the developer enables the relevant modules and confirms the generated endpoint list matches what is installed. Next, a token is created with the smallest permissions the test needs, and one read-only call is made to confirm the endpoint behaves as documented. The output is then exported for review, and the production gate confirms that API documentation is disabled before any live deployment. Check each hand-off: the module state, the token scope and the export contents.

Steps from a non-production install to a reviewed endpoint and the production gate.

How DeployOpen scopes and supports API exploration work

DeployOpen treats API exploration as a scoped piece of work on your own Magento Open Source install. We confirm which Swagger-documented REST and asynchronous endpoints matter for your team, including any custom module APIs, then document, test and hand over how access to that documentation is controlled in your environment.

How we scope

  • We agree in writing which endpoint groups, custom module APIs and asynchronous operations are in the review.
  • We confirm the exact Magento Open Source version and extensions installed, since the documented endpoints depend on them.
  • We record which environments are covered, with production excluded from any interactive documentation access.

How we build

  • We enable the Swagger documentation only in the non-production environments defined in the scope.
  • We check that custom module endpoints appear correctly and that each one follows the access rules your team has chosen.
  • We test that documentation pages and API calls cannot be reached from the public internet without the agreed authentication.

How we hand over

  • We deliver a written record of the endpoints reviewed, the environment settings used and the access model applied.
  • We document how to switch the documentation off, and how to confirm it is off, before any production release.
  • We walk your developers through the exploration steps and the known limits of the generated documentation.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer, useful after each Magento patch cycle.
  • Ask us to confirm the scope, retainer terms and quote details against your own environment and release plan.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.