Add product stock through API

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
JakubŽídek
Posts: 14
Joined: 09 Jun 2021, 15:06

Add product stock through API

Post by JakubŽídek » 14 Feb 2022, 10:38

Hello, I have asked a few questions regarding the Aimeos JSON API and you've always been helpful here, so here I am again.

I use a call to the Aimeos API like this to create a text:

https://MYURL/admin/default/jsonadm/text?_token=" + csrf

with JSON body like this:
"{
"""data"": {
"""type"": ""text"",
"""attributes"": {
"""text.type"": ""short"",
"""text.label"": " + (char)34 + textLabel + (char)34 + ",
"""text.content"": " + (char)34 + textContent + (char)34 + ",
"""text.editor"": " + (char)34 + editor + (char)34 + "
"}
"}
"}";

Which works as expected. How can I use the API to create a stock entry for a product?

Thank you!

User avatar
aimeos
Administrator
Posts: 7908
Joined: 01 Jan 1970, 00:00

Re: Add product stock through API

Post by aimeos » 15 Feb 2022, 09:40

There's also an URL for managing stock levels:
https://MYURL/admin/default/jsonadm/stock?_token= + csrf

Here are the supported properties for updating:
https://github.com/aimeos/aimeos-core/b ... #L177-L181
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

JakubŽídek
Posts: 14
Joined: 09 Jun 2021, 15:06

Re: Add product stock through API

Post by JakubŽídek » 15 Feb 2022, 09:44

Thank you very much. It didn't work for me, but I will try again since now I know that it should work and the problem is on my side.

Thanks again!

Post Reply