How to work with the APIs for configuring your Projects.
APIs
| Resource | Purpose | Reference |
|---|---|---|
| Project | View and manage Project-wide settings, such as countries, languages, and currencies. | Project |
| Stores | Model the context your customers shop in. | Stores |
| Channels | Model a source or destination of entities, such as warehouses or stores. A Channel has one or more roles, such as inventory supply or product distribution. | Channels |
| Tax Categories | Define how Products are taxed in different countries. | Tax Categories |
Data model
Entity relationships
The following diagram shows the entities and their main relationships. For all references, see the table after the diagram. A Project owns all of them. A Store references Channels and Product Selections, a Tax Category embeds its Tax Rates, and Products and Shipping Methods reference a Tax Category.
The following table lists each relationship, including references that other resources hold to these entities:
| From | To | Cardinality | Kind | Rule |
|---|---|---|---|---|
| Project | Store, Channel, Tax Category | One to many | Ownership | Each Store, Channel, and Tax Category belongs to exactly one Project. |
| Store | Channel, through distributionChannels | Many to many | Reference | A Channel can be linked to several Stores. The Channel must have the ProductDistribution role. For the maximum number per Store, see Limits. |
| Store | Channel, through supplyChannels | Many to many | Reference | A Channel can be linked to several Stores. The Channel must have the InventorySupply role. For the maximum number per Store, see Limits. |
| Store | Product Selection | Many to many | Embedded setting that holds a reference | Each ProductSelectionSetting has an active flag. For how the settings determine the Products of a Store, see Products available in Store. |
| Tax Category | Tax Rate | One to many | Embedded | The Tax Rates are in the rates array of the Tax Category. |
| Tax Rate | Sub Rate | One to many | Embedded | The amounts of all subrates add up to the amount of the Tax Rate. |
| Product, Shipping Method, Custom Line Item | Tax Category | Many to one | Reference | Required for a Shipping Method, optional for a Product and a Custom Line Item. |
| Inventory Entry, Line Item, Store, Price, Standalone Price, Cart Discount gift Line Item | Channel | Many to one | Reference | Blocks deletion of the Channel. See Delete Channels. |
| Resources with a store reference, such as Cart and Order | Store | Many to one | Reference | If a resource references the Store, deleting the Store returns a ReferenceExists error. See Delete Store. |
Keys and identifiers
- Project: has no
id. Its user-definedkeyidentifies it. - Store: has an
idand akey. Thekeyis user-defined, unique, and immutable. - Channel: has an
idand a user-defined, uniquekey. - Tax Category: has an
idand an optionalkey. - Tax Rate: has its own
idand an optionalkey. Thekeyis unique within the Tax Category that contains the Tax Rate.
Channel roles
InventorySupply role makes a Channel a supply Channel, and the ProductDistribution role makes it a distribution Channel. For all roles, including the synchronization roles and Primary, see ChannelRoleEnum.Working with the APIs
Project
Project settings
A Project has a field for each of the following configurable features. For all fields and allowed values of a setting, see its linked type.
| Setting | What it configures | Default | Learn more |
|---|---|---|---|
messages | Querying of Messages about state changes in the Project, and how long Messages are kept. | Querying is off by default. When on, Messages are kept for 15 days (deleteDaysAfterCreation). | Message Query |
carts | Defaults for new Carts: the retention period, the rounding of prices and taxes, and whether the Tax Rate of a country without a state is a fallback when the Tax Rates don't cover the state of the shipping address. | Carts are deleted 90 days after the last modification (deleteDaysAfterLastModification). Country Tax Rate fallback is off (countryTaxRateFallbackEnabled). Prices and taxes are rounded HalfEven (priceRoundingMode and taxRoundingMode). | CartsConfiguration |
shoppingLists | The retention period of new Shopping Lists. | Shopping Lists are deleted 360 days after the last modification (deleteDaysAfterLastModification). | ShoppingListsConfiguration |
shippingRateInputType | The input that tiered shipping rates use to calculate shipping costs, such as order value or weight. | Not set. | Tiered shipping rates |
externalOAuth | The OAuth endpoint and authentication header for an external Identity Provider. | Not set. | Request an access token using an external OAuth server |
searchIndexing | Indexing of resources for search. | Not set. | Search indexing |
businessUnits | The configuration of Business Units to manage organizational structures, such as the status of a Business Unit that an Associate creates. | Business Units that Associates create are Inactive (myBusinessUnitStatusOnCreation). | BusinessUnitConfiguration |
inventory | The expiration of Reservations, which the ReserveOnCart inventory mode needs, and whether expired Reservations make the reserved stock available again. | Expired Reservations are released (releaseExpiredReservations is true). | InventoryConfiguration and Reservations |
discounts | How Product Discounts and Cart Discounts combine for Line Items in every Cart of the Project. | Stacking (discountCombinationMode). | DiscountsConfiguration and Discount interaction in Carts |
productCatalogModel | How Product Variants are managed in the Project. | Classic. | ProductCatalogModel and the migration guide |
Multi-region configuration
To configure your Project for multiple regions, set the following fields:
countries: define the countries where your Project operates. The APIs support ISO-3166 alpha-2 country codes. This enables you to manage shipping, taxes, and legal compliance across different countries. For example, you can set up a Project that operates in the US, UK, and Germany by specifying the respective country codes:[ "US", "GB", "DE" ].currencies: specify the currencies used in your Project. This allows transactions in multiple currencies. Set multiple ISO 4217 currency codes in an array, such as[ "USD", "GBP", "EUR" ], to support transactions in US Dollars, British Pounds, and Euros. Enabled currencies are available and visible for Products, Prices, and Orders in your Project to calculate Prices and handle transactions.languages: set the languages supported by your Project. This provides a localized shopping experience for customers in different Regions. You can specify multiple languages using IETF language tags, such as[ "en-US", "fr", "de" ], to support English, French, and German. After you set the languages, all resources in your Project have corresponding localized fields, such asnameanddescription, so you can provide tailored content for each language.
Store
Store-scoped API methods
Store-scoped API methods let you work with resources in a specific Store. They scope reads and writes to the named Store, so only data relevant to that Store is affected.
Permissions can be granted for particular Stores only.
manage_orders:acme-inc:luxury-brand, an API Client can only access Carts and Orders within the Luxury Brand Store, but not within the Budget Brand Store.manage_orders:{projectKey}:{storeKey}, to call Store-scoped API methods.Products available in Store
productSelections field. A Product Selection with Individual ProductSelectionMode includes Products, and one with IndividualExclusion excludes them. Each Product Selection is either active or inactive in the Store. The following rules decide which Products are available:- If the Store has no Product Selections, all Products in the Project are available.
- If at least one of the Store's Product Selections is active, only the active ones count. Inactive Product Selections have no effect.
- If only exclusion Product Selections are active, all Products are available except those whose Product Variants are all excluded by the active exclusion Product Selections.
- If at least one inclusion Product Selection is active, a Product is available only if it is included in at least one active inclusion Product Selection and at least one selected Product Variant remains after active exclusions are applied. Exclusions can affect an entire Product or specific Product Variants. For variant-level rules, see Product Variants in Store.
- If all of the Store's Product Selections are inactive, no Product is available when the Store has at least one inclusion Product Selection. If the Store has only exclusion Product Selections, all Products are available.
Channel
Supply Channel on Line Items
supplyChannel field of the Line Item references the Channel.Delete Channels
Tax Category
rates array, as shown in Entity relationships. For the fields of a TaxRate, such as state, subRates, and includedInPrice, see TaxRate.state matches only a Cart whose shipping address has no state either. If countryTaxRateFallbackEnabled is enabled in the carts Project setting, such a TaxRate also applies when no TaxRate covers the state of the shipping address.Differences between REST and GraphQL
The entities and field names are the same in both APIs, with the following exceptions:
- GraphQL exposes the Project as
ProjectProjection. - GraphQL calls the Channel role enum
ChannelRole. Its values match the RESTChannelRoleEnum. - For Channels of a Store, GraphQL returns references in
distributionChannelsRefandsupplyChannelsRef, and expanded Channels indistributionChannelsandsupplyChannels. - For each setting in
productSelections, GraphQL returns the reference inproductSelectionRefand the expanded Product Selection inproductSelection, alongsideactive. - The
businessUnitssetting is available on the REST Project but not onProjectProjection. - GraphQL marks the
inventorysetting as Beta. REST doesn't.
Eventual consistency
Messages and events
Limits
300 000 Stores can be created per Project. This is a soft limit that can be increased per Project after a performance impact review. See Limit increase guidance.100 Tax Categories can be created per Project. This is a soft limit that can be increased per Project after a performance impact review. See Limit increase guidance.100 supply Channels, 100 distribution Channels, and 100 Product Selections. For more information, see Store's Inventory Supply Channels, Store's Product Distribution Channels, and Store's Product Selections.