API Understanding. We have some queries regarding Shopping Cart and other related API. We would appreciate it if you could provide an explanation.
1.A : Please provide us details what data we need to pass for Branch ID ?
Branch ID will come from the Customer, depending upon which branch they decide. For the development environment please use ENTERPRISE. Once the system is ready for integration, you can check with the customer and change it to the correct value, for production, accordingly.
2.A : Can you please confirm that are we going to get all the products from the category or response will be with pagination ?
It is up to you. You can get all the data at once or you can get the data paginated. If pp and page are not present in the request, all the data will be returned at once.
2.B : If response will be with pagination then how we need to pass data for pagination.
For pagination you need four parameters :
1. pp – Number of items per page (Mandatory)
2. page – Number of page. (Mandatory)
3. srt – Sort By (Optional)
4. order – ASC or DESC (Optional)
Sample Request
{
"pp": "25",
"itemid": "Wi7VEB",
"branchid": "ENTERPRISE",
"sort": "PRODUCTNUMBER",
"page": "2",
"order": "DESC"
}
The above payload will fetch 25 items per page from page number 2. That means, after sorting, the server will return item numbers 26 to 50.
3.A : Please provide list of data that we are going to get from this API.
You will get all the data pertaining to the product and price, along with the images. Product ID, Product Name, Product Number, Model, Part Number, Machine, Description, Unit, Category, Brand, Unit Price, Currency, Discount, tax Rate, Origin, HS Code, and so on. Whatever data has been added by the customer on the product level and price list level will come.
3.B : Do we have Attributes for the products like Size or Different vendors?
Yes, size, weight, package dimensions, gross weight and color, etc. Whatever data is available for the given product, will come.
No this API is not for that. This is just like Amazon. When you search/browse for products on Amazon, it shows you a price. (Actual, Discount and Discounted). When you click and go inside a particular product, then it shows you other offers. The criteria for selecting the product/vendor for the main list might not always be the lowest price.
3.C : If Porduct will have data from Different attributes then are we going to get that data with same API ? Or we have separate API or Separate Parameters to pass.
You will get all data with the same API. Attributes differ on a product category level. You can use a different API to get the attributes for each category. Please start your sandbox integration, when you reach such a situation, we will assist you on case to case basis. We will need to show you only once or twice and you should be good to go from there on.
4.A : Do we need to manage cart on our side first and on the time of making order we need to call this API or everytime when customer do add to cart for product we need to call this API ?
Both options are available and you can even mix the two. That means, suppose you push order information with n items in the first go, you can keep on adding items as long as you need. n can be zero. Tuhund cart is persistent. You can keep your side volatile if you think that is good. In case you are using a third-party server to host your website and/or if you are using scripting technologies like PHP, we would recommend you keep minimal data on your side. Let Tuhund handle the data.
5.A : As per the API we need to pass the Orderid to the payload, But As per order id API do we need to create order everytime or once for one customer?
An order is "an" order. Once you create an order, you can keep adding items to the same order till it has not been submitted. When you add an item to an order, you will obviously need to pass the ID of that order. A single customer can have multiple orders in carts. This logic is not very popular and you can ignore it for now. This logic is particularly helpful for indirect vendors (Shops and showrooms that keep limited or no stock and order "just in time" as and when required on order to order basis). Suppose you are a shopkeeper (Customer for the portal) and there are two customers at your shop who are selecting products in parallel. You can create two orders and keep shuffling between the two. When customer A selects a product, you can go to the order created for him and add the product. Similarly for customer B.
Therefore, it will entirely depend on your design. If you want to provide these features to your customer, please go ahead. The choice should depend upon the type of customers you are targeting.
5.B : User Login is mandatory to add product to cart?
Creating a user account is mandatory. You do not have to disclose to the user that his account has been created in Tuhund (in addition to your portal). Tuhund running at the back will be hidden from the end user of your shopping portal. For B2C customers, you can choose to give them direct access to Tuhund customer portal as it offers more functionality.
6.A : Everytime when customer open Cart list do we need to get data from this API?
If you do not store/save data on your side, then yes, you will have to. You will have to work on your own design. You can either save the data on your side or fetch the data based on the sessions or fetch all data in real-time. Tuhund does not bind you to any particular design. Basically, you are making a tradeoff between performance and security.
6.B : How we can get order id for the customer to get cart list for the next time when customer come after few days ?
Please refer to the documentation of the following API
API # : 8018 | API Name : cartorderlist
Get a filtered and sorted list of orders placed through a shopping cart.
URL : /apic/cartorderlist
https://www.tuhund.com/apidocs/cartorderlist-list-of-orders-in-shopping-cart
{
"itemid": "ID of the Customer"
}
7.A : Customer login is Mandatory for Creating Cart or Order?
Company ID is mandatory. Customer Login is not required at the time of pushing the order.
"required": [
"typeid",
"branchid",
"companyid",
"billingaddress",
"shipmentterms",
"paymentstatus",
"payment",
"paymentmode",
"items",
"grosstotal",
"nettotal"
]
Items can be an empty JSON Array.