Damiën Peerbolte
Damiën Peerbolte

Reputation: 57

Opencart 3 API add products via POST request

I'm trying to build a products API in OpenCart 3. I want to insert products via POST request. Is there a way to do that? Thanks in advance!

Upvotes: 0

Views: 1163

Answers (2)

Ahmed Memon
Ahmed Memon

Reputation: 180

Opencart does not offer product create creation API but you can create your custom API for product creation.

  1. catalog/controller/api/custom.php: It's a controller file, and most of our application logic resides in this file.
  2. catalog/language/en-gb/api/custom.php: It's a language file that holds language variables.
  3. common.php: This file holds the common code for reusability purposes.
  4. login.php: It's a file that demonstrates how to log in to the store using the REST API.
  5. products.php: It's a file that demonstrates how to fetch products using our custom API module.

More details.

Upvotes: 0

jcord04
jcord04

Reputation: 56

It seems that there is no API controller to handle creation of products via the API. Assuming you are using the latest version of Opencart 3, these are the available endpoints - https://github.com/opencart/opencart/tree/3.0.x.x_Maintenance/upload/catalog/controller/api

Also their documentation does have some information which might help - https://docs.opencart.com/en-gb/system/users/api/

Upvotes: 1

Related Questions