How to Create API in OpenCart
By Jithin on March 30th, 2017
API is very useful if you want to manage the data on your site remotely from a customized panel. With the help of API, you can significantly decrease the overall repetitive workload as you can fire multiple API endpoints to perform multiple steps in series.
For example, Let’s say you want to add a product and promote it with E-mail marketing. For this to happen, you have to perform multiple steps. The first step is to add the product to your URL and then execute the E-mail marketing campaign directly from your code.
In short, with the help of API, you can automate the repetitive tasks very easily. Or, Let’s say you want to validate and add thousands of products to your site. With the help of API, you can do it with ease. Or, you can provide API to some of your major customers.
In this tutorial, I will show you How to create a new API token directly from the admin panel of your OpenCart store. It is a very easy process and it takes only a few minutes to create a new API token. So, Let’s get started.
Create API in OpenCart
To create a new API, log in to the admin panel of your OpenCart store and click on the System -> Users -> API option given in the left sidebar. Refer to the following screenshot for better understanding.
On this page, you will see a list of APIs available in your store. You can also edit or manage API keys from this interface. To create a new API, click on the “+” button given at the top-right corner of the page.
Now, Enter the basic information like API name, and API key. You can also generate the API token randomly which is a good method to go.
You can also set the current status of that API. You can enable or disable it from the drop-down given in the API creation form.
After filling up all the required information, click on the Save button represented by a floppy disk on the top-right corner of the page just like the following image.
So, this is how you can create a new API in OpenCart. If you are providing API tokens to your customers, make sure they are not abusing it. You can easily disable API if it is abused.
If you have any questions regarding this tutorial or the topic, please let us know in the comment section given below. We are happy to help!