[Skip to main content](#vessel-content)

#   Hikashop checkout API

##

- **[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")**
- [![nuthan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7664-nuthan "View nuthan's Profile") Topic Author
- [ Offline](/forum/user/7664-nuthan)

Less More

- Posts: 7
- Thank you received: 0
-
-

14 years 5 months ago [\#52153](#52153) by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile")  *[Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52153 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")* was created by *[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")*

I referred to the developer [ documentation](http://www.hikashop.com/en/support/documentation/62-hikashop-developer-documentation.html) I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which class should i get? help me out!!!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#52164](#52164) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52164 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

What do you mean by "checkout process code" ? What are you trying to achieve ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")**
- [![nuthan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7664-nuthan "View nuthan's Profile") Topic Author
- [ Offline](/forum/user/7664-nuthan)

Less More

- Posts: 7
- Thank you received: 0
-
-

14 years 5 months ago [\#52165](#52165) by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile")  Replied by *[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52165 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

Thanks for the reply. By the way, I am trying to write my own hikashop services for an Android App. Integrating Hikashop e-commerce into Android App.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#52166](#52166) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52166 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

Well, there is lot of code to handle the checkout.
The main part is located in the file components/com_hikashop/controllers/checkout.php so I invite you to look there for the code you need based on what you want to do.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")**
- [![nuthan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7664-nuthan "View nuthan's Profile") Topic Author
- [ Offline](/forum/user/7664-nuthan)

Less More

- Posts: 7
- Thank you received: 0
-
-

14 years 5 months ago [\#52170](#52170) by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile")  Replied by *[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52170 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

There's lot of code. How do i proceed from here?
Say
**1. Load a product:**
$productClass = hikashop_get('class.product');
$product=$productClass-&gt;get($product_id);

**2. Add/Update product(s);**
$cartClass = hikashop_get('class.cart');
$cartClass-&gt;update($product_id,$quantity);

3. Currently, there's no payment integration for the Android App. Its a free product. How do i checkout from here skipping payment integration. Also, i have disabled payment gateway integration in the Hikashop Backend. Do i have to load this class components/com_hikashop/controllers/checkout.php But how?

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#52228](#52228) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52228 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

What you're interested in is in the function after_confirm of that file.
That's where the current cart is converted into an order and then the payment plugins are triggered to get the HTML form which will then redirect the user to the payment platform.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")**
- [![nuthan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7664-nuthan "View nuthan's Profile") Topic Author
- [ Offline](/forum/user/7664-nuthan)

Less More

- Posts: 7
- Thank you received: 0
-
-

14 years 5 months ago -  14 years 5 months ago [\#52453](#52453) by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile")  Replied by *[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52453 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

Hey Nikolas, Thanks for that, i browsed through that code. How do i call this file in my application. Actually, I dont want HTML form to be loaded. I would require a json output from the hikashop, as its an Android App. Later, I will mimic a HTML form in the android app and redirect the user for payment platform. I was wondering do we have any method like say:
$cartClass = hikashop_get('class.cart');
$cartClass-&gt;AddToCart($parameters);

Last edit: 14 years 5 months ago by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#52456](#52456) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52456 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

There is no method to call that file.
Just include the helpers/helper.php file of the backend in order to load HikaShop's library and then load the controller file.

For the add to cart, you can do like that:
$cartClass = hikashop_get('class.cart');
$cartClass-&gt;update($product_id,$quantity);

HikaShop doesn't output any json.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")**
- [![nuthan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7664-nuthan "View nuthan's Profile") Topic Author
- [ Offline](/forum/user/7664-nuthan)

Less More

- Posts: 7
- Thank you received: 0
-
-

14 years 5 months ago -  14 years 5 months ago [\#52458](#52458) by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile")  Replied by *[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52458 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

Thanks again..., I have included helpers/helper.php as per the [ Documentation](http://www.hikashop.com/en/support/documentation/62-hikashop-developer-documentation.html). Sorry, i did not mean Add_to_cart method(I am aware update() method does that), instead i was looking for
$cartClass = hikashop_get('class.cart');
$cartClass-&gt;**checkout**($parameters); //something like this.
or
$cartClass-&gt;**generateOrder**($parameters); //something like this.
or
$cartClass-&gt;**PaymentProcess**($parameters); //something like this.

I am also aware hikashop does not return json objects. Indeed, I am looking for php multi-dimensional arrays(so does $cartClass-&gt;update() method).

Last edit: 14 years 5 months ago by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#52460](#52460) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52460 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

For generateOrder, you can do like that:

$obj = null;
//add params to $obj
$class= hikashop_get('class.order');
$class-&gt;save($obj);

There are no methods for checkout or PaymentProcess

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")**
- [![nuthan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7664-nuthan "View nuthan's Profile") Topic Author
- [ Offline](/forum/user/7664-nuthan)

Less More

- Posts: 7
- Thank you received: 0
-
-

14 years 5 months ago [\#52464](#52464) by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile")  Replied by *[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52464 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

$order object in save() method has [ $obj](http://tinypaste.com/3e4fda22/fullscreen.php?hash=c366b520d8b44b4271df6c2d71a1c61d&toolbar=true&linenum=false) many parameters. Do we have any methods that returns $order object.
Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#52465](#52465) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52465 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

$class= hikashop_get('class.order');
$obj=$class-&gt;get($order_id);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")**
- [![nuthan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7664-nuthan "View nuthan's Profile") Topic Author
- [ Offline](/forum/user/7664-nuthan)

Less More

- Posts: 7
- Thank you received: 0
-
-

14 years 5 months ago -  14 years 5 months ago [\#52471](#52471) by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile")  Replied by *[nuthan](/forum/user/7664-nuthan "View nuthan's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52471 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

As per Hikashop [ documentation](http://www.hikashop.com/en/support/documentation/62-hikashop-developer-documentation.html)Code:

get($order_id);

method is to load the generated order. I would not have the $order_id unless cart is processed to an order. I am totally confused. I think Code:

$obj = null; //add params to $obj $class= hikashop_get('class.order'); $class-&gt;save($obj);

would the required function. All i need is $obj. get($order_id); does not return the $obj.

Last edit: 14 years 5 months ago by [nuthan](/forum/user/7664-nuthan "View nuthan's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#52473](#52473) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Hikashop checkout API](/forum/2-general-talk-about-hikashop/52153-hikashop-checkout-api#52473 "I referred to the developer I could only find the samples code provided to load product, add a product to cart, load the order details. But, it does not have the checkout process code samples. Which...")*

There are no methods which would convert a cart to an order.
That is done in only one place:
in the function after_confirm of components/com_hikashop/controllers/checkout.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzUyMTUzLWhpa2FzaG9wLWNoZWNrb3V0LWFwaT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.102 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
