You are here:
Webstores for Order on Behalf Of (Optional, B2C OOBO Only)
To create orders that aren’t already being pulled in from a storefront through integration, create a webstore. If you’re using B2B Commerce or D2C Commerce, your webstores are already configured.
Required Editions
| View supported editions. |
To create a webstore, you need the Order Management Operations Manager permission set. If your store supports multiple currencies, create a webstore record for each possible combination of currency and locale that can appear in your order data. You can’t create a webstore record with the required values in the Lightning UI, so use a tool that can execute anonymous apex code, such the Developer Console.
Define these properties.
| Name | Any unique name that lets the customer service representative know what store they’re shopping on. For multicurrency orgs, we recommend that you include the currency and locale in the name. |
| CurrencyIsoCode | Required if your org supports multiple currencies. This value must match the currency code of the B2C Commerce storefront. |
| DefaultLanguage | Required if your org supports multiple languages. This value must match the locale ID of the B2C Commerce storefront. This property isn’t available if you aren’t assigned the Order On Behalf Of permission set. |
| DefaultTaxLocaleType | NET or GROSS This value must match the tax type of the B2C Commerce storefront. |
| ExternalReference | Use the format instanceId + @ + siteId. For example, abc_123@SiteGenesis Your storefront’s instance ID is the same as its tenant ID. To get your storefront’s tenant ID, log in to B2C Commerce Business Manager and go to Administration | Operation | Server Status. The tenant.id is listed on the Server Properties tab. If your B2C Commerce instance is version 22.10 or earlier, Business Manager doesn’t include the Salesforce Order Management Integration Administration page. To get your tenant ID, contact Salesforce Support. |
| LocationId | Optional. If you don’t specify an existing location, the system creates a location and sets this value to its ID. In that case, it sets the new location’s LocationType field to Virtual and its ExternalReference field to null. If you include custom validations for the Location object, they must account for these values. |
| OrderLifecycleType | UNMANAGED |
| SupportedCurrencies | Required if your org supports multiple currencies. Include only one value, which must match CurrencyIsoCode. |
| SupportedLanguages | Required if your org supports multiple languages. Include only one value, which must match DefaultLanguage. |
| Type | B2C |
Watch the video to see how you can configure WebStore records.
If you can’t watch the video in full screen, open the video on a new tab: Configure WebStore records.
WebStore createWebStore( String name, String instanceId, String siteId )
{ WebStore store = new WebStore(
Name = name,
// Either NET or GROSS
DefaultTaxLocaleType = 'NET',
// Format expected is instanceId@siteId; example abc_123@SiteGenesis // If multicurrency is enabled then uncomment these lines:
//CurrencyIsoCode = 'USD',
//DefaultLanguage = 'en_US',
//SupportedCurrencies = 'USD',
//SupportedLanguages 'en_US',
ExternalReference = instanceId + '@' + siteId,
Type = 'B2CE');
return store;
}
WebStore webStoreRecord = createWebStore('Apex1 WebStore', 'abc_123', 'SiteGenesis'); insert webStoreRecord;
| Name | External Reference | Currency IsoCode | Default Language | DefaultTax LocaleType | Supported Currencies | Supported Languages | Type |
|---|---|---|---|---|---|---|---|
| SiteGenesis USD | abc_123@SiteGenesis | USD | en_US | NET | USD | en_US | B2C |
| SiteGenesis Global GBP en | abc_123@ SiteGenesis | GlobalGBP | en_GB | GROSS | GBP | en_GB | B2C |
| SiteGenesis Global EUR fr | abc_123@ SiteGenesis | GlobalEUR | fr_FR | GROSS | EUR | fr_FR | B2C |
| SiteGenesis Global EUR en | abc_123@ SiteGenesis | GlobalEUR | en_GB | GROSS | EUR | en_GB | B2C |

