cancel
Showing results for 
Search instead for 
Did you mean: 

REST PRODUCT API - create items in Magento

SOLVED

REST PRODUCT API - create items in Magento

Hi,

Sorry for what might seem a basic question. We have the task of programatically integrating a client on premises ERP system with Magento. Following devdocs is like navigating a maze. However we have found the REST APIs for the JSON structures to create/modify Customers and Addresses.

What I can't find are the APIs to create/modify products and pricing.

Any pointers in the right direction would be super helpful.

Thank very much 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: REST PRODUCT API - create items in Magento

@mike_hatfieldOn the below URL you can see different tutorials. You can look into product related tutorials. For all the product related updates you can use the similar Payload (structure).

 

https://devdocs.magento.com/guides/v2.3/rest/tutorials/index.html

 

https://support.magento.com/hc/en-us/articles/360005156133-Create-and-manage-grouped-products-using-...

 

Copy button on previous link of last response does not do other than copy the highlighted text.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

View solution in original post

Re: REST PRODUCT API - create items in Magento

@mike_hatfieldBoth has their own pros and con. If you go CSV route then their can be some delay as you may not be creating CSV whole day long. It may be once or twice a day and so the updates in Magento. You can use default Magento import for this and trigger it using custom script on need basis.

 

API route can be instant. Make the updates in ERP, call API, make updates in Magento and you are all set!

 

Hope this help!

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

View solution in original post

9 REPLIES 9

Re: REST PRODUCT API - create items in Magento

Hello,

 

you can use 

yourdomain.com/swagger url for that info

 

Hope it will help you.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: REST PRODUCT API - create items in Magento

Hi,

 

Thanks for the response.

I did use swagger to get the customer API JSON but although the product tables are named I can't find or see the JSON structures.

Perhaps I'm not looking in the right place Smiley Sad

 

Thanks

Re: REST PRODUCT API - create items in Magento

Hello, you need to generate such a token into admin , then pass that token so you can see all api

Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: REST PRODUCT API - create items in Magento

@mike_hatfieldLook at the below URL. You may find what you are looking for. Look for 'Catalog' and endpoints under it. Other URL will help you on how to Add/Edit product.

 

https://devdocs.magento.com/guides/v2.3/rest/list.html

 

https://magento.stackexchange.com/questions/164278/update-product-using-rest-api-in-magento-2

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: REST PRODUCT API - create items in Magento

The second link is very useful. Thank you.

 

The first link

I must be dumb.

I see the list of table but where do I find the structures in the table?

What does the 'Copy' button do except highlight the group of tables?

 

I found the Customer structures at 

http://<mydomain>/swagger#!/customerAccountManagementV1/customerAccountManagementV1CreateAccountPost

 

customeraccountmanagementV1.JPG

 

I cant find the equivalent for products.

 

Thanks

 

 

Re: REST PRODUCT API - create items in Magento

@mike_hatfieldOn the below URL you can see different tutorials. You can look into product related tutorials. For all the product related updates you can use the similar Payload (structure).

 

https://devdocs.magento.com/guides/v2.3/rest/tutorials/index.html

 

https://support.magento.com/hc/en-us/articles/360005156133-Create-and-manage-grouped-products-using-...

 

Copy button on previous link of last response does not do other than copy the highlighted text.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: REST PRODUCT API - create items in Magento

The references are very helpful.

Thank you.

Re: REST PRODUCT API - create items in Magento

After reading more of the documentation I am considering writing some programs to generate CSV files from the ERP system and using those in schedules to carryout repetitive processes. The aim is to automate as much as is possible. Do you think this is a valid way to maintain customers, products, pricing images etc? 

Thanks

Re: REST PRODUCT API - create items in Magento

@mike_hatfieldBoth has their own pros and con. If you go CSV route then their can be some delay as you may not be creating CSV whole day long. It may be once or twice a day and so the updates in Magento. You can use default Magento import for this and trigger it using custom script on need basis.

 

API route can be instant. Make the updates in ERP, call API, make updates in Magento and you are all set!

 

Hope this help!

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.