Use the Commerce Integration Layer CLI to configure, deploy, and manage extensions in production.
Environment configuration and secrets
You can also manage these values in the Merchant Center.
Set configuration
ctx.config. Add --secret to encrypt and mask the value.commercetools integration-layer config set MY_API_KEY secure-token-123 --secret
List configuration
Lists configuration values for the active Project. Secret values are masked.
commercetools integration-layer config list
Outbound HTTP domain allowlist
api.example.com) or suffix wildcards (*.example.com); quote wildcards so the shell does not expand them. The list also shows any operator deny patterns that take precedence; those are read-only from the CLI.You can also manage these values in the Merchant Center.
List allowed domains
fetch. Allowed calls are still subject to outbound request limits.commercetools integration-layer allowlist list
Add allowed domains
Adds bare hostnames or suffix wildcard patterns to the allowlist.
commercetools integration-layer allowlist add api.vendor.com '*.algolia.net'
Remove an allowed domain
Removes a hostname or pattern from the allowlist.
commercetools integration-layer allowlist remove api.vendor.com
Replace the allowlist
remove instead to drop individual hosts.commercetools integration-layer allowlist set api.vendor.com api.example.com
Project settings
Project settings are the display label of your Project and the default language, currency, and country. The Commerce Integration Layer uses the defaults for new shopper sessions.
You can also manage these values in the Merchant Center.
Get Project settings
--json to print the label, language, currency, and country as JSON. The region isn't included.commercetools integration-layer project-settings get
Update Project settings
--label, --language, --currency, or --country. Settings you don't pass keep their current values. If the Project has no stored value for a setting, you must pass that setting too.commercetools integration-layer project-settings set --currency EUR --country DE
commercetools integration-layer project-settings set --label 'Acme Store' --language de-DE
--country de saves DE.Field visibility
@requires.When to use field visibility
Hide a field when it exists for internal integrations and storefronts have no reason to query it. Typical examples are a cost price, a margin band, or a partner reference stored in a Custom Field, or an internal code stored in a Product Attribute.
Field visibility fits when:
- Your storefront queries the Experience API, and you don't want these fields to appear in its schema.
- Your extensions still need the values. They can keep reading hidden fields with
@requires. - You add fields over time and want to keep new internal fields out of the public schema from the start. You can hide a field before you create it.
Field visibility doesn't fit when:
- You need to protect the data itself. Hiding a field keeps it out of the published API, but it doesn't control access to the data.
- You need different visibility per shopper or Store. Rules name a type key and a field name only, so a field is either public or hidden for the whole Project.
Don't rely on field visibility to keep a value confidential.
How field visibility works
--space attribute. You don't use the generated GraphQL names, because those can change when the rest of your Project's data model changes.Every change republishes your Project's schema, which applies the rules. Because a hidden field disappears from the public schema, check first that no storefront query still selects it. A query that selects a hidden field fails validation, and the whole query returns an error instead of data, including the fields that are still public. In the Merchant Center, you can see the request count of each field for the last 30 days and filter for unused fields.
The following sections describe the CLI commands to manage field visibility.
You can also manage field visibility in the Merchant Center.
List field visibility
--hidden to list only hidden fields, or --json for machine-readable output. If a rule has no effect, for example because the field doesn't exist yet, the list says why.commercetools integration-layer field-visibility list
Hide fields
Hides one or more fields of the same type.
commercetools integration-layer field-visibility hide --type-key internal-ops costPrice marginBand
commercetools integration-layer field-visibility hide --space attribute --type-key shoes internalCode
You can hide a field before you create it in commercetools. The rule is stored and applies as soon as the field exists, so the field is never public. This is the safest order for adding a field that storefronts shouldn't see.
Show fields
Removes the rules that hide one or more fields of the same type, so storefronts can query them again.
commercetools integration-layer field-visibility show --type-key internal-ops costPrice
Republish the schema
The schema was republished. If the change was saved but the republish failed, the published schema doesn't reflect it yet: a field you hid may still be public, and a field you showed may still be hidden. In that case, the command exits with code 2. To retry, run set with the complete set of hidden fields. Running hide or show again doesn't retry, because the rules already match and the command saves nothing.Publishing, rollouts, and status checks
You can also check the deployment status in the Merchant Center.
Publish an extension
--no-wait to exit before the health check or --wait-timeout to set its duration.commercetools integration-layer extension push --wait-timeout 180
Check deployment status
commercetools integration-layer extension status
Further reading
- Walk through enrolling a Project, installing the CLI, and publishing your first extension in Get started
- What happens after a push, including the pending, running, and failed rollout states, in Operations and performance