1. Administration

CommerceOps API

Version:

The CommerceOps API is a subset of the Commerce Service API, intended to support the DevOps role in managing a Sitecore XC implementation. It includes methods to create and manage environments and global policies.

Sample API requests that are included in the Postman DevOps collections exercise CommerceOPS API actions.

CommerceOpsService API

CommerceOps API actions include:

ActionDescription
BootstrapCompletely reloads metadata for environments from a source directory (wwwroot/data/environments). For security, this should be done from an internal instance of the Commerce Engine (CommerceOps).

Metadata includes global and environment specific policies and policy sets.

Note that this does not add or remove any artifacts to the environment. Bootstrapping only updates metadata.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/Bootstrap()
CleanEnvironmentRemoves all artifacts from a Commerce environment. The environment to clean is passed as a header called "Environment". Passing in an empty environment completely clears the global environment, which is where metadata for all the environments is stored.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/CleanEnvironment()
InitializeEnvironmentInitializes a specified Commerce environment from an empty EntityStore, and adds needed artifacts.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/InitializeEnvironment(environment='{{Environment}}')
GetEnvironmentRetrieves a single named Commerce environment.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/Environments ('Entity-CommerceEnvironment-Habitat')
ImportEnvironmentImports a Commerce environment from a raw exported environment JSON string. This imports and initializes the metadata for the specified environment only.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/ImportEnvironment()
ExportEnvironmentExports a Commerce environment to JSON.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/ExportEnvironment(environmentName='{{Environment}}')
ListEnvironmentsRetrieves a list of all known Commerce environments.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/Environments
GetApiRoutesRetrieves a list of the current API routes.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/GetApiRoutes

Actions pertaining to the CommerceShops and CommerceAuthoring APIs are described in the Commerce Developer Reference.

If you have suggestions for improving this article, let us know!