Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Add to cart with api

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 01-25-2019, 03:52 AM
 
georgio georgio is offline
    
Join Date: Jan 2019
Posts: 1
 

Question 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?
__________________
X-Cart REST API 5.3.5.5
Reply With Quote
  #2  
Old 01-28-2019, 02:53 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default 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?
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #3  
Old 01-28-2019, 03:04 AM
 
georgio georgio is offline
    
Join Date: Jan 2019
Posts: 1
 

Default 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.
__________________
X-Cart REST API 5.3.5.5
Reply With Quote
  #4  
Old 01-31-2019, 05:23 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default 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
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:56 PM.

   

 
X-Cart forums © 2001-2020