Skip to content

Organization, store, and seller

How each request selects its store and seller.

Every commerce resource belongs to a store, and stores belong to an organization. In a marketplace, offers also belong to a seller.

OrganizationAccount, plan and billingtenantIdStoremitienda.ecomiq.appstoreIdStoreotratienda.pestoreIdSellerownSellermarketplaceSellerownResourcesproducts · orders · customers · cartstenantId + storeId+ sellerId

The three levels

Organization. Groups the account, plan, billing, users, and one or more stores.

Store. Has its own catalog, orders, customers, and settings. It gets an *.ecomiq.app domain and can connect a custom domain.

Seller. Owns an offer inside the store. A simple store has one; a marketplace can have several.

How the store is selected

APIStoreSeller
AdminThe token's store_id claim or the x-Store-Id header.The token's seller_id claim.
StorefrontThe x-Store-Domain header.Set by the store.

Admin

An application created in a store gets a token with store_id, plus seller_id if it belongs to a seller. Send only the token:

curl "https://api.ecomiq.pe/api/v1/catalog/products?limit=25" \
  -H "Authorization: Bearer $ECOMIQ_TOKEN"

An organization application gets a token without store_id. Pick the store on each request with x-Store-Id; it must be a store in the same organization:

curl "https://api.ecomiq.pe/api/v1/catalog/products?limit=25" \
  -H "Authorization: Bearer $ECOMIQ_TOKEN" \
  -H "x-Store-Id: $ECOMIQ_STORE_ID"

If the token already has store_id and you send x-Store-Id with a different store, the API returns 403. To work with stores in another organization, create an application in that organization.

Storefront

Send the store's slug, its *.ecomiq.app subdomain, or its custom domain in x-Store-Domain:

curl "https://storefront.ecomiq.pe/v1/products?page=1&pageSize=24" \
  -H "x-Store-Domain: my-store"

A customer token identifies the shopper on account and checkout operations. The store is still selected with x-Store-Domain.

Identifiers

An identifier is only valid inside its store. Requesting a resource from another store or seller returns 404 or 403, even if the resource exists. When you get either status, check the token and the store header first.

To copy data to another store, create or import it in the target store.

Last updated:

On this page