Generating API Keys

Learn how to generate and manage API keys for third-party integrations and Live Feed connections

Overview

API keys in PrimeLink are used to authenticate external requests to your store's Live Feed endpoint. They allow other stores or applications to securely access your product data for real-time synchronization.

API keys are generated with a unique name and can be revoked at any time. Each key is a 32-character alphanumeric string that must be included in the request headers when accessing the Live Feed API.

Accessing API Key Management

To access the API Key management interface:

  1. Navigate to PrimeLink → Live Feed in your WordPress admin
  2. Click on the API Keys tab
  3. You'll see a list of all existing API keys (if any)

Generating a New API Key

Step 1: Open the Generate Modal

  1. In the API Keys tab, click the Create API Key button
  2. A modal window will open asking for a key name

Step 2: Enter Key Name

Enter a descriptive name for your API key. This helps you identify the key later:

  • Example names: "Main Store Feed", "Supplier Connection", "Development Store"
  • The name is for your reference only and doesn't affect functionality

Step 3: Generate the Key

  1. Click the Generate button
  2. PrimeLink will create a unique API key and display it immediately
⚠️ Important: The API key is displayed only once. Make sure to copy and save it immediately. You won't be able to see it again after closing the modal.

Step 4: Save the Key

Copy the API key to a secure location:

  • Use a password manager
  • Store it in your configuration files (securely)
  • Share it with authorized team members only

Using API Keys

API keys are used in HTTP request headers when accessing the Live Feed endpoint:

Request Format

GET /wp-json/mt-primelink/v1/live-feed/products
Headers:
  X-API-Key: YOUR_API_KEY_HERE

Example cURL Request

curl -X GET "https://yourstore.com/wp-json/mt-primelink/v1/live-feed/products" \
  -H "X-API-Key: abc123def456ghi789jkl012mno345pqr678stu901vwx234yz"

Example PHP Request

$response = wp_remote_get(
    'https://yourstore.com/wp-json/mt-primelink/v1/live-feed/products',
    array(
        'headers' => array(
            'X-API-Key' => 'YOUR_API_KEY_HERE'
        )
    )
);

Managing API Keys

Viewing All Keys

The API Keys tab displays all your keys with the following information:

  • Key Name: The descriptive name you assigned
  • Created: Date and time when the key was generated
  • Last Used: Date and time when the key was last used (if ever)
  • Status: Active or Revoked

Revoking API Keys

If you need to disable an API key (for security reasons or if it's been compromised):

  1. Find the key in the list
  2. Click the Revoke button next to it
  3. Confirm the action in the dialog
  4. The key status will change to "Revoked" and it will no longer work
⚠️ Warning: Revoking an API key will immediately stop all connections using that key. Make sure to update any systems using the key before revoking it.

Security Best Practices

  • Use descriptive names: Name your keys clearly so you can identify their purpose
  • Rotate keys regularly: Generate new keys periodically and revoke old ones
  • Never share keys publicly: API keys should be treated like passwords
  • Monitor usage: Check the "Last Used" column to identify unused keys
  • Revoke compromised keys: If a key is exposed, revoke it immediately
  • Use HTTPS: Always use secure connections when transmitting API keys

Next Steps

🔗 Live Feed Setup

Learn how to set up Live Feed connections using API keys

Learn More →
🛒 WooCommerce REST API

Use WooCommerce REST API credentials for Live Feed connections

Learn More →