Get Orders

From KartRocket API
Jump to: navigation, search

Get Order(s) V2

Request

User can get Order data by sending a HTTP GET Request to the following URL.


YOUR_STORE_URL_ON_KARTROCKET.'index.php?route=feed/web_api/orders&version=2&key='.WEB_API_KEY.'&order_id='.ORDER_ID'

Example

http://api.kartrocket.co/index.php?route=feed/web_api/orders&version=2&key=APITEST&order_id=442;

Response

Response
{
   "success":true,
   "orders":[
      {
         "order_id":"30000000",
         "invoice_number":"INV-20130",
         "store_name":"Your Store",
         "store_url":"https:\/\/yourstore.kartrocket.co\/",
         "firstname":"First Name",
         "lastname":"Last Name",
         "email":"name@email.com",
         "telephone":"",
         "mobile":"9999999999",
         "shipping_firstname":"First Name",
         "shipping_lastname":"Last Name",
         "shipping_mobile":"9999999999",
         "shipping_company":"",
         "shipping_address_1":"Address Line 1",
         "shipping_address_2":"Address Line 2",
         "shipping_city":"City",
         "shipping_zone":"State",
         "shipping_postcode":"110001",
         "shipping_country":"Country",
         "shipping_method":"Free",
         "payment_firstname":"First Name",
         "payment_lastname":"Last Name",
         "payment_mobile":"9999999999",
         "payment_company":"",
         "payment_address_1":"Address Line 1",
         "payment_address_2":"Address Line 2",
         "payment_city":"City",
         "payment_zone":"State",
         "payment_postcode":"110001",
         "payment_country":"Country",
         "payment_method":"Cash On Delivery",
         "payment_code":"cod",
         "comment":" Imported Order Id: XXXXXXXX",
         "total":"35.0000",
         "weight":"0.75kg",
         "order_status_id":"1", # Pending
         "currency_code":"INR",
         "date_added":"2014-11-13 18:36:53",
         "date_modified":"2014-11-13 18:36:53",
         "import_order_id":"54649f662c6738d3f6000002",
         "status":"1",
         "order_product":[
            {
               "product_id":"0", # If product is not in catalogue then 0 else product id in KR system
               "name":"Product Name",
               "sku":"SKU",
               "model":"Model",
               "quantity":"1",
               "price":"10.0000",
               "total":"10.0000",
               "tax":"0.0000"
            },
            {
               "product_id":"0", # If product is not in catalogue then 0 else product id in KR system
               "name":"Another Product Name",
               "sku":"ASKU",
               "model":"AModel",
               "quantity":"1",
               "price":"15.0000",
               "total":"15.0000",
               "tax":"0.0000"
            }
         ],
         "order_option":[
				# If product has variants
         ],
         "order_total":[
            {
               "code":"sub_total",
               "title":"Sub Total",
               "text":"Rs.35.00",
               "value":"35.0000"
            },
            {
               "code":"total",
               "title":"Total",
               "text":"Rs.35.00",
               "value":"35.0000"
            }
         ],
         "order_history":[
            {
               "order_status_id":"1",
               "order_status":"Pending",
               "notify":"0",
               "comment":" Imported Order Id: XXXXXXXX",
               "date_added":"2014-11-13 18:36:53",
               "courier":null,
               "awb_code":null
            }
         ]
      }
    ]
}


Get Order(s) V1

Request

User can get Order data by sending a HTTP GET Request to the following URL.


YOUR_STORE_URL_ON_KARTROCKET.'index.php?route=feed/web_api/orders&key='.WEB_API_KEY.'&order_id='.ORDER_ID'

Example

http://api.kartrocket.co/index.php?route=feed/web_api/orders&key=APITEST&order_id=442;

Response

Response
{
   "success":true,
   "orders":[
      {
         "order_id":"462",
         "invoice_number":"INV-2011-0013",
         "store_name":"Test Store: Please Ignore",
         "firstname":"Albert",
         "lastname":"Pinto",
         "email":"no-reply-4138465@bigfootretail.com",
         "telephone":"9999999999",
         "mobile":"",
         "shipping_firstname":"Albert",
         "shipping_lastname":"Pinto",
         "shipping_company":"",
         "shipping_address_1":"Street Address 1",
         "shipping_address_2":" Street Address 2",
         "shipping_city":"New Delhi",
         "shipping_state":"Delhi",
         "shipping_postcode":"110070",
         "shipping_country":"India",
         "shipping_method":"Amazon",
         "order_total":"5399.0000",
         "entered_weight":"",
         "currency":"INR",
         "date_added":"2013-09-15 18:54:36",
         "date_modified":"2013-11-15 13:37:51",
         "order_status":"Ready for Dispatch",
         "coupon_amount":null,
         "coupon":null,
         "payment_method":"Amazon",
         "customer_group":null,
         "product_name":"Sena Cases * MacBook Air 13? * Folio-Croco Black (816016)",
         "model":"",
         "quantity":"1",
         "product_price":"5129.0500",
         "product_tax":"0.0000",
         "tax_class":null,
         "option":null,
         "option_value":null,
         "courier":"BLUEDART",
         "awb_number":"43917861304"
      }
   ]
}



Limits

When you send request:

http://api.kartrocket.co/index.php?route=feed/web_api/orders&key=APITEST

It will fetch first hundred records. So, you may not get all order_ids in that response.

Now for new chunk of orders you have to send following request.

http://api.kartrocket.co/index.php?route=feed/web_api/orders&key=APITEST&page=2


For next 100:

http://api.kartrocket.co/index.php?route=feed/web_api/orders&key=APITEST&page=3

Parameters Description

key : API Key provided by KartRocket.(Required)

Filters

order_id : Order Id Id in KartRocket system.

date_from: Order added date (Min). UNIX Time Stamp e.g. 1388998982.

date_to: Order added date (Max). UNIX Time Stamp e.g. 1388998982.

updated_at_from: Order modified date (Min). UNIX Time Stamp e.g. 1388998982.

updated_at_to: Order modified date (Max). UNIX Time Stamp e.g. 1388998982.

order_status_id: Order status id. Refer Appendix 1.

Note: If you did not provide the order_id it will give all orders in response.

Appendix

Order Status Codes
Code Description
1 Pending
3 Shipped
5 Complete
7 Canceled
10 ePayment Failed
17 COD Confirmed
18 Ready for Dispatch
19 ePayment Received
20 Returned
21 Cancelled Against New
22 RTO Initiated-Logistics Partner
23 RTO Initiated-Customer
24 RTO Received-Logisitics Partner
25 RTO Received-Customer
26 Lost/Stolen
27 Delivered
28 Pick Up Generated