API
Generating and managing API credentials for external integrations and secure data exchange
Introduction
The APIs section allows you to create and manage secure credentials for external applications to communicate with your OpenCart store. This enables integrations with inventory systems, ERP software, mobile apps, custom frontends, and other third-party services. Each API key has configurable access restrictions and detailed usage history for security monitoring.
Accessing API Management
API Interface Overview

API Configuration Fields
Creating a New API Key
To set up an integration with an external service (e.g., an inventory management system):
Navigate to System → Users → APIs and click Add New.
Enter a descriptive API Username that identifies the purpose (e.g., "inventory-sync").
OpenCart will automatically generate a secure API Key. Copy this key immediately—you won't be able to see it again after saving.
Set Status to "Enabled".
In the IP section, add the IP addresses that will be allowed to use this key:
For testing, you can add your current IP (displayed on the form).
For production, add the static IPs of your external servers.
Click Save. The API key is now ready for use.
Common Tasks
Setting Up a Mobile App Integration
To connect a custom mobile app to your OpenCart store:
Create a new API with username "mobile-app".
Generate and securely store the API key.
Add the IP addresses of your mobile app servers (or use wildcards if your app connects from variable IPs—use with caution).
In your mobile app code, use the API username and key to authenticate requests.
Monitor the History tab to ensure the API is being used correctly.
Rotating Compromised API Keys
If an API key is suspected to be compromised:
Find the API in the list and click Edit.
Change the Status to "Disabled" to immediately block all access.
Create a new API key with a different username.
Update your external systems with the new credentials.
Delete the old API key once all systems are migrated.
Restricting API Access to Specific Servers
For maximum security when integrating with known servers:
Obtain the static IP addresses of all servers that need API access.
When creating or editing an API, add each IP address to the IP list.
Test the connection from each server to ensure the IP is correctly configured.
Regularly review the API history to ensure only authorized IPs are making calls.
Best Practices
Critical Security Warning ⚠️ API keys grant access to your store's data and functions. Treat them with the same security as admin passwords. Never expose API keys in client-side code (JavaScript, mobile apps distributed to users). Always use server-to-server communication or implement a secure proxy.
Troubleshooting
"APIs are the bridges that connect your store to the wider digital ecosystem. Each bridge needs strong gates (IP restrictions), vigilant guards (monitoring), and regular inspections (key rotation) to keep your data secure while enabling powerful integrations."
Last updated