urls/identify answers the question of which page should be displayed for a requested address and is therefore the entry point for the routing of your own storefront. urls/product and urls/category go the opposite way and return the matching address for a known ID, for example to generate links in lists and navigations.
A typical flow is: the storefront passes the requested address to urls/identify, receives the page type and ID in return, and then loads the contents via the Catalog API.
Which subshop responds is determined by the domain the calls are made against. More on this under Storefront API Basics. Since SEO URLs are maintained per subshop, the same address returns different results in different subshops.
The endpoints on this page do not require an
x-session header. Sending the header anyway does no harm.Supported methods
List of all supported methods.
The endpoints respond to all other HTTP methods with
404 Not Found.
Methods for URL resolution
GET urls/identify
The following call maps an incoming address to a shop resource. The response tells you which page type to render, which resource to load for it, and whether a redirect should happen instead. The endpoint is intended for storefronts that handle routing themselves. The storefront passes in the address requested by the visitor and, based on the response, decides whether to deliver a product page, a category page, a redirect, or a 404 page. Example requestParameter overview
The matching is done character by character against the stored SEO URLs. A differing trailing slash or differing upper / lower case therefore leads to
404 Not Found. A query string included in the value of url also leads to 404 Not Found. Additional query parameters on the endpoint itself, in contrast, are rejected with 400 invalidParameters. Pass only the path, with a leading slash and without a query string.
Response fields
Page types
The value of
type is the identifier of the responsible view controller. If the shop uses additional page types with their own SEO URLs, their identifiers can also appear. Therefore, catch unknown values and output your own 404 page in that case.
Responses at a glance
Example response: existing resource
Example response: start page
Example response: template page
Example response: old address of the same resource
type and id describe it correctly.
Example response: deleted resource with redirect target
type and id describe the resource that no longer exists. They must not be used to load page data; only redirect can be evaluated here.
Example response: unknown address
Evaluation in the storefront
Evaluate the response in this order:- HTTP status 404: The address is unknown to the shop. Output your own 404 page.
- Field
redirectpresent: Redirect to this value, recommended with status 301. This applies both to old addresses and to deleted resources. Therefore, checkredirectbeforefound. - No
redirect,foundistrue: Build the page as usual.typedetermines the page type,idis the resource for the subsequent call tocatalog/product/loadorcatalog/category/load. - The load call comes back empty: The resource is deactivated or deleted without a redirect target being stored. Output your own 404 page.
found: false with the stored redirect target. In this case, two redirects happen in succession.
found: true means that the address can be resolved, not that the resource can be delivered. A deactivated product without a stored redirect target returns found: true. The storefront must detect this case itself by checking the result of the subsequent load call.Structure of the redirect field
redirect is always a path and starts with /; it is not an absolute URL. The value can be set directly as the Location header. Two forms are possible:
- an SEO URL of the target, for example
/herren/schuhe - a technical shop URL if no SEO URL exists for the target, for example
/?wsvc=Category&id=135-98530
Prerequisite for redirects of deleted resources
A redirect target for a deleted resource is only output ifredirectToParentCategory is active in the shop. The default is active, see urls.redirects. If the option is deactivated, a deleted resource behaves like a resource without a stored target.
Error codes
GET urls/product
The following call returns the address of a product. Use it to generate links to product pages in lists, search results, or recommendations without having to replicate the shop’s URL scheme in the storefront. Example requestParameter overview
Example response
Status codes
If the product cannot be loaded, the endpoint responds with404 Not Found and an empty body. If productId is missing or additional query parameters were passed, the endpoint responds with 400 Bad Request and the error code invalidParameters.
GET urls/category
The following call returns the address of a category, for example for building the navigation or breadcrumbs. Example requestParameter overview
Example response
Status codes
If the category cannot be loaded, the endpoint responds with404 Not Found and an empty body. If categoryId is missing or additional query parameters were passed, the endpoint responds with 400 Bad Request and the error code invalidParameters.
Further links
- Storefront API Basics - Base URL, subshop selection via the domain, session handling, and error format.
- Storefront API Catalog - Load product and category data for the determined ID.
- urls - URL (web addresses) - Structure of the SEO URLs and behavior for addresses that are no longer valid.
- Storefront API Session Handling - Handing the session over to a template page.
