---
title: "CommerceOps API"
slug: "commerceops-api"
abstract: ""
---
# CommerceOps API

The CommerceOps API is a subset of the [Commerce Service API](https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-commerce/commerce-service-api.html "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](https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-commerce/list-of-sitecore-xc-postman-collections.html "List of Sitecore XC Postman 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).<br><br>Metadata includes global and environment specific policies and policy sets.<br><br>Note that this does not add or remove any artifacts to the environment. Bootstrapping only updates metadata.<br><br>Sample:<br><br>`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.<br><br>Sample:<br><br>`http://{{ServiceHost}}/{{OpsApi}}/CleanEnvironment()` |
| InitializeEnvironment | Initializes a specified Commerce environment from an empty EntityStore, and adds needed artifacts.<br><br>Sample:<br><br>`http://{{ServiceHost}}/{{OpsApi}}/InitializeEnvironment(environment='{{Environment}}') ` |
| GetEnvironment | Retrieves a single named Commerce environment.<br><br>Sample:<br><br>`http://{{ServiceHost}}/{{OpsApi}}/Environments ('Entity-Comm`erceEnvironment-Habitat') |
| ImportEnvironment | Imports a Commerce environment from a raw exported environment JSON string. This imports and initializes the metadata for the specified environment only.<br><br>Sample:<br><br>`http://{{ServiceHost}}/{{OpsApi}}/ImportEnvironment()` |
| ExportEnvironment | Exports a Commerce environment to JSON.<br><br>Sample:<br><br>`http://{{ServiceHost}}/{{OpsApi}}/ExportEnvironment(environmentName='{{Environment}}')` |
| ListEnvironments | Retrieves a list of all known Commerce environments.<br><br>Sample:<br><br>`http://{{ServiceHost}}/{{OpsApi}}/Environments` |
| GetApiRoutes | Retrieves a list of the current API routes.<br><br>Sample:<br><br>`http://{{ServiceHost}}/{{OpsApi}}/GetApiRoutes` |

Actions pertaining to the CommerceShops and CommerceAuthoring APIs are described in the [Commerce Developer Reference](https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-commerce/commerce-service-api.html "Commerce Service API").