X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Add to cart with api (https://forum.x-cart.com/showthread.php?t=76791)

georgio 01-25-2019 03:52 AM

Add to cart with api
 
Hey. I want to integrate X-Cart and mobile app.

I want to add to cart from mobile app by format (application/json). But I can not find information. There is a lot of information about interaction with the API store.

Tell me where you can find out
or still have to write your decision?

tony_sologubov 01-28-2019 02:53 AM

Re: Add to cart with api
 
Hi @georgio,

Welcome to X-Cart forums!

If you want to create an API for adding products into carts and then pulling this info to your mobile app, you are better off creating your own custom solution. It will get you full control over format in which you can send and receive data, thus your approach will require a minimum number of requests to get the job done.

Let me know if you have any other questions.

Tony

Quote:

Originally Posted by georgio
Hey. I want to integrate X-Cart and mobile app.

I want to add to cart from mobile app by format (application/json). But I can not find information. There is a lot of information about interaction with the API store.

Tell me where you can find out
or still have to write your decision?


georgio 01-28-2019 03:04 AM

Re: Add to cart with api
 
Quote:

Originally Posted by tony_sologubov
Hi @georgio,

Welcome to X-Cart forums!

If you want to create an API for adding products into carts and then pulling this info to your mobile app, you are better off creating your own custom solution. It will get you full control over format in which you can send and receive data, thus your approach will require a minimum number of requests to get the job done.

Let me know if you have any other questions.

Tony


I thought there is already a request that adds products to the cart via the API.

tony_sologubov 01-31-2019 05:23 AM

Re: Add to cart with api
 
Hi @georgio,

Here is the example of the request of adding a product to cart via REST API:

Code:

admin.php?target=RESTAPI&_key=test&_path=orderitem/0&_method=post&model[order][order_id]=8&model[object][product_id]=13&model[discountedSubtotal]=10.00

8 is the ID of the order/cart, 13 is the ID of the product, 10.00 is the price of a product, with which it will be added into the cart.

Hopefully, it will help.

Tony


All times are GMT -8. The time now is 01:06 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.