CommerceOps API

Current version: 10.2

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:

Action

Description

Bootstrap

Completely 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()

CleanEnvironment

Removes 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()

InitializeEnvironment

Initializes a specified Commerce environment from an empty EntityStore, and adds needed artifacts.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/InitializeEnvironment(environment='{{Environment}}')

GetEnvironment

Retrieves a single named Commerce environment.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/Environments ('Entity-CommerceEnvironment-Habitat')

ImportEnvironment

Imports 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()

ExportEnvironment

Exports a Commerce environment to JSON.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/ExportEnvironment(environmentName='{{Environment}}')

ListEnvironments

Retrieves a list of all known Commerce environments.

Sample:

http://{{ServiceHost}}/{{OpsApi}}/Environments

GetApiRoutes

Retrieves 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.  

Do you have some feedback for us?

If you have suggestions for improving this article,