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.
Module authors use Swagger to check that the REST routes declared by their custom module are registered, appear under the expected paths and show the parameters and schemas they intended. This is useful during development because a route that does not appear in the documentation often points to a mistake in the webapi declaration or the module setup.
- Route registration: Confirm that each custom route appears under the expected service and version, and that its HTTP method matches the declaration.
- Schema checks: Compare the documented request and response schemas with the data interfaces the module exposes, so the contract does not drift during refactoring.
- ACL mapping: Check which resource each route requires, then test the route with a role that has and lacks that permission.
- Asynchronous routes: If the module adds an asynchronous operation, confirm the documented behavior matches the message queue configuration in your install.
- Local iteration: Run the check on a local or development instance after a cache flush and a setup upgrade, since stale generated code can hide a change.
The Swagger view is generated from your declarations, so it confirms what is registered, not whether the service logic is correct. Verify the implementation in the module's PHP classes and its automated tests, and confirm the generated output on your own install.
Security reviewers use the Swagger pages as an inventory of the API surface that is exposed on an instance. The inventory helps them see which endpoints exist, which authentication types they reference and whether an interactive documentation page is reachable from a network it should not be reachable from. Their main question is what an outside caller could see and invoke.
- Exposure inventory: Record every documented endpoint, grouped by service and by the ACL resource it requires, and flag any that expose customer or admin data.
- Access to the page itself: Test whether the documentation URL responds from outside the admin or internal network, and whether it is blocked in production.
- Token and role testing: Call sensitive endpoints with anonymous, customer and integration tokens to confirm the permission model holds.
- Custom module review: Include routes added by custom modules in the inventory, since they are often missing from vendor-level reviews.
- Findings and retest: Record each finding with the endpoint, the role used and the observed response, then retest after the fix.
Rely on the Swagger output as a starting point only. Confirm authorization decisions in the code and in live tests, and ask your platform team to confirm how the documentation is served in your environment before you record a result.
Environment choice matters as much as the audience. A local or development instance is best for building and checking custom routes, a staging instance that mirrors production modules and configuration is best for integration testing, and production should not serve interactive API documentation to general networks. Each environment answers a different question, and mixing them leads to conclusions that do not hold for the live store.
- Local: Use a development instance to test new routes and schemas, since changes can be made and cleared quickly.
- Staging: Use a copy with the same extensions, store configuration and customer data policy as production for integration and permission tests.
- Production: Do not expose the documentation page publicly, and limit any check to read-only calls that the change process allows.
- Version match: Confirm that the environment runs the same Magento Open Source release and module set as the target, because endpoints differ between versions.
- Documentation access: Ask the platform team to confirm, for each environment, who can open the page and from which networks.
To confirm what your install exposes, check the module list, the web server rules and the access controls on each environment before you rely on any documented endpoint.
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.
| Option | Developer speed | Information exposure and review effort | When it fits |
|---|---|---|---|
| Enabled in non-production | High: developers can try endpoints against the exact install, including custom module APIs | Moderate: staging holds real module structure and sample data, so limit access to the team and confirm who can reach the host | Build and integration phases where developers need live, version-accurate endpoint details |
| Restricted by network or admin role | Moderate: remote teams and contractors still get access through VPN or allowed IP ranges | Lower: exposure narrows to approved networks, but role and network rules must be tested and kept current | Shared staging or QA environments reachable by several vendors |
| Spec exported for review | Lower: reviewers work from a file, so live try-it-out testing waits for a sandbox | Lowest: the export can be versioned, diffed and reviewed without a running endpoint | Security reviews, API design sign-off and partner onboarding where no running server is needed |
| Disabled on production | Not applicable: production is not used for exploration | Lowest: no interactive documentation is served to the internet or to internal users who should not see it | Live 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.
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.
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.
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.
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.
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.
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.
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 docsEndpoints 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 requirementsOpen 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 siteQuestions 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.

