Skip to main content

How to Generate an API Key for the Altera CLI

Create an API key with custom permissions to securely use the Altera command line tool.

Updated yesterday

Goal: Generate an API key with appropriate permissions to use the Altera CLI tool for managing your Shopify store data and files from the command line.

An API key is required to authenticate the Altera CLI tool and access your store's data. Each API key can be configured with specific permissions to control which data types it can import and export, providing security and flexibility for different use cases.

Video walkthrough: Coming soon

Prerequisites:

  • You have Altera installed on your Shopify store

  • You have access to the Shopify admin

  • Your plan includes API access (check the Settings β†’ Plan page if unsure)

Step 1 - Navigate to API Settings

In your Shopify admin, go to Apps and open Altera. Navigate to Settings β†’ API Keys in the Altera app.

Step 2 - Enter Contact Email

Before you can generate an API key, you need to provide a contact email address. This email is used to reach out in case there are any issues with your API calls or if we need to notify you about important API-related updates.

Enter your email address in the API Notification Email field and click Save.

Important: You must save your email address before you can create an API key. The "Create API Key" button will be disabled until you've saved a valid email.

Step 3 - Create API Key and Set Permissions

Click Create API Key. A permissions modal will open where you can configure which data types this API key can access.

The permissions editor shows a table with all available data types and two permission columns:

  • Export - Allows reading/downloading data from your Shopify store

  • Import - Allows creating/updating data in your Shopify store

Available Data Types

You can grant permissions for the following data types:

  • Products - Product catalog, variants, images, and inventory

  • Collections - Smart and manual collections

  • Customers - Customer accounts and contact information

  • Orders - Order history and details

  • Discounts - Discount codes and automatic discounts

  • Articles - Blog posts and content

  • Catalogs - Product catalogs

  • Companies - B2B company information

  • Draft Orders - Incomplete orders and quotes

  • Files - Media files and documents

  • Menus - Navigation menus and structure

  • Metaobjects - Custom data structures

  • Pages - Store pages and static content

  • Redirects - URL redirections

  • Shop - Store settings and configuration

  • Metafield Definitions - Custom field schemas

  • Metaobject Definitions - Custom object types

  • Events - Store activity logs (export only)

  • Payouts - Payment settlement information (export only)

Setting Permissions

  1. Check the boxes for the data types and operations (export/import) this API key should access

  2. Use the checkboxes in the header row to quickly enable all export or import permissions

  3. Click Save to create the API key

Security Tip: Only grant the minimum permissions needed for your use case. For example, if you only need to upload product images, grant only "Files" import permission.

The API key will be generated and displayed in the table. Copy it immediately as you won't be able to see the full key again later (though you can always view a preview).

Step 4 - Install and Configure the CLI Tool

Now that you have an API key, you can connect the CLI tool to your store.

Open your terminal and run the installation command shown in the settings page (or use the command below, replacing mystore.myshopify.com with your actual store domain):

npx altera shop add mystore.myshopify.com

When prompted for your API key, paste the API key you just copied.

To verify the connection is successful, run:

npx altera shop test

You should see a success message confirming the connection to your store.

Managing API Keys

Viewing API Keys

All your API keys are listed in the API Keys section. Each key shows:

  • A preview of the key (click the eye icon to reveal the full key)

  • When it was created

  • Actions to view permissions or delete the key

Updating Permissions

To change the permissions for an existing API key:

  1. Click the info icon (β“˜) next to the API key

  2. Update the permissions in the modal

  3. Click Save

The changes take effect immediately. Any CLI commands using this key will use the updated permissions.

Deleting API Keys

To revoke an API key:

  1. Click the delete icon next to the API key

  2. Confirm the deletion

Once deleted, the API key can no longer be used. Any CLI commands attempting to use this key will fail with an authentication error.

Common Permission Scenarios

File Management Only:

  • Enable: Files (export + import)

  • Use case: Uploading and downloading store media files

Product Data Management:

  • Enable: Products (export + import), Files (export only for images)

  • Use case: Bulk product updates and management

Read-Only Access:

  • Enable: Export permissions for needed data types

  • Disable: All import permissions

  • Use case: Automated reporting and backups

Full Access:

  • Enable: All export and import permissions

  • Use case: Complete store data management and synchronization

Outcome

You now have:

  • An API key configured with appropriate permissions for your needs

  • The Altera CLI tool connected to your Shopify store

  • The ability to manage API key permissions and revoke access when needed

Next steps:

Security Reminder: Keep your API key private and secure. Anyone with access to your API key can access your store's data according to the permissions you've granted. Never commit API keys to version control or share them publicly.

Did this answer your question?