Find a store by domain
const url = 'https://apibase.ecomweb.app/api/v1/public/stores/domain/example';const options = { method: 'GET', headers: {'x-store-preview': 'example', 'x-storefront-api-key': '<x-storefront-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://apibase.ecomweb.app/api/v1/public/stores/domain/example \ --header 'x-store-preview: example' \ --header 'x-storefront-api-key: <x-storefront-api-key>'Resolves a store’s subdomain or custom domain to the store, so a storefront served on that host can learn its ref. A value with a dot is a custom domain, which resolves only once its ownership is verified; a value without one is a subdomain. The body is empty when no store has that domain. A store that is suspended, disabled or still coming soon answers with an error instead.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The subdomain, such as my-shop, or the custom domain, such as shop.example.com.
Header Parameters
Section titled “Header Parameters”Responses
Section titled “Responses”The store, or an empty body when no store has that domain.
object
Store description, or null.
Whether visitors see the coming soon page instead of the storefront.
When the store was first opened to the public, as an ISO 8601 timestamp, or null.
The store’s domains.
object
The store’s subdomain on the platform domain, or null.
The store’s custom domain, or null.
Whether ownership of the custom domain is verified. Present only when the store was looked up by domain.
For a store that runs on an external theme, the site its hosts redirect to; otherwise null.
The store’s reference, used as storeRef in every other route.
Store name.
The store’s status; only active stores are returned.
When the store was created, as an ISO 8601 timestamp.
When the store was last updated, as an ISO 8601 timestamp.
Example generated
{ "description": "example", "coming_soon": true, "first_opened_at": "example", "config": { "subdomain": "example", "custom_domain": "example", "verified": true }, "storefront_url": "example", "ref": "example", "name": "example", "status": "example", "created_at": "example", "updated_at": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The resource does not exist in this store.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}