Introduction

In most cases, the third-party application must be authenticated to use the Oorjit API. But users never reveal their credentials to the application to preserve their privacy. An open standard for secure API authentication is a token-passing mechanism that allows users to control which applications have access to their data without revealing their passwords or other credentials.

Introduction to API

Accessing the API

What is REST API? To make it simple, REST API defines a set of functions to which the developers can perform requests and receive responses. The interaction is performed via the HTTP protocol. An advantage of such an approach is the wide usage of HTTP. That is why REST API can be used practically for any programming language.

Common characteristics of Oorjit REST API resources are as follows: (projecthost is your domain)

Overall Capabilities

Oorjit REST API allows managing a number of features, namely:

Advantages

Disadvantages

Output Formats

The REST API supports the response in one formats, which are JSON

HTTP Verbs

HTTP verbs are used to manage the state of resources. In Oorjit REST API, there are four verbs used to manage resources: GET, POST, PUT, and DELETE. You can get the contents of the data using HTTP GET, delete the data using HTTP DELETE, and create or update the data using POST/PUT.

Request Structure

All URLs in REST API have the following base URL. 

http://projecthost/api/rest/

Example

Supposing, you want to retrieve the list of customers from Oorjit. To do this, you need to use the GET HTTP method. The GET request to retrieve the list of customers will look as follows:

http://projecthost/api/rest/customers

where

REST Resources

The Oorjit REST API allows you to manage merchant,subscribers,customers,categories, products,checkout,orders,shipping. REST API is organized into the following categories:

Merchants

Retrieve the list of merchants, create, update, and delete a merchant.

Resource Structurehttp://projecthost/api/rest/merchant

Subscribers

Retrieve the list of subscribers, create, update, and delete a subscribers.

Resource Structurehttp://projecthost/api/rest/subscriber

Customers

Retrieve the list of users, create, update, and delete a users.

Resource Structurehttp://projecthost/api/rest/user

Categories.

Retrieve the list of categories, create, update, and delete a categories.

Resource Structurehttp://projecthost/api/rest/categoris

Products

Retrieve the list of products, create, update, and delete a products.

Resource Structurehttp://projecthost/api/rest/product

Orders

Allows you to manage sales orders, invoices, shipments etc.

Resource Structurehttp://projecthost/api/rest/order

Shipping

Allow you to retrieve shipping list parameters are shipping method, order id, merchant id etc.Allow you to update shipping status and tracking ID

Resource Structurehttp://projecthost/api/rest/shipping

Product Reviews

Allows you to manage product reviews.

Resource Structurehttp://projecthost/api/rest/review


Preparing for REST API

These steps are required for utilizing REST API resources:

  1. Set up permissions for REST resource operations from Oorjit Admin Panel.
  2. Configure the attributes for different users types in Oorjit Admin Panel.

Resource URL patterns

/rest/

/rest/merchant

/rest/merchant/{business_id}

/rest/merchant/{business_id}/sub/locations/

/rest/merchant/{business_id}/sub/locations/

/rest/product

/rest/product/{product_id}/

/rest/product/{product_id}/sub/options//

Request Structure

Request Structure

All URLs in REST API have the following base URL. 

http://projecthost/api/rest/

Example

Supposing, you want to retrieve the list of customers from Oorjit. To do this, you need to use the GET HTTP method. The GET request to retrieve the list of customers will look as follows:

http://projecthost/api/rest/customers

where

GET Filters

Some requests use GET parameters in the URL. These are as follows:

If the attribute value consists of several words separated by a comma(,)


Responses

If you make a Oorjit API call, you are guaranteed to receive some kind of a response. If you make a successful call, you will receive an HTTP response with a 200 OK status.

REST API Response Formats

You can view the response data from any Oorjit API call in one of the following one format:

The format of returned data is defined in the request header. The format you choose depends on what you are familiar with most or tools available to you.


JSON Format

JSON (JavaScript Object Notation) is a lightweight data-interchange format.
To set the response format to JSON, add the Accept request header with the application/json value.

Response Structure

The JSON objects response format.

{

   "messages": {

       "error": [

           {

               "code": 404,

               "message": "Resource not found."

           }

       ]

   }

}

JSON Responses

[

   {

       "itemID": "1",

       "productID": "1",

       "stockID": "1",

       "qty": "99.0000",

   },

   {

       "itemID": "2",

       "productID": "2",

       "stockID": "1",

       "qty": "100.0000",

   }

]


The list of HTTP status codes that are returned in the API response is described in the Common HTTP Status Codes part of the documentation. There, you can find the list of codes themselves together with their description.


HTTP Methods

Accessing API is performed via HTTP. When you enter a URL into a web browser address bar, the browser performs an HTTP GET request to the URL. This usually returns a web page in the form of an HTTP response that the browser displays. But the GET method is one of several HTTP request methods. Oorjit REST API uses the four main HTTP methods: GET, POST, PUT, and DELETE. The most widespread methods are GET and POST. The other methods are less known but they became widely known due to the popularity of REST web services. An important concept of the REST architecture is that different HTTP request methods perform different actions when applied to the same URL.

For example:

will retrieve information about the specified customer;

will delete the specified customer.

GET

Retrieving Resources with the HTTP GET Method

The HTTP GET method is defined in section 9.3 of the RFC2616 document:

"The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process."

You can retrieve a representation of a resource by GETting its URL.

POST and PUT

Creating or Updating Resources with the HTTP POST and PUT Methods

The POST method is defined in section 9.5 of the RFC2616 document:

The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions:

The PUT method is defined in section 9.6 of the RFC2616 document:

"The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server."

Creating or updating a resource involves performing an HTTP POST or HTTP PUT to a resource URL.


Errors

HTTP status codes are an essential part of the REST concept.

The Oorjit API attempts to return appropriate HTTP status codes for all requests. Any information is returned in the form of a standard HTTP response with an HTTP status code describing the error and the body message.

HTTP Status Codes

The following table contains possible common HTTP status codes:

Status Code

Message

200 OK

-

400 Bad Request

Resource data pre-validation error. 
Resource data invalid. 
Resource unknown error. 
The request data is invalid. 
Resource collection paging error. 
The paging limit exceeds the allowed number. 
Resource collection ordering error. 
Resource collection filtering error. 
Resource collection including additional attributes error. 

403 Forbidden

Access denied.

404 Not Found

Resource not found. 

405 Method Not Allowed

Resource does not support method. 
Resource method not implemented yet. 

500 Internal Error

Unhandled simple errors. 
Resource internal error.

Error Messages

When the Oorjit API returns an error message, it returns it in your requested format(Response Formats).

An error in the JSON format might look like the following:

{

   "messages": {

       "error": [

           {

               "code": 404,

               "message": "Resource not found."

           }

       ]

   }

}


Date Time Format

DateTime format

The Oorjit platform stores date/time fields either in local or universal time (UTC). Both field types are stored in the format YYYY-MM-DD HH:MM:SS; hours are specified in 24-hour notation, e.g., 14:00:00 for 2PM. Note that the time part of the field can be optional; for example, some purchase events may only have a purchase date.

Retrieve Merchant

REST API: Merchants

URI: /merchant/

Allows you to retrieve the Merchants/vendor details.

URL Structurehttp://projecthost/api/rest/merchant/
Version: 1

HTTP Method: GET /merchant/

Description: Allows you to retrieve the Merchants/vendor details.

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON


[

   {

       "businessID": "  2  ",

       "businessStatus": "  Active  ",

       "businessPhone": "  1234567890 ",

       "businessEmail": "  [email protected]",

       "businessName": "  ABC Corp",

       "businessLocCount": "  0",

       "productCount": "  23",

       "businessUserCount": "  0"

   },

   {

       "businessID": "  5",

       "businessStatus": "  Active",

       "businessPhone": "  5565865865",

       "businessEmail": "  [email protected]",

       "businessName": "  Dell Electronics",

       "businessLocCount": "  0",

       "productCount": "  5",

       "businessUserCount": "  0"

   },

   {

       "businessID": "  3",

       "businessStatus": "  Active",

       "businessPhone": "  1234567890",

       "businessEmail": "  [email protected]",

       "businessName": "  K & K Automobiles ",

       "businessLocCount": "  0 ",

       "productCount": "  2 ",

       "businessUserCount": "  0 "

   }

]


Create Merchant

HTTP Method: POST /merchant/

Description: Allows you to create a new merchant.

Authentication: Admin
Default Format: JSON

Parameters:

Name

Type

businessTypeID

int

languageID

int

businessName

varchar

businessKey

varchar

businessProfile

text

businessLogo

varchar

businessCFirstName

varchar

businessCLastName

varchar

businessCDesignation

varchar

businessPhone

varchar

businessFax

varchar

businessEmail

varchar

businessWebsite

varchar

businessAccountName

varchar

businessAccountType

varchar

businessAccountDetails

text

businessPaypalEmail

varchar

businessStatus

enum('Active', 'Inactive', 'Deleted', 'Locked')

businessPassword

varchar

businessLogin

varchar

businessDefaultLanguageID


Array of Group location attributes is as follows:

Name

Type

locAddress1

varchar

locAddress2

varchar

locCity

varchar

locProvince

varchar

locStateID

smallint

locCountryID

smallint

locZip

varchar

locLatitude

varchar

locLongitude

varchar

locStatus

enum(Active,Inactive,Deleted)

Example JSON :

Request Body: (Multiple Merchant)


[

   {

       "businessTypeID": "2",

       "languageID": 1,

       "businessName": "ABC Corp",

       "businessProfile": "",

       "businessLogin": "abccorp",

       "businessPassword": "abccorp123",

       "businessKey": "abc-corp",

       "businessLogo": "",

       "businessCFirstName        ": "ABC",

       "businessCLastName        ": "Corp",

       "businessCDesignation": "",

       "businessPhone        ": "1234567890",

       "businessFax": "",

       "businessEmail": "[email protected]",

       "businessWebsite": "",

       "businessAccountName": "",

       "businessAccountType": "",

       "businessAccountDetails": "",

       "businessPaypalEmail": "",

       "businessStatus        ": "Active",

       "businessAddedDate": "2013-07-15 11:27:58",

       "businessUpdateDate": "2013-07-15 11:27:58",

       "businessDefaultLanguageID": "1",

       "business_locations": [

           {

               "locAddress1": "Address1",

               "locAddress2": "Address2",

               "locCity": "City1",

               "locProvince": "Province 1",

               "locStateID": "1",

               "locCountryID": "99",

               "locZip": "256341",

               "locLatitude": "16.3256",

               "locLongitude": "56.2356",

               "locPhone": "9874563210",

               "locEmail": "[email protected]",

               "locStatus": "Active",

               "isLocationBasic": "Yes"

           },

           {

               "locAddress1": "Address1",

               "locAddress2": "Address2",

               "locCity": "City1",

               "locProvince": "Province 1",

               "locStateID": "6",

               "locCountryID": "99",

               "locZip": "256311",

               "locLatitude": "12.3256",

               "locLongitude": "56.2356",

               "locPhone": "9874522210",

               "locEmail": "[email protected]",

               "locStatus": "Active",

               "isLocationBasic": "No"

           }

       ]

   }

]


Modify Merchant

HTTP Method: PUT /merchant

Description: Allows you to update existing merchant.

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.


Parameters:

Example: JSON


Request Body:

[

   {

       "businessID": "157",

       "businessName": "ABC World",

       "locLatitude": "10.253562",

       "locLongitude": "75.265635"

   },

   {

       "businessID": "158",

       "businessName": "XYZ Store",

       "locLatitude": "18.36524",

       "locLongitude": "80.0000"

   },

   {

       "businessID": "159",

       "businessName": "Joy Creams",

       "locLatitude": "51.25654",

       "locLongitude": "23.520099"

   },

   {

       "businessID": "160",

       "businessName": "Happy Aways",

       "locLatitude": "10.0000",

       "locLongitude": "90.0000"

   }

]


Response Body:

{

 "oorjit_api": {

   "success": {

     "data_item": {

       "message": "Resource updated successful.",

       "code": "200",

       "businessID": "157"

     }

   },

   "error": {

     "data_item": [

       {

         "message": "Resource not found.",

         "code": "404",

         "businessID": "158"

       },

       {

         "message": "Resource not found.",

         "code": "404",

         "businessID": "159"

       },

       {

         "message": "Empty value for \"businessID\" in request.",

         "code": "400",

         "businessID": "160"

       }

     ]

   }

 }

}


HTTP Method: DELETE /merchant

Description: Not allowed


REST API: Merchant

URI: /merchant/:id

Allows you to update, delete, or retrieve information on a single merchant

URL Structurehttp://projecthost/api/rest/merchant/:id
Version: 1

HTTP Method : GET /merchant/:id

Description: Allows you to retrieve the merchant information.
Authentication: Admin

Response Example: JSON

Arguments/Filters

  1. merchantID
  2. merchantKey

Response Body:

[{

   "businessID": "2",

   "businessLogin": "abccorp",

   "businessPassword": "iadwVg1skk~Py2L-S7kUPjQ..",

   "businessKey": "abc-corp",

   "businessLogo": "",

   "businessCFirstName": "ABC",

   "businessCLastName": "Corp",

   "businessCDesignation": "",

   "businessPhone": "1234567890",

   "businessFax": "",

   "businessEmail": "[email protected]",

   "businessWebsite": "",

   "businessAccountName": "",

   "businessAccountType": "",

   "businessAccountDetails": "",

   "businessPaypalEmail": "",

   "businessStatus": "Active",

   "businessAddedDate": "2013-07-15 11:27:58",

   "businessUpdateDate": "2013-08-19 11:46:25",

   "businessDefaultLanguageID": "1",

   "loginLockedDate": "0000-00-00 00:00:00",

   "loginInvalidAccessCount": "0",

   "businessTypeID": "2",

   "businessDetailsID": "2",

   "businessName": "ABC Corp",

   "businessProfile": "",

   "businessLocID": "2",

   "locZip": "686507",

   "locCountryID": "99",

   "locStateID": "1490",

   "locLatitude": "9.9312328",

   "locLongitude": "76.26730410000005",

   "locDetailsID": "2",

   "languageID": "1",

   "locName": "ABC Corp",

   "locAddress1": "Address 1",

   "locAddress2": "",

   "locCity": "Cochin",

   "locProvince": "",

   "countryID": "99",

   "countryName": "India",

   "stateID": "1490",

   "stateName": "Kerala",

   "businessTypeName": null,

   "subBusinessTypeName": "E-Commerce",

   "followCount": "5",

   "languageName": "English (US)",

   "businessAddress": "ABC~*Corp~*Address 1~*~*Cochin~*~*686507~*1490~*99",

   "businessPartialAddress": "Address 1~*~*Cochin~*~*686507~*1490~*99"

}]



Subscribers

Retrieve Subscribers

REST API: Subscribers

URI: /subscriber/

Retrieve the list of Subscribers, create, delete a Subscriber, and update the subscriber information.

URL Structurehttp://projecthost/api/rest/subscriber/
Version: 1

HTTP Method: GET /subscriber/

Description: Allows you to retrieve the subscriber details

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON


[

   {

       "subscID": "1",

       "subscEmailID": "[email protected]",

       "userID": "8",

       "contactPhone": "9874563210",

       "remoteAddress": "192.168.1.195",

       "subscStatus": "Subscribed",

       "subscribedDate": "2013-07-13 13:56:46",

       "unsubscrDate": "0000-00-00 00:00:00",

       "languageID": "1"

   },

   {

       "subscID": "1",

       "subscEmailID": "[email protected]",

       "userID": "8",

       "contactPhone": "9874563210",

       "remoteAddress": "192.168.1.195",

       "subscStatus": "Subscribed",

       "subscribedDate": "2013-07-13 13:56:46",

       "unsubscrDate": "0000-00-00 00:00:00",

       "languageID": "1"

   },

   {

       "subscID": "1",

       "subscEmailID": "[email protected]",

       "userID": "8",

       "contactPhone": "9874563210",

       "remoteAddress": "192.168.1.195",

       "subscStatus": "Subscribed",

       "subscribedDate": "2013-07-13 13:56:46",

       "unsubscrDate": "0000-00-00 00:00:00",

       "languageID": "1"

   }

]

Create Subscribers

HTTP Method: POST /subscriber/

Description: Allows you to create a new subscriber

Authentication: Admin
Default Format: JSON

Parameters:


Name

Type

subscEmailID

varchar

languageID

int

subscribedDate

datetime

remoteAddress

varchar

contactPhone

varchar

subscStatus

enum('Subscribed', 'Unsubscribed')


Example JSON :

Request Body:


[

   {

      "subscEmailID": "[email protected]",

      "languageID": 1,

      "subscribedDate": "2013-05-0 15:20:16 ",

       "contactPhone": "9874563210",

       "subscStatus": "Subscribed"

   },

   {

      "subscEmailID": "[email protected]",

      "languageID": 1,

      "subscribedDate": "2013-05-0 15:20:16 ",

       "contactPhone": "9874563210",

       "subscStatus": "Subscribed"

   }

]


Modify Subscribers

HTTP Method: PUT /subscriber/

Description: Allows you to update existing subscriber.

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.


Parameters:

Name

Type

subscID

int

subscEmailID

varchar

languageID

int

subscribedDate

datetime

remoteAddress

varchar

contactPhone

varchar

subscStatus

enum('Subscribed', 'Unsubscribed')

unsubscrDate

timestamp

Example: JSON


Request Body:

[

   {

      "subscID": "1",

      "subscEmailID": "[email protected]",

      "languageID": 1,

      "contactPhone": "9874563210",

      "subscStatus": "Subscribed"

   },

   {

      "subscID": "2",

      "subscEmailID": "[email protected]",

      "languageID": 1,

      "contactPhone": "9874563210",

      "subscStatus": "Unsubscribed",

       "unsubscrDate": "2013-08-20 15:15:15"

   }

]


Response Body:

{

 "oorjit_api": {

   "success": {

     "data_item": {

       "message": "Resource updated successful.",

       "code": "200",

       "subscID": "1"

     }

   },

   "error": {

     "data_item": [

       {

         "message": "Resource not found.",

         "code": "404",

         "subscID": "2"

       }

     ]

   }

 }

}


HTTP Method: DELETE /subscriber

Description: Not allowed


REST API: Subscriber


URI: /subscriber/:id

Allows you to update, delete, or retrieve information on a single subscriber

URL Structurehttp://projecthost/api/rest/subscriber/:id
Version: 1

HTTP Method : GET /subscriber/:id

Description: Allows you to retrieve the subscriber information.
Authentication: Admin

Response Example: JSON

Arguments/Filters

  1. cities
  2. status
  3. date
  4. IP

Response Body:

[

{

             "subscID": "2",

      "subscEmailID": "[email protected]",

             "languageID": 1,

      "subscribedDate": "ABCD Corp",

      "contactPhone": "9874563210",

             "subscStatus": "Unsubscribed",

       "unsubscrDate": "2013-08-20 15:15:15"

}

]

Customers

Retrieve Customers

REST API: Customers

URI: /user/

Retrieve the list of customers, create, delete a Subscriber, and update the customer information.

URL Structurehttp://projecthost/api/rest/user/
Version: 1

HTTP Method: GET /user/

Description: Allows you to retrieve the subscriber details

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON


[

   {

       "userID": 1,

       "userTypeID": 0,

       "userName": "",

       "userEmail": "[email protected]",

       "userPassword": "iadwVg1skk~Py2L-S7kUPjQ..",

       "userFirstName": "Anfas",

       "userLastName": "Ansary",

       "userPhone": "",

       "userRegistredDate": "2013-07-09 15:59:01",

       "userLastAccessed": "2013-08-19 12:00:23",

       "userNewsLetterMode": "HTML",

       "userAdress1": "Add",

       "userAdress2": "",

       "userCity": "Cochin",

       "countryID": 99,

       "stateID": 1490,

       "userProvince": "",

       "userZip": 682024,

       "userGroupID": 0,

       "userReferralID": "refjyqgjbp",

       "userProfilePicture": "",

       "userDOB": "",

       "userGender": null,

       "userLoginType": "Site",

       "userStatus": "Active",

       "userLockedDate": "0000-00-00 00:00:00",

       "userInvalidAccessCount": 0,

       "userNewsletterSubscribeStatus": "Yes",

       "userDefaultLanguage": 0,

       "resetCode": ""

   },

   {

       "userID": 11,

       "userTypeID": 0,

       "userName": "",

       "userEmail": "[email protected]",

       "userPassword": "iVh358zXDfVg.",

       "userFirstName": "Bibu",

       "userLastName": "Babu",

       "userPhone": 918547625198,

       "userRegistredDate": "2013-07-17 12:38:46",

       "userLastAccessed": "2013-08-16 11:32:41",

       "userNewsLetterMode": "HTML",

       "userAdress1": "34/138 E6, Knowell Jairaj Building",

       "userAdress2": "N. H. By Pass. Edappally",

       "userCity": "Cochin",

       "countryID": 99,

       "stateID": 1490,

       "userProvince": "",

       "userZip": 682024,

       "userGroupID": 0,

       "userReferralID": "reflvlema8",

       "userProfilePicture": "images_userProfilePicture_130806151744.jpg",

       "userDOB": "31-01-2012",

       "userGender": "Male",

       "userLoginType": "Site",

       "userStatus": "Active",

       "userLockedDate": "0000-00-00 00:00:00",

       "userInvalidAccessCount": 0,

       "userNewsletterSubscribeStatus": "Yes",

       "userDefaultLanguage": 1,

       "resetCode": ""

   }

]


Create Customers

HTTP Method: POST /user/

Description: Allows you to create a new Customer

Authentication: Admin
Default Format: JSON

Parameters:


Name

Type

userTypeID

int

userName

varchar

userEmail

varchar

userPassword

varchar

userFirstName

varchar

userLastName

varchar

userPhone

varchar

userRegistredDate

timestamp

userNewsLetterMode

enum('Text','HTML')

userAdress1

varchar

userAdress2

varchar

userCity

varchar

countryID

int

stateID

int

userProvince

varchar

userZip

varchar

userGroupID

int

userReferralID

varchar

userProfilePicture

varchar

userDOB

varchar

userGender

enum('Male','Female')

userLoginType

enum('Site','Facebook')

userStatus

enum('Active','Inactive','Deleted','Locked')

userNewsletterSubscribeStatus

enum('Yes','No')

userDefaultLanguage

mediumint


Example JSON :

Request Body:


[

   {

       "userTypeID": 0,

       "userName": "",

       "userEmail": "[email protected]",

       "userPassword": "iVh358zXDfVg.",

       "userFirstName": "Bibu",

       "userLastName": "Babu",

       "userPhone": 918547625198,

       "userRegistredDate": "2013-07-17 12:38:46",

       "userNewsLetterMode": "HTML",

       "userAdress1": "34/138 E6, Knowell Jairaj Building",

       "userAdress2": "N. H. By Pass. Edappally",

       "userCity": "Cochin",

       "countryID": 99,

       "stateID": 1490,

       "userProvince": "",

       "userZip": 682024,

       "userGroupID": 0,

       "userReferralID": "reflvlema8",

       "userProfilePicture": "images_userProfilePicture_130806151744.jpg",

       "userDOB": "31-01-2012",

       "userGender": "Male",

       "userLoginType": "Site",

       "userStatus": "Active",

       "userNewsletterSubscribeStatus": "Yes",

       "userDefaultLanguage": 1,


   }

]


Modify Customers

HTTP Method: PUT /user/

Description: Allows you to update existing Customer.

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.


Parameters:


Name

Type

userID

bigint

userTypeID

int

userName

varchar

userEmail

varchar

userPassword

varchar

userFirstName

varchar

userLastName

varchar

userPhone

varchar

userRegistredDate

timestamp

userNewsLetterMode

enum('Text','HTML')

userAdress1

varchar

userAdress2

varchar

userCity

varchar

countryID

int

stateID

int

userProvince

varchar

userZip

varchar

userGroupID

int

userReferralID

varchar

userProfilePicture

varchar

userDOB

varchar

userGender

enum('Male','Female')

userLoginType

enum('Site','Facebook')

userStatus

enum('Active','Inactive','Deleted','Locked')

userNewsletterSubscribeStatus

enum('Yes','No')

userDefaultLanguage

mediumint

userLockedDate

timestamp

userInvalidAccessCount

int

Example: JSON


Request Body:

[

   {

       "userID": "1",

       "userEmail": "[email protected]",

       "userDefaultLanguage": 1,

       "userPhone": "9874563210",

       "subscStatus": "Subscribed"

   },

   {

       "userID": "2",

       "userEmail": "[email protected]",

       "userDefaultLanguage": 1,

       "userPhone": "9874563210",

       "userStatus": "'Locked'",

       "userLockedDate": "2013-08-20 15:15:15"

   }

]



Response Body:

{

 "oorjit_api": {

   "success": {

     "data_item": {

       "message": "Resource updated successful.",

       "code": "200",

       "userID": "1"

     }

   },

   "error": {

     "data_item": [

       {

         "message": "Resource not found.",

         "code": "404",

         "userID": "2"

       }

     ]

   }

 }

}

URI: /user/:id

Allows you to update, delete, or retrieve information on a single Customer

URL Structurehttp://projecthost/api/rest/user/:id
Version: 1

HTTP Method : GET /user/:id

Description: Allows you to retrieve the customer information.
Authentication: Admin

Response Example: JSON

Arguments/Filters

  1. userid

Response Body:

[

{

       "userID": "2",

       "userEmail": "[email protected]",

       "userDefaultLanguage": 1,

       "userPhone": "9874563210",

       "userStatus": "'Locked'",

       "userLockedDate": "2013-08-20 15:15:15"

   }

]


CCDetails

Retrieve CCDetails

REST API: CC details

URI: /user/:id/child/ccdetails

Allows you to retrieve the Credit card details.

URL Structurehttp://projecthost/api/rest/users/:id/child/ccdetails/
Version: 1

HTTP Method: GET /users/:id/child/ccdetails/

Description: Allows you to retrieve the credit card details.

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON

GET http://projecthost/api/rest/users/:id/child/ccdetails/


[

   {

       "userID": "100",

       "firstNameonCard": "JOHN",

       "lastNameonCard": "GEORGE",

       "cardType": "VISA",

       "cardNumber": "4048 2586 5874 5896",

       "expMonth": "9",

       "expYear": "2022",

       "addedDate": "2013-07-12 14:58:21"

   }

]


Create CCDetails

HTTP Method: POST /users/child/ccdetails/

Description: Allows you to add credit card details.

Authentication: Admin
Default Format: JSON

Parameters:


Name

Type

userID

int

firstNameonCard

char

lastNameonCard

char

cardType

char

cardNumber

char

expMonth

int

expYear

int

addedDate

date


Example JSON :

Request Body:


[

   {

       "userID": "100",

       "firstNameonCard": "JOHN",

       "lastNameonCard": "GEORGE",

       "cardType": "VISA",

       "cardNumber": "4048 2586 5874 5896",

       "expMonth": "9",

       "expYear": "2022",

       "addedDate": "2013-07-12 14:58:21"

   }

]


Modify CCDetails

HTTP Method: PUT /users/child/ccdetails/

Description: Allows you to update credit card details

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.

Important : userID should be existed otherwise add a new row

Request Body:

[

   {

       "userID": "100",

       "firstNameonCard": "JOHN",

       "lastNameonCard": "GEORGE",

       "cardType": "VISA",

       "cardNumber": "4048 2586 5874 5896",

       "expMonth": "9",

       "expYear": "2022",

       "addedDate": "2013-07-12 14:58:21"

   }

]



Places

Retrieve Places

REST API: User Places

URI: users/id/:id/child/places/

Allows you to retrieve the Places details.

URL Structurehttp://projecthost/api/rest/users/id/:id/child/places/
Version: 1

HTTP Method: GET users/id/:id/child/places/

Description: Allows you to retrieve the place details.

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON

GET http://projecthost/api/rest/users/id/:id/child/places/


[

   {

       "userID": "6",

       "placeAddress": "Cheranellore, Janatha Road",

       "placeType": "Home",

       "placeLat": "6.33",

       "placeLng": "9.366",

       "createdDate": "2013-10-02 00:00:00"

   }

 ]


Create Places

HTTP Method: POST users/id/:id/child/places/

Description: Allows you to add place details.

Authentication: Admin
Default Format: JSON

Parameters:


Name

Type

userID

int

placeAddress

char

placeType

enum(Home,Work,Favorite)

placeLat

Decimal

placeLng

Decimal

createdDate

date


Example JSON :

Request Body:


[

   {

       "userID": "6",

       "placeAddress": "Cheranellore, Janatha Road",

       "placeType": "Home",

       "placeLat": "6.33",

       "placeLng": "9.366",

       "createdDate": "2013-10-02 00:00:00"

   }

 ]


Modify Places

HTTP Method: PUT users/id/:id/child/places/

Description: Allows you to update place details

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.


Request Body:

[

   {

       "placesID": "1",

       "userID": "6",

       "placeAddress": "Cheranellore, Janatha Road",

       "placeType": "Home",

       "placeLat": "6.33",

       "placeLng": "9.366",

       "createdDate": "2013-10-02 00:00:00"

   }

 ]



Shipping

Retrieve Shipping

REST API: User Shipping

URI: users/id/:id/child/shipping

Allows you to retrieve the Shipping Address details.

URL Structurehttp://projecthost/api/rest/users/id/:id/child/shipping
Version: 1

HTTP Method: GET users/id/:id/child/shipping

Description: Allows you to retrieve the shipping Address details.

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON

GET http://projecthost/api/rest/users/id/:id/child/shipping


[

   {

               "userShippingID": "11",

       "userID": "6",

       "shippingFname": "Vinoy",

       "shippingLname": "George",

       "shippingAddress1": "Janatha Road 2-Updated ",

       "shippingAddress2": "Cheranellore",

       "shippingCity": "Cochin",

       "shippingZip": "3698521",

       "shippingCountryID": "223",

       "shippingStateID": "3614",

       "shippingProvince": "",

       "addressPrimary": "Yes",

       "addressStatus": "Active"

   }]


Create Shipping

HTTP Method: POST users/id/:id/child/shipping

Description: Allows you to add place details.

Authentication: Admin
Default Format: JSON

Parameters:


Name

Type

userShippingID

int

userID

int

shippingFname

varchar

shippingLname

varchar

shippingAddress1

varchar

shippingAddress2

varchar

shippingCity

varchar

shippingZip

varchar

shippingCountryID

smallint

shippingStateID

int

shippingProvince

varchar

addressPrimary

enum('Yes', 'No')

addressStatus

enum('Deleted', 'Active')


Example JSON :

Request Body:


[

   {

       "userID": "6",

       "shippingFname": "Vinoy",

       "shippingLname": "George",

       "shippingAddress1": "Janatha Road 2-Updated ",

       "shippingAddress2": "Cheranellore",

       "shippingCity": "Cochin",

       "shippingZip": "3698521",

       "shippingCountryID": "223",

       "shippingStateID": "3614",

       "shippingProvince": "",

       "addressPrimary": "Yes",

       "addressStatus": "Active"

   }

]


Modify Shipping

HTTP Method: PUT users/id/:id/child/shipping

Description: Allows you to update place details

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.


Request Body:

[

   {

           "userShippingID": "11",

       "userID": "6",

       "shippingFname": "Vinoy",

       "shippingLname": "George",

       "shippingAddress1": "Janatha Road 2-Updated ",

       "shippingAddress2": "Cheranellore",

       "shippingCity": "Cochin",

       "shippingZip": "3698521",

       "shippingCountryID": "223",

       "shippingStateID": "3614",

       "shippingProvince": "",

       "addressPrimary": "Yes",

       "addressStatus": "Active"

   }

]



Categories

Retrieve Category

REST API: Category

URI: /categories/

Allows you to retrieve the Category details.

URL Structurehttp://projecthost/api/rest/categories/
Version: 1

HTTP Method: GET /categories/

Description: Allows you to retrieve the Category details.

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON


[

   {

       "productCategoryID": 1,

       "productCategoryKey": "other",

       "productCategoryParent": 0,

       "productCategoryStatus": "Active",

       "productCategorySortOrder": 68,

       "categoryLevel": 1,

       "productCategoryDetID": 1,

       "languageID": 1,

       "productCategoryName": "Others",

       "productCategoryDescription": "",

       "productCategoryMetaTitle": "",

       "productCategoryMetaKeywords": "",

       "productCategoryMetaDescription": ""

   },

   {

       "productCategoryID": 1,

       "productCategoryKey": "other",

       "productCategoryParent": 0,

       "productCategoryStatus": "Active",

       "productCategorySortOrder": 68,

       "categoryLevel": 1,

       "productCategoryDetID": 250,

       "languageID": 2,

       "productCategoryName": "Others",

       "productCategoryDescription": "",

       "productCategoryMetaTitle": "",

       "productCategoryMetaKeywords": "",

       "productCategoryMetaDescription": ""

   },

   {

       "productCategoryID": 1,

       "productCategoryKey": "other",

       "productCategoryParent": 0,

       "productCategoryStatus": "Active",

       "productCategorySortOrder": 68,

       "categoryLevel": 1,

       "productCategoryDetID": 377,

       "languageID": 3,

       "productCategoryName": "Others",

       "productCategoryDescription": "",

       "productCategoryMetaTitle": "",

       "productCategoryMetaKeywords": "",

       "productCategoryMetaDescription": ""

   }

]

Create Category

HTTP Method: POST /categories/

Description: Allows you to create a new Category.

Authentication: Admin
Default Format: JSON

Parameters:


Name

Type

productCategoryKey

char

productCategoryParent

int

productCategoryStatus

enum('Active', 'Inactive', 'Delete')

productCategorySortOrder

int

categoryLevel

int

productCategoryDetID

int

languageID

int

productCategoryName

char

productCategoryDescription

text

productCategoryMetaTitle

text

productCategoryMetaKeywords

text

productCategoryMetaDescription

text


Example JSON :

Request Body: (Multiple Category)


[

   {

       "productCategoryKey": "key",

       "productCategoryParent": 0,

       "productCategoryStatus": "Active",

       "productCategorySortOrder": 68,

       "categoryLevel": 1,

       "productCategoryDetID": 377,

       "languageID": 3,

       "productCategoryName": "New Category",

       "productCategoryDescription": "",

       "productCategoryMetaTitle": "",

       "productCategoryMetaKeywords": "",

       "productCategoryMetaDescription": ""

   }

]

Modify Category

HTTP Method: PUT /categories

Description: Allows you to update existing Category.

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.

Example: JSON


Request Body:

[

   {

       "productCategoryID": "157",

       "productCategoryName": "New Category1",

       "categoryLevel": "1",

       "productCategoryDescription": "productCategoryDescription4"

   },

   {

       "productCategoryID": "158",

       "productCategoryName": "New Category2",

       "categoryLevel": "2",

       "productCategoryDescription": "productCategoryDescription3"

   },

   {

       "productCategoryID": "159",

       "productCategoryName": "New Category3",

       "categoryLevel": "2",

       "productCategoryDescription": "productCategoryDescription2"

   },

   {

       "productCategoryID": "160",

       "productCategoryName": "New Category4",

       "categoryLevel": "3",

       "productCategoryDescription": "productCategoryDescription1"

   }

]



Response Body:

{

 "oorjit_api": {

   "success": {

     "data_item": {

       "message": "Resource updated successful.",

       "code": "200",

       "productCategoryID": "157"

     }

   },

   "error": {

     "data_item": [

       {

         "message": "Resource not found.",

         "code": "404",

         "productCategoryID": "158"

       },

       {

         "message": "Resource not found.",

         "code": "404",

         "productCategoryID": "159"

       },

       {

         "message": "Empty value for \"productCategoryID\" in request.",

         "code": "400",

         "productCategoryID": "160"

       }

     ]

   }

 }

}

REST API: Category

URI: /categories/:id

Allows you to update, delete, or retrieve information on a single Category

URL Structurehttp://projecthost/api/rest/categories/:id
Version: 1

HTTP Method : GET /categories/:id

Description: Allows you to retrieve the Category information.
Authentication: Admin

Response Example: JSON

Response Body:

[{

       "productCategoryID": 1,

       "productCategoryKey": "other",

       "productCategoryParent": 0,

       "productCategoryStatus": "Active",

       "productCategorySortOrder": 68,

       "productCategoryImage": " ",

       "categoryLevel": 1,

       "productCategoryDetID": 250,

       "languageID": 2,

       "productCategoryName": "Others",

       "productCategoryDescription": "",

       "productCategoryMetaTitle": "",

       "productCategoryMetaKeywords": "",

       "productCategoryMetaDescription": ""

   }]


Products

Retrieve Products

REST API: Products

URI: /product

Allows you to retrieve the list of all products with detailed information.

URL Structurehttp://projecthost/api/rest/product
Version: 1

HTTP Method: GET /product

Description: Allows you to retrieve the list of all products with detailed information.
Notes: The list of attributes that will be returned in the response is configured in the oorjit Admin Panel. The list of attributes differs for each type of user.

Authentication: Admin
Default Format: JSON
Parameters:
No Parameters

Response Example: JSON (List of Products)


[

   {

       "productID": 2,

       "productTypeID": 1,

       "businessID": 2,

       "isTaxable": "No",

       "taxClassID": 0,

       "taxPayableToBusiness": "No",

       "taxRate": 0,

       "productKey": "canvashd",

       "attributeSetID": 2,

       "measurementLength": 1,

       "measurementWeight": 5,

       "productTimeZone": 42,

       "productStartTime": "2013-07-08",

       "productEndTime": "2013-07-31",

       "productMinBuyLimit": 1,

       "productMaxGiftBuy": null,

       "productMaxBuyLimit": 4,

       "productMinQntyReqToTipp": 0,

       "productExpiryDate": "0000-00-00 00:00:00",

       "productCommissionRate": 0,

       "productUseGlobalCommision": "",

       "productCommissionType": "",

       "multiOptionsAvailable": "No",

       "enablePrepay": "No",

       "applyCommissionFrom": "",

       "isfreeShipping": "No",

       "shippingPayableToBusiness": "No",

       "codAvailable": "",

       "allowRefund": "No",

       "collectPaymentWhen": "",

       "generateCertificateWhen": "order_complete",

       "productServiceFee": 0,

       "useCertCollection": "Yes",

       "productVisibleTo": 0,

       "productShowNosBought": "",

       "productShowProductTipped": "",

       "productShowVideo": "No",

       "productOnlineRedemption": "",

       "productImage": "canvashd.png",

       "productRedemptionType": "Business",

       "productVideo": "",

       "productPriority": 100,

       "productStatus": "Active",

       "InventoryTrackLevel": "No",

       "productQuantityNotifyAt": 10,

       "outofStockStatus": "",

       "productCreatedDate": "2013-07-09 16:20:18",

       "productUpdatedDate": "2013-07-22 17:49:56",

       "productTippedDate": null,

       "shippingStatus": "Free",

       "showCountTimer": "Yes",

       "featuredStatus": "Yes",

       "productDefaultCurrency": 1,

       "productUrl": "micromax-a116-canvas-hd",

       "shippingSetting": "biz",

       "productAddedBy": 0,

       "shippingOrigin": 0,

       "showQuantityAvailable": "",

       "productSoldQuantity": 0,

       "popularity": 0,

       "purchasePopularity": 0,

       "productOptions": [

           {

               "productOptionID": 2,

               "productID": 2,

               "optionSKU": "",

               "optionBarCode": "",

               "productOptionRegularPrice": 17499,

               "productOptionProductPrice": 13200,

               "productOptionShowVideo": "No",

               "productPrepayAmount": 0,

               "productOptionQuantity": 41,

               "productQuantityNotifyAt": "",

               "packageWeight": 0,

               "packageLength": 0,

               "packageWidth": 0,

               "packageHeight": 0,

               "productQuantityUnlimited": 0,

               "soldQuantity": 0,

               "productOptionStatus": "Active",

               "OptionDefaultImage": "",

               "productOptionDefault": "Yes",

                               "optionImage":[

                                       {

                                               "productMediaID": 152,

                                               "productID": 2,

                                               "productObjectID": 2,

                                               "productObjectType": "DO",

                                               "productMedia": "canvashd_2_1_15.png",

                                               "productMediaType": "I",

                                               "productMediaPriority": 1,

                                               "productMediaStatus": null

                                       },

                                       {

                                               "productMediaID": 153,

                                               "productID": 2,

                                               "productObjectID": 2,

                                               "productObjectType": "DO",

                                               "productMedia": "canvashd_2_1_151.jpeg",

                                               "productMediaType": "I",

                                               "productMediaPriority": 1,

                                               "productMediaStatus": null

                                       }

                               ]

           }

       ],

       "attribute": [

           {

               "attrValueID": 110,

               "productID": 2,

               "attributeID": 2,

               "attrOptionID": 0,

               "attrValDetID": 90,

               "languageID": 1,

               "attrDetValue": "A116 Canvas HD"

           },

           {

               "attrValueID": 122,

               "productID": 2,

               "attributeID": 23,

               "attrOptionID": 0,

               "attrValDetID": 100,

               "languageID": 1,

               "attrDetValue": "NA"

           },

           {

               "attrValueID": 123,

               "productID": 2,

               "attributeID": 25,

               "attrOptionID": 0,

               "attrValDetID": 101,

               "languageID": 1,

               "attrDetValue": "1.2 GHz, Quad Core"

           },

           {

               "attrValueID": 124,

               "productID": 2,

               "attributeID": 26,

               "attrOptionID": 0,

               "attrValDetID": 102,

               "languageID": 1,

               "attrDetValue": "5 Inches"

           },

           {

               "attrValueID": 132,

               "productID": 2,

               "attributeID": 34,

               "attrOptionID": 0,

               "attrValDetID": 110,

               "languageID": 1,

               "attrDetValue": "HD"

           }

       ],

               

   }

]


Create Products


HTTP Method: POST /product

Description: Allows you to create a new simple product.

Authentication: Admin
Default Format: JSON
Parameters

Name

Type

productID

int

productTypeID

smallint

businessID

int

isTaxable

enum('Yes', 'No')

taxClassID

int

taxPayableToBusiness

enum('Yes', 'No')

taxRate

decimal(15,5)

productKey

varchar

attributeSetID

int

measurementLength

tinyint

measurementWeight

tinyint

productTimeZone

tinyint

productStartTime

date

productEndTime

date

productMinBuyLimit

tinyint

productMaxGiftBuy

int

productMaxBuyLimit

int

productMinQntyReqToTipp

tinyint

productExpiryDate

datetime

productCommissionRate

float

productUseGlobalCommision

enum('Yes', 'No')

productCommissionType

enum('$', '%')

multiOptionsAvailable

enum('Yes', 'No')        

enablePrepay

enum('Yes', 'No')

applyCommissionFrom

enum('prepay_amt', 'product_price')

isfreeShipping

enum('Yes', 'No')

shippingPayableToBusiness

enum('Yes', 'No')        

codAvailable

enum('Yes', 'No')

allowRefund

enum('Yes', 'No')

collectPaymentWhen

enum('Order_Placed','Product_Completed','Product_Tipped')

generateCertificateWhen

enum('order_complete','product_complete','product_tipped')

productServiceFee

float

useCertCollection

enum('Yes', 'No')

productVisibleTo

varchar

productShowNosBought

enum('Yes', 'No')

productShowProductTipped

enum('Yes', 'No')

productShowVideo

enum('Yes', 'No')

productOnlineRedemption

enum('Yes', 'No', 'Home')

productImage

varchar

productRedemptionType

enum('Business', 'Online', 'Home')

productVideo

text

productPriority

int

productStatus

enum('Active', 'Inactive', 'Cancelled', 'Deleted')

InventoryTrackLevel

enum('Product', 'Options', 'No')

productQuantityNotifyAt

int

outofStockStatus

enum('list_soldout', 'dont_list')

productCreatedDate

datetime

productUpdatedDate

timestamp

productTippedDate

datetime

shippingStatus

enum('No', 'Free', 'Yes')

showCountTimer

enum('Yes', 'No')

featuredStatus

enum('Yes', 'No')

productDefaultCurrency

smallint

productUrl

varchar

shippingSetting

enum('admin', 'biz')

productAddedBy

enum('0', '1')

shippingOrigin

int

showQuantityAvailable

varchar

productSoldQuantity

int

popularity

int

purchasePopularity

int

Array of Products options is as follows:


Name

Type

productOptionID

int

productID

int

optionSKU

varchar

optionBarCode

varchar

productOptionRegularPrice

decimal

productOptionProductPrice

decimal

productOptionShowVideo

enum('No', 'Yes')

productPrepayAmount

decimal

productOptionQuantity

int

productQuantityNotifyAt

varchar

packageWeight

decimal

packageLength

decimal

packageWidth

decimal

packageHeight

decimal

productQuantityUnlimited

varchar

soldQuantity

mediumint

productOptionStatus

enum('Active', 'Inactive', 'Delete')

OptionDefaultImage

varchar

productOptionDefault

enum('No', 'Yes')

       


Name

Type

customOptionID

int

isGlobal

int

inputType

char

validateRule

char

priceDiff

decimal

priceDiffType

enum('N', 'I', 'D', 'O')

status

enum('A', 'I', 'D')

customOptionName

varchar(255)

validationMessage

text

helpText

text



Name

Type

customOptionID

int

p class="rvps6">priceDiff

decimal

priceDiffType

enum('N', 'I', 'D', 'O')

weightDiff

decimal(10,4)                

weightDiffType

enum('N', 'I', 'D', 'O')        

status

enum('A', 'I', 'D')

value

varchar(255)        



POST http://projecthost/api/rest/product

Request Example: JSON


[

   {

       "productTypeID": 1,

       "businessID": 2,

       "isTaxable": "No",

       "taxClassID": 0,

       "taxPayableToBusiness": "No",

       "taxRate": 0,

       "productKey": "canvashd",

       "attributeSetID": 2,

       "measurementLength": 1,

       "measurementWeight": 5,

       "productTimeZone": 42,

       "productStartTime": "2013-07-08",

       "productEndTime": "2013-07-31",

       "productMinBuyLimit": 1,

       "productMaxGiftBuy": null,

       "productMaxBuyLimit": 4,

       "productMinQntyReqToTipp": 0,

       "productExpiryDate": "0000-00-00 00:00:00",

       "productCommissionRate": 0,

       "productUseGlobalCommision": "",

       "productCommissionType": "",

       "multiOptionsAvailable": "No",

       "enablePrepay": "No",

       "applyCommissionFrom": "",

       "isfreeShipping": "No",

       "shippingPayableToBusiness": "No",

       "codAvailable": "",

       "allowRefund": "No",

       "collectPaymentWhen": "",

       "generateCertificateWhen": "order_complete",

       "productServiceFee": 0,

       "useCertCollection": "Yes",

       "productVisibleTo": 0,

       "productShowNosBought": "",

       "productShowProductTipped": "",

       "productShowVideo": "No",

       "productOnlineRedemption": "",

       "productImage": "canvashd.png",

       "productRedemptionType": "Business",

       "productVideo": "",

       "productPriority": 100,

       "productStatus": "Active",

       "InventoryTrackLevel": "No",

       "productQuantityNotifyAt": 10,

       "outofStockStatus": "",

       "productCreatedDate": "2013-07-09 16:20:18",

       "productUpdatedDate": "2013-07-22 17:49:56",

       "productTippedDate": null,

       "shippingStatus": "Free",

       "showCountTimer": "Yes",

       "featuredStatus": "Yes",

       "productDefaultCurrency": 1,

       "productUrl": "micromax-a116-canvas-hd",

       "shippingSetting": "biz",

       "productAddedBy": 0,

       "shippingOrigin": 0,

       "showQuantityAvailable": "",

       "productSoldQuantity": 0,

       "popularity": 0,

       "purchasePopularity": 0,

       "productOptions": [

           {

               "optionSKU": "",

               "optionBarCode": "",

               "productOptionRegularPrice": 17499,

               "productOptionProductPrice": 13200,

               "productOptionShowVideo": "No",

               "productPrepayAmount": 0,

               "productOptionQuantity": 41,

               "productQuantityNotifyAt": "",

               "packageWeight": 0,

               "packageLength": 0,

               "packageWidth": 0,

               "packageHeight": 0,

               "productQuantityUnlimited": 0,

               "soldQuantity": 0,

               "productOptionStatus": "Active",

               "OptionDefaultImage": "",

               "productOptionDefault": "Yes",

                               "optionImage":[

                                       {

                                               "productObjectType": "DO",

                                               "productMedia": "canvashd_2_1_15.png",

                                               "productMediaType": "I",

                                               "productMediaPriority": 1,

                                               "productMediaStatus": null,

                                               "fileMimeType":"image/jpg",

                                               "fileContent":"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/+Ai0T4BWVd1EIL5PgeO+APECmoXgaGtm1IE0AgABBgAJAICuV8dAUAAAAABJRU5ErkJggg=="

                                       },

                                       {

                                               "productObjectType": "DO",

                                               "productMedia": "canvashd_2_1_151.jpeg",

                                               "productMediaType": "I",

                                               "productMediaPriority": 1,

                                               "productMediaStatus": null,

                                               "fileMimeType":"image/jpg",

                                               "fileContent":"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/+Ai0T4BWVd1EIL5PgeO+APECmoXgaGtm1IE0AgABBgAJAICuV8dAUAAAAABJRU5ErkJggg=="

                                       }

                               ]

           }

       ],

       "attribute": [

           {

               "attrValueID": 110,

               "attributeID": 2,

               "attrOptionID": 0,

               "attrValDetID": 90,

               "languageID": 1,

               "attrDetValue": "A116 Canvas HD"

           },

           {

               "attrValueID": 122,

               "attributeID": 23,

               "attrOptionID": 0,

               "attrValDetID": 100,

               "languageID": 1,

               "attrDetValue": "NA"

           },

           {

               "attrValueID": 123,

               "attributeID": 25,

               "attrOptionID": 0,

               "attrValDetID": 101,

               "languageID": 1,

               "attrDetValue": "1.2 GHz, Quad Core"

           },

           {

               "attrValueID": 124,

               "attributeID": 26,

               "attrOptionID": 0,

               "attrValDetID": 102,

               "languageID": 1,

               "attrDetValue": "5 Inches"

           },

           {

               "attrValueID": 132,

               "attributeID": 34,

               "attrOptionID": 0,

               "attrValDetID": 110,

               "languageID": 1,

               "attrDetValue": "HD"

           }

       ],

               

   }

]



URI: /product/:id

Allows you to retrieve, update, and delete a specified product in oorjit.

URL Structurehttp://projecthost/api/rest/product/:id
Version: 1

Modify Products


HTTP Method: PUT /product

Description: Allows you to update the product(with product sku).

Authentication: Admin
Default Format: JSON

HTTP Method: GET /product/:id

Description: Allows you to retrieve information on a required simple product.
Notes: The list of attributes that will be returned in the response is configured in the oorjit Admin Panel. The list of attributes differs for each type of user.

Authentication: Admin
Default Format: JSON
Parameters:
No Parameters

Response Example: JSON


[    {

       "productID": 2,

       "productTypeID": 1,

       "businessID": 2,

       "isTaxable": "No",

       "taxClassID": 0,

       "taxPayableToBusiness": "No",

       "taxRate": 0,

       "productKey": "canvashd",

       "attributeSetID": 2,

       "measurementLength": 1,

       "measurementWeight": 5,

       "productTimeZone": 42,

       "productStartTime": "2013-07-08",

       "productEndTime": "2013-07-31",

       "productMinBuyLimit": 1,

       "productMaxGiftBuy": null,

       "productMaxBuyLimit": 4,

       "productMinQntyReqToTipp": 0,

       "productExpiryDate": "0000-00-00 00:00:00",

       "productCommissionRate": 0,

       "productUseGlobalCommision": "",

       "productCommissionType": "",

       "multiOptionsAvailable": "No",

       "enablePrepay": "No",

       "applyCommissionFrom": "",

       "isfreeShipping": "No",

       "shippingPayableToBusiness": "No",

       "codAvailable": "",

       "allowRefund": "No",

       "collectPaymentWhen": "",

       "generateCertificateWhen": "order_complete",

       "productServiceFee": 0,

       "useCertCollection": "Yes",

       "productVisibleTo": 0,

       "productShowNosBought": "",

       "productShowProductTipped": "",

       "productShowVideo": "No",

       "productOnlineRedemption": "",

       "productImage": "canvashd.png",

       "productRedemptionType": "Business",

       "productVideo": "",

       "productPriority": 100,

       "productStatus": "Active",

       "InventoryTrackLevel": "No",

       "productQuantityNotifyAt": 10,

       "outofStockStatus": "",

       "productCreatedDate": "2013-07-09 16:20:18",

       "productUpdatedDate": "2013-07-22 17:49:56",

       "productTippedDate": null,

       "shippingStatus": "Free",

       "showCountTimer": "Yes",

       "featuredStatus": "Yes",

       "productDefaultCurrency": 1,

       "productUrl": "micromax-a116-canvas-hd",

       "shippingSetting": "biz",

       "productAddedBy": 0,

       "shippingOrigin": 0,

       "showQuantityAvailable": "",

       "productSoldQuantity": 0,

       "popularity": 0,

       "purchasePopularity": 0,

       "productOptions": [

           {

               "productOptionID": 2,

               "productID": 2,

               "optionSKU": "",

               "optionBarCode": "",

               "productOptionRegularPrice": 17499,

               "productOptionProductPrice": 13200,

               "productOptionShowVideo": "No",

               "productPrepayAmount": 0,

               "productOptionQuantity": 41,

               "productQuantityNotifyAt": "",

               "packageWeight": 0,

               "packageLength": 0,

               "packageWidth": 0,

               "packageHeight": 0,

               "productQuantityUnlimited": 0,

               "soldQuantity": 0,

               "productOptionStatus": "Active",

               "OptionDefaultImage": "",

               "productOptionDefault": "Yes",

                               "optionImage":[

                                       {

                                               "productMediaID": 152,

                                               "productID": 2,

                                               "productObjectID": 2,

                                               "productObjectType": "DO",

                                               "productMedia": "canvashd_2_1_15.png",

                                               "productMediaType": "I",

                                               "productMediaPriority": 1,

                                               "productMediaStatus": null

                                       },

                                       {

                                               "productMediaID": 153,

                                               "productID": 2,

                                               "productObjectID": 2,

                                               "productObjectType": "DO",

                                               "productMedia": "canvashd_2_1_151.jpeg",

                                               "productMediaType": "I",

                                               "productMediaPriority": 1,

                                               "productMediaStatus": null

                                       }

                               ]

           }

       ],

       "attribute": [

           {

               "attrValueID": 110,

               "productID": 2,

               "attributeID": 2,

               "attrOptionID": 0,

               "attrValDetID": 90,

               "languageID": 1,

               "attrDetValue": "A116 Canvas HD"

           },

           {

               "attrValueID": 122,

               "productID": 2,

               "attributeID": 23,

               "attrOptionID": 0,

               "attrValDetID": 100,

               "languageID": 1,

               "attrDetValue": "NA"

           }

       ]

   }

]


Product - Options

Retrieve Products Options

REST API: Product Options

URI: /product/id:id/options

Allows you to retrieve the list of all products options with detailed information.

URL Structurehttp://projecthost/api/rest/product/id/:id/child/options
Version: 1

HTTP Method: GET /product/id/:id/child/options

Description: Allows you to retrieve the list of all products options with detailed information.
Notes: The list of attributes that will be returned in the response is configured in the oorjit Admin Panel. The list of attributes differs for each type of user.

Authentication: Admin
Default Format: JSON
Parameters:
No Parameters

Response Example: JSON (List of Product Options)


[

   {

       "productOptionID": 334,

       "productID": 3,

       "optionSKU": 3571,

       "optionBarCode": 7,

       "productOptionRegularPrice": 1,

       "productOptionProductPrice": 0.5,

       "productOptionShowVideo": "No",

       "productPrepayAmount": 0,

       "productOptionQuantity": 0,

       "productQuantityNotifyAt": "",

       "packageWeight": 10,

       "packageLength": 13,

       "packageWidth": 11,

       "packageHeight": 12,

       "productQuantityUnlimited": 0,

       "soldQuantity": 19,

       "productOptionStatus": "Active",

       "OptionDefaultImage": "",

       "productOptionDefault": ""

   },

   {

       "productOptionID": 335,

       "productID": 3,

       "optionSKU": 1591,

       "optionBarCode": 16,

       "productOptionRegularPrice": 11,

       "productOptionProductPrice": 0.5,

       "productOptionShowVideo": "No",

       "productPrepayAmount": 0,

       "productOptionQuantity": 0,

       "productQuantityNotifyAt": "",

       "packageWeight": 19,

       "packageLength": 22,

       "packageWidth": 20,

       "packageHeight": 21,

       "productQuantityUnlimited": 0,

       "soldQuantity": 31,

       "productOptionStatus": "Active",

       "OptionDefaultImage": "",

       "productOptionDefault": "Yes"

   }

]



Create Products Options

HTTP Method: POST /product/child/options

Description: Allows you to create a new option

Authentication: Admin
Default Format: JSON
Parameters

Name

Type

productOptionID

int

productID

int

optionSKU

varchar

optionBarCode

varchar

productOptionRegularPrice

decimal

productOptionProductPrice

decimal

productOptionShowVideo

enum('No', 'Yes')

productPrepayAmount

decimal

productOptionQuantity

int

productQuantityNotifyAt

varchar

packageWeight

decimal

packageLength

decimal

packageWidth

decimal

packageHeight

decimal

productQuantityUnlimited

varchar

soldQuantity

mediumint

productOptionStatus

enum('Active', 'Inactive', 'Delete')

OptionDefaultImage

varchar

productOptionDefault

enum('No', 'Yes')



POST http://projecthost/api/rest/product/child/options

Request Example: JSON


[

   {

       "productID": 327,

       "optionSKU": 3571,

       "optionBarCode": 7,

       "productOptionRegularPrice": 1,

       "productOptionProductPrice": 0.5,

       "productOptionShowVideo": "No",

       "productPrepayAmount": 0,

       "productOptionQuantity": 0,

       "productQuantityNotifyAt": "",

       "packageWeight": 10,

       "packageLength": 13,

       "packageWidth": 11,

       "packageHeight": 12,

       "productQuantityUnlimited": 0,

       "soldQuantity": 19,

       "productOptionStatus": "Active",

       "OptionDefaultImage": "",

       "productOptionDefault": ""

   },

   {

       "productID": 327,

       "optionSKU": 1591,

       "optionBarCode": 16,

       "productOptionRegularPrice": 11,

       "productOptionProductPrice": 0.5,

       "productOptionShowVideo": "No",

       "productPrepayAmount": 0,

       "productOptionQuantity": 0,

       "productQuantityNotifyAt": "",

       "packageWeight": 19,

       "packageLength": 22,

       "packageWidth": 20,

       "packageHeight": 21,

       "productQuantityUnlimited": 0,

       "soldQuantity": 31,

       "productOptionStatus": "Active",

       "OptionDefaultImage": "",

       "productOptionDefault": "Yes"

   }

]


Modify Products Options

HTTP Method: PUT /product/child/optionsupdate/

Description: Allows you to update product option

Authentication: Admin
Default Format: JSON
Parameters


POST http://projecthost/api/rest/json/product/child/optionsupdate/

Request Example: JSON


[

   {

       "productOptionID": 10,

       "productOptionQuantity": 985

   }

]



Product - CustomOptions

Retrieve Products CustomOptions

REST API: Product Custom Options

URI: /product/id:id/child/customoptions

Allows you to retrieve the list of all products custom options with detailed information.

URL Structurehttp://projecthost/api/rest/product/id:id/customoptions
Version: 1

HTTP Method: GET /product/id:id/child/customoptions

Description: Allows you to retrieve the list of all products custom options with detailed information.
Notes: The list of attributes that will be returned in the response is configured in the oorjit Admin Panel. The list of custom options differs for each type of user.

Authentication: Admin
Default Format: JSON
Parameters:
No Parameters

Response Example: JSON


 [

   {

       "customOptionName": "Looksa",

       "validationMessage": "Required",

       "inputType": "textbox",

       "validateRule": "required",

       "priceDiff": "10.00000",

       "priceDiffType": "D",

       "helpText": "Help Text",

       "isGlobal": "0",

       "status": "A",

       "variants": [

           {

               "value": "Red",

               "priceDiff": "3",

               "priceDiffType": "N",

               "weightDiff": "0.0000",

               "status": "A",

               "weightDiffType": "N"

           },

           {

               "value": "Blue",

               "priceDiff": "3",

               "priceDiffType": "N",

               "weightDiff": "0.0000",

               "status": "A",

               "weightDiffType": "N"

           },

           {

               "value": "Black",

               "priceDiff": "3",

               "priceDiffType": "N",

               "weightDiff": "0.0000",

               "status": "A",

               "weightDiffType": "N"

           },

           {

               "value": "White",

               "priceDiff": "3",

               "priceDiffType": "N",

               "weightDiff": "0.0000",

               "status": "A",

               "weightDiffType": "N"

           }

       ]

   },

   {

       "customOptionName": "Time",

       "validationMessage": "Required",

       "inputType": "textbox",

       "validateRule": "required",

       "priceDiff": "10.00000",

       "priceDiffType": "D",

       "helpText": "Help Text",

       "isGlobal": "0",

       "status": "A"

   },

   {

       "customOptionName": "Shape",

       "validationMessage": "Required",

       "inputType": "textbox",

       "validateRule": "required",

       "priceDiff": "12.00000",

       "priceDiffType": "I",

       "helpText": "Help Text",

       "isGlobal": "0",

       "status": "A"

   },

   {

       "customOptionName": "color",

       "validationMessage": "Required",

       "inputType": "select",

       "validateRule": "required",

       "priceDiff": "13.00000",

       "priceDiffType": "D",

       "helpText": "Help Text",

       "isGlobal": "0",

       "status": "A"

   }

]



Create Products CustomOptions

HTTP Method: POST /product/child/customoptions

Description: Allows you to create a new simple custom options.

Authentication: Admin
Default Format: JSON
Parameters


Name

Type

customOptionID

int

isGlobal

int

inputType

char

validateRule

char

priceDiff

decimal

priceDiffType

enum('N', 'I', 'D', 'O')

status

enum('A', 'I', 'D')

customOptionName

varchar(255)

validationMessage

text

helpText

text



Name

Type

customOptionID

int

priceDiff

decimal

priceDiffType

enum('N', 'I', 'D', 'O')

weightDiff

decimal(10,4)                

weightDiffType

enum('N', 'I', 'D', 'O')        

status

enum('A', 'I', 'D')

value

varchar(255)        


POST http://projecthost/api/rest/product/child/customoptions

Request Example: JSON


 [

   {

       "customOptionName": "Looksa",

       "validationMessage": "Required",

       "inputType": "textbox",

       "validateRule": "required",

       "priceDiff": "10.00000",

       "priceDiffType": "D",

       "helpText": "Help Text",

       "isGlobal": "0",

       "status": "A",

       "variants": [

           {

               "value": "Red",

               "priceDiff": "3",

               "priceDiffType": "N",

               "weightDiff": "0.0000",

               "status": "A",

               "weightDiffType": "N"

           },

           {

               "value": "Blue",

               "priceDiff": "3",

               "priceDiffType": "N",

               "weightDiff": "0.0000",

               "status": "A",

               "weightDiffType": "N"

           },

           {

               "value": "Black",

               "priceDiff": "3",

               "priceDiffType": "N",

               "weightDiff": "0.0000",

               "status": "A",

               "weightDiffType": "N"

           },

           {

               "value": "White",

               "priceDiff": "3",

               "priceDiffType": "N",

               "weightDiff": "0.0000",

               "status": "A",

               "weightDiffType": "N"

           }

       ]

   },

   {

       "customOptionName": "Time",

       "validationMessage": "Required",

       "inputType": "textbox",

       "validateRule": "required",

       "priceDiff": "10.00000",

       "priceDiffType": "D",

       "helpText": "Help Text",

       "isGlobal": "0",

       "status": "A"

   },

   {

       "customOptionName": "Shape",

       "validationMessage": "Required",

       "inputType": "textbox",

       "validateRule": "required",

       "priceDiff": "12.00000",

       "priceDiffType": "I",

       "helpText": "Help Text",

       "isGlobal": "0",

       "status": "A"

   },

   {

       "customOptionName": "color",

       "validationMessage": "Required",

       "inputType": "select",

       "validateRule": "required",

       "priceDiff": "13.00000",

       "priceDiffType": "D",

       "helpText": "Help Text",

       "isGlobal": "0",

       "status": "A"

   }

]




Modify Products CustomOptions

HTTP Method: PUT /product/child/customoptions

Description: Allows you to edit a product custom option

Authentication: Admin
Default Format: JSON
Parameters

Product - Combination

Retrieve Products Combination

REST API: Product Combination

URI: /product/:product_id/child/combination

Allows you to manage combination of the required product.

URL Structurehttp://projecthost/api/rest/product/:product_id/child/combination
Version: 1

HTTP Method: GET

Description: Allows you to retrieve information about all combination of a specified product.

Default Format: JSON
Parameters:
No Parameters

Example:

Response Body:


[

   {

       "productID": "416",

       "productOptionID": "1",

       "optionSKU": "required",

       "combinationSKU": "white_Sp",

       "combination": [

           "1",

           "2"

       ],

       "combinationQty": "",

       "combinationPrice": "0.00000",

       "combinationPriceDiffType": "N"

   },

   {

       "productID": "416",

       "productOptionID": "1",

       "optionSKU": "required",

       "combinationSKU": "Red_Sp",

       "combination": [

           "3",

           "4"

       ],

       "combinationQty": "",

       "combinationPrice": "20.00000",

       "combinationPriceDiffType": "O"

   }

]



Create Products Combination

HTTP Method: POST

Description: Allows you to crate new combination

Authentication: Admin
Default Format: JSON
Parameters:

Name

Type

combinationID

int

productID

int

productOptionID

int

combination

char

optionSKU

char

combinationSKU

char

combinationQty

char

combinationPrice

decimal

combinationPriceDiffType

enum('N', 'I', 'D', 'O')


Example:

Request Body:

[

   {

       "productID": "416",

       "productOptionID": "1",

       "optionSKU": "required",

       "combinationSKU": "white_Sp",

       "combination": [

           "1",

           "2"

       ],

       "combinationQty": "",

       "combinationPrice": "0.00000",

       "combinationPriceDiffType": "N"

   },

   {

       "productID": "416",

       "productOptionID": "1",

       "optionSKU": "required",

       "combinationSKU": "Red_Sp",

       "combination": [

           "3",

           "4"

       ],

       "combinationQty": "",

       "combinationPrice": "20.00000",

       "combinationPriceDiffType": "O"

   }

]


HTTP Method: PUT

Description: Allows you to update information for the specified product combination.

Authentication: Admin
Default Format: JSON
Parameters:


Example:

Request Body:

[

   {

       "combinationID": "416",

       "combinationQty": "10"

       "combinationPrice": "155"

       "combinationPriceDiffType": "N"

   }

]


Orders

Retrieve Orders

REST API: Orders

URI: /order/

Allows you to retrieve the Orders details.

URL Structurehttp://projecthost/api/rest/order/
Version: 1

HTTP Method: GET /order/

Description: Allows you to retrieve the Orders list (details).

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON


[

   {

       "masterOrderID": 1,

       "orderNumber": 1,

       "orderType": "product",

       "productType": "Product",

       "orderTotalAmount": 30198,

       "convertedMasterOrderTotal": 30198,

       "orderSubtotal": 30198,

       "convertedMasterOrderSubtotal": 30198,

       "orderQty": 2,

       "promoID": 0,

       "orderPromoCode": "",

       "orderPromoDiscountAmount": 0,

       "convertedOrderPromoDiscountAmount": 0,

       "orderUserCreditAmount": 0,

       "convertedOrderUserCreditAmount": 0,

       "paymentSettingsGroupID": 4,

       "orderPaymentMethodName": "Free_Checkout",

       "paymentType": "AUTH_CAPTURE",

       "languageID": 1,

       "purchasedCurrency": 1,

       "billingAddress": {

           "billingFirstName": "Anfas",

           "billingLastName": "Ansary",

           "billingAddress1": "Address 1",

           "billingAddress2": "",

           "billingCity": "Cochin",

           "billingProvince": "",

           "billingZip": "682024",

           "billingState": "1490",

           "billingCountry": "99",

           "billingPhone": "",

           "billingEmail": "[email protected]"

       },

       "shippingAddress": {

           "shippingFname": "Anfas",

           "shippingLname": "Ansary",

           "shippingAddress1": "Address 1",

           "shippingAddress2": "",

           "shippingCity": "Cochin",

           "shippingProvince": "",

           "shippingZip": "682024",

           "shippingStateID": "1490",

           "shippingCountryID": "99"

       },

       "netpayOrderID": 0,

       "netpayPaymentType": "",

       "orderHold": "No",

       "transactionID": 0,

       "paymentStatus": "Received",

       "orderStatus": "Completed",

       "paymentNotes": "",

       "userID": 1,

       "cityID": 0,

       "orderCreatedDate": "2013-07-09 16:03:55",

       "orderStatusDate": "2013-08-06 12:48:07",

       "orderTaxAmount": 0,

       "orderCommissionAmount": 603.96,

       "orderPaymentGatewayCharge": 0,

       "orderOtherServiceCharge": 0,

       "orderRemoved": "No",

       "shippingAmount": 0,

       "shippingSetting": "business",

       "businessID": 2,

       "businessPayment": 29594.04,

       "convertedBusinessPayment": 29594.04,

       "extraData": {

           "amountDetails": {

               "admin": {

                   "subTotal": 30198,

                   "serviceCharge": 0,

                   "commission": 603.96,

                   "ccCharge": 0,

                   "tax": 0,

                   "shippingAmount": 0,

                   "businessPayment": 29594.04,

                   "orderTotalAmount": 30198

               }

           }

       },

       "orderCharityID": 0,

       "orderCharityAmount": 0,

       "taxSetting": "admin",

       "orderItems": [

           {

               "orderItemID": 1,

               "masterOrderID": 1,

               "productID": 1,

               "productOptionID": 1,

               "orderItemPrice": 15099,

               "orderItemQuantity": 2,

               "orderItemSubtotal": 30198,

               "orderGiveAsGift": "No",

               "productOptionName": "Samsung Galaxy Tab 2 P3100 White",

               "addedTime": "2013-07-09 16:03:56",

               "extra": {

                   "productOptionName": "Samsung Galaxy Tab 2 P3100 White",

                   "imagePath": "tab2.jpg",

                   "orderCommissionAmount": "603.96",

                   "orderOtherServiceCharge": "0.00",

                   "promoCode": null,

                   "orderItemQuantity": "2",

                   "orderItemSubtotal": "30198.00",

                   "orderItemTotal": 30198,

                   "unitPrice": "15099.00",

                   "productCommissionRate": "2.00",

                   "businessKey": "",

                   "productImage": "tab2.jpg",

                   "productDefaultCurrency": "1",

                   "orderTaxAmount": 0,

                   "shippingAmount": 0,

                   "productURL": "product/tab2/1/",

                   "combinationValues": null,

                   "customOptionValues": null,

                   "combinationHash": "",

                   "orderPromoDiscountAmount": 0,

                   "isTaxable": "No",

                   "orderItemTaxRate": 0,

                   "orderItemTaxDescription": "",

                   "shippingMethod": {

                       "methodName": "Free (3-5 Days)",

                       "methodID": "73",

                       "settingsGroupKey": "free_custom1",

                       "settingsGroupParent": "1",

                       "shippingCharge": 0,

                       "shippingtype": "Free"

                   },

                   "businessPayment": 29594.04,

                   "productOptionCertTitle": null,

                   "orderPaymentGatewayCharge": 0,

                   "amountDetails": {

                       "admin": {

                           "subTotal": "30198.00000",

                           "serviceCharge": "0.00",

                           "commission": "603.96",

                           "ccCharge": 0,

                           "tax": 0,

                           "shippingAmount": 0,

                           "businessPayment": 29594.04,

                           "totalAmount": 30198

                       }

                   },

                   "itemDetails": {

                       "admin": {

                           "productOptionName": "Samsung Galaxy Tab 2 P3100 White"

                       },

                       "user": {

                           "productOptionName": "Samsung Galaxy Tab 2 P3100 White"

                       }

                   }

               },

               "shipmentStatus": "Delivered",

               "shipmentDate": "2013-07-10 11:26:14",

               "carrierDetails": "",

               "shippingMethod": "Free (3-5 Days)",

               "combinationHash": 0,

               "redeemSlotID": 0,

               "shipping_history": [

                   {

                       "shippingID": 1,

                       "activityDate": "2013-07-10 11:25:52",

                       "comment": "",

                       "notifyCustomer": "No",

                       "orderID": 1,

                       "orderItemID": 1,

                       "shippingStatus": "Dispatched",

                       "trackingNumber": "",

                       "carrier": ""

                   },

                   {

                       "shippingID": 2,

                       "activityDate": "2013-07-10 11:26:14",

                       "comment": "",

                       "notifyCustomer": "No",

                       "orderID": 1,

                       "orderItemID": 1,

                       "shippingStatus": "Delivered",

                       "trackingNumber": "",

                       "carrier": ""

                   }

               ]

           }

       ]

   },

   {

       "masterOrderID": 2,

       "orderNumber": 2,

       "orderType": "product",

       "productType": "Product",

       "orderTotalAmount": 33945,

       "convertedMasterOrderTotal": 33945,

       "orderSubtotal": 33945,

       "convertedMasterOrderSubtotal": 33945,

       "orderQty": 1,

       "promoID": 0,

       "orderPromoCode": "",

       "orderPromoDiscountAmount": 0,

       "convertedOrderPromoDiscountAmount": 0,

       "orderUserCreditAmount": 0,

       "convertedOrderUserCreditAmount": 0,

       "paymentSettingsGroupID": 4,

       "orderPaymentMethodName": "Free_Checkout",

       "paymentType": "AUTH_CAPTURE",

       "languageID": 1,

       "purchasedCurrency": 1,

       "billingAddress": {

           "billingFirstName": "Anfas",

           "billingLastName": "Ansary",

           "billingAddress1": "Address 1",

           "billingAddress2": "",

           "billingCity": "Cochin",

           "billingProvince": "",

           "billingZip": "682024",

           "billingState": "1490",

           "billingCountry": "99",

           "billingPhone": "",

           "billingEmail": "[email protected]"

       },

       "shippingAddress": {

           "shippingFname": "Anfas",

           "shippingLname": "Ansary",

           "shippingAddress1": "Address 1",

           "shippingAddress2": "",

           "shippingCity": "Cochin",

           "shippingProvince": "",

           "shippingZip": "682024",

           "shippingStateID": "1490",

           "shippingCountryID": "99"

       },

       "netpayOrderID": 0,

       "netpayPaymentType": "",

       "orderHold": "No",

       "transactionID": 0,

       "paymentStatus": "Received",

       "orderStatus": "Process",

       "paymentNotes": "",

       "userID": 1,

       "cityID": 0,

       "orderCreatedDate": "2013-07-10 11:17:38",

       "orderStatusDate": "2013-07-10 11:17:38",

       "orderTaxAmount": 0,

       "orderCommissionAmount": 0,

       "orderPaymentGatewayCharge": 0,

       "orderOtherServiceCharge": 0,

       "orderRemoved": "No",

       "shippingAmount": 0,

       "shippingSetting": "business",

       "businessID": 2,

       "businessPayment": 33945,

       "convertedBusinessPayment": 33945,

       "extraData": {

           "amountDetails": {

               "admin": {

                   "subTotal": 33945,

                   "serviceCharge": 0,

                   "commission": 0,

                   "ccCharge": 0,

                   "tax": 0,

                   "shippingAmount": 0,

                   "businessPayment": 33945,

                   "orderTotalAmount": 33945

               }

           }

       },

       "orderCharityID": 0,

       "orderCharityAmount": 0,

       "taxSetting": "admin",

       "orderItems": [

           {

               "orderItemID": 2,

               "masterOrderID": 2,

               "productID": 10,

               "productOptionID": 10,

               "orderItemPrice": 33945,

               "orderItemQuantity": 1,

               "orderItemSubtotal": 33945,

               "orderGiveAsGift": "No",

               "productOptionName": "Canon EOS 600D SLR",

               "addedTime": "2013-07-10 11:17:38",

               "extra": {

                   "productOptionName": "Canon EOS 600D SLR",

                   "imagePath": "canon-eos-600d-slr.jpeg",

                   "orderCommissionAmount": "0.00000",

                   "orderOtherServiceCharge": "0.00000",

                   "promoCode": null,

                   "orderPromoDiscountAmount": 0,

                   "orderItemQuantity": "1",

                   "orderItemSubtotal": "33945.00000",

                   "orderItemTotal": 33945,

                   "unitPrice": "33945.00000",

                   "productCommissionRate": "0.00000",

                   "businessKey": "",

                   "productImage": "canon-eos-600d-slr.jpeg",

                   "productDefaultCurrency": "1",

                   "orderTaxAmount": 0,

                   "shippingAmount": 0,

                   "productURL": "product/canon-eos-600d-slr/10/",

                   "combinationValues": null,

                   "customOptionValues": null,

                   "combinationHash": "",

                   "isTaxable": "No",

                   "orderItemTaxRate": 0,

                   "orderItemTaxDescription": "",

                   "shippingMethod": {

                       "methodName": "Free (3-5 Days)",

                       "methodID": "73",

                       "settingsGroupKey": "free_custom1",

                       "settingsGroupParent": "1",

                       "shippingCharge": 0,

                       "shippingtype": "Free"

                   },

                   "businessPayment": 33945,

                   "productOptionCertTitle": null,

                   "orderPaymentGatewayCharge": 0,

                   "amountDetails": {

                       "admin": {

                           "subTotal": "33945.00000",

                           "serviceCharge": "0.00000",

                           "commission": "0.00000",

                           "ccCharge": 0,

                           "tax": 0,

                           "shippingAmount": 0,

                           "businessPayment": 33945,

                           "totalAmount": 33945

                       }

                   },

                   "itemDetails": {

                       "admin": {

                           "productOptionName": "Canon EOS 600D SLR"

                       },

                       "user": {

                           "productOptionName": "Canon EOS 600D SLR"

                       }

                   }

               },

               "shipmentStatus": "Pending",

               "shipmentDate": "0000-00-00 00:00:00",

               "carrierDetails": "",

               "shippingMethod": "Free (3-5 Days)",

               "combinationHash": 0,

               "redeemSlotID": 0

           }

       ]

   }

]

Create Orders

HTTP Method: POST /order/

Description: Allows you to create Orders.

Authentication: Admin
Default Format: JSON

Parameters:

Name

Type

masterOrderID

int

orderNumber

int

orderType

enum('product', 'coupon')

productType

enum('Product', 'Product')

orderTotalAmount

decimal(15,5)

convertedMasterOrderTotal

text

orderSubtotal

decimal(15,5)

convertedMasterOrderSubtotal

text

orderQty

smallint

promoID

int

orderPromoCode

varchar

orderPromoDiscountAmount

decimal(15,5)

convertedOrderPromoDiscountAmount

text

orderUserCreditAmount

decimal(15,5)

convertedOrderUserCreditAmount

text

paymentSettingsGroupID

smallint

orderPaymentMethodName

varchar

paymentType

enum('AUTH_ONLY', 'AUTH_CAPTURE')

languageID

smallint

purchasedCurrency

int

billingAddress

text

shippingAddress

text

netpayOrderID

int

netpayPaymentType

varchar

orderHold

enum('Yes', 'No')

transactionID

int

paymentStatus

enum('Pending','Denied','Received','Refunded','Free','Error')

orderStatus

enum('New','Pending','Process','Completed','Cancelled','Error','Backordered')

paymentNotes

text

userID

int

cityID

int

orderCreatedDate

datetime

orderStatusDate

datetime

orderTaxAmount

decimal(15,5)

orderCommissionAmount

decimal(15,5)

orderPaymentGatewayCharge

decimal(15,5)

orderOtherServiceCharge

decimal(15,5)

orderRemoved

enum('Yes', 'No')

shippingAmount

decimal(15,5)

shippingSetting

enum('admin', 'business')

businessID

int

businessPayment

decimal(15,5)

convertedBusinessPayment

decimal(15,5)

extraData

text

orderCharityID

int

orderCharityAmount

decimal(15,5)

taxSetting

enum('admin', 'business')

Array of Group order items attributes is as follows:

Name

Type

orderItemID

int

masterOrderID

int

productID

int

productOptionID

int

orderItemPrice

decimal

orderItemQuantity

smallint

orderItemSubtotal

decimal

orderGiveAsGift

enum('Yes', 'No')

productOptionName

varchar

addedTime

datetime

extra

text

shipmentStatus

enum('Pending', 'Delivered', 'Dispatched')

shipmentDate

datetime

carrierDetails

text

shippingMethod

varchar

combinationHash

int

redeemSlotID

int


Example JSON :

Request Body: (Multiple Order)


[

   {

       "masterOrderID": 1,

       "orderNumber": 1,

       "orderType": "product",

       "productType": "Product",

       "orderTotalAmount": 30198,

       "convertedMasterOrderTotal": 30198,

       "orderSubtotal": 30198,

       "convertedMasterOrderSubtotal": 30198,

       "orderQty": 2,

       "promoID": 0,

       "orderPromoCode": "",

       "orderPromoDiscountAmount": 0,

       "convertedOrderPromoDiscountAmount": 0,

       "orderUserCreditAmount": 0,

       "convertedOrderUserCreditAmount": 0,

       "paymentSettingsGroupID": 4,

       "orderPaymentMethodName": "Free_Checkout",

       "paymentType": "AUTH_CAPTURE",

       "languageID": 1,

       "purchasedCurrency": 1,

       "billingAddress": {

           "billingFirstName": "Anfas",

           "billingLastName": "Ansary",

           "billingAddress1": "Address 1",

           "billingAddress2": "",

           "billingCity": "Cochin",

           "billingProvince": "",

           "billingZip": "682024",

           "billingState": "1490",

           "billingCountry": "99",

           "billingPhone": "",

           "billingEmail": "[email protected]"

       },

       "shippingAddress": {

           "shippingFname": "Anfas",

           "shippingLname": "Ansary",

           "shippingAddress1": "Address 1",

           "shippingAddress2": "",

           "shippingCity": "Cochin",

           "shippingProvince": "",

           "shippingZip": "682024",

           "shippingStateID": "1490",

           "shippingCountryID": "99"

       },

       "netpayOrderID": 0,

       "netpayPaymentType": "",

       "orderHold": "No",

       "transactionID": 0,

       "paymentStatus": "Received",

       "orderStatus": "Completed",

       "paymentNotes": "",

       "userID": 1,

       "cityID": 0,

       "orderCreatedDate": "2013-07-09 16:03:55",

       "orderStatusDate": "2013-08-06 12:48:07",

       "orderTaxAmount": 0,

       "orderCommissionAmount": 603.96,

       "orderPaymentGatewayCharge": 0,

       "orderOtherServiceCharge": 0,

       "orderRemoved": "No",

       "shippingAmount": 0,

       "shippingSetting": "business",

       "businessID": 2,

       "businessPayment": 29594.04,

       "convertedBusinessPayment": 29594.04,

       "extraData": {

           "amountDetails": {

               "admin": {

                   "subTotal": 30198,

                   "serviceCharge": 0,

                   "commission": 603.96,

                   "ccCharge": 0,

                   "tax": 0,

                   "shippingAmount": 0,

                   "businessPayment": 29594.04,

                   "orderTotalAmount": 30198

               }

           }

       },

       "orderCharityID": 0,

       "orderCharityAmount": 0,

       "taxSetting": "admin",

       "orderItems": [

           {

               "orderItemID": 1,

               "masterOrderID": 1,

               "productID": 1,

               "productOptionID": 1,

               "orderItemPrice": 15099,

               "orderItemQuantity": 2,

               "orderItemSubtotal": 30198,

               "orderGiveAsGift": "No",

               "productOptionName": "Samsung Galaxy Tab 2 P3100 White",

               "addedTime": "2013-07-09 16:03:56",

               "extra": {

                   "productOptionName": "Samsung Galaxy Tab 2 P3100 White",

                   "imagePath": "tab2.jpg",

                   "orderCommissionAmount": "603.96",

                   "orderOtherServiceCharge": "0.00",

                   "promoCode": null,

                   "orderItemQuantity": "2",

                   "orderItemSubtotal": "30198.00",

                   "orderItemTotal": 30198,

                   "unitPrice": "15099.00",

                   "productCommissionRate": "2.00",

                   "businessKey": "",

                   "productImage": "tab2.jpg",

                   "productDefaultCurrency": "1",

                   "orderTaxAmount": 0,

                   "shippingAmount": 0,

                   "productURL": "product/tab2/1/",

                   "combinationValues": null,

                   "customOptionValues": null,

                   "combinationHash": "",

                   "orderPromoDiscountAmount": 0,

                   "isTaxable": "No",

                   "orderItemTaxRate": 0,

                   "orderItemTaxDescription": "",

                   "shippingMethod": {

                       "methodName": "Free (3-5 Days)",

                       "methodID": "73",

                       "settingsGroupKey": "free_custom1",

                       "settingsGroupParent": "1",

                       "shippingCharge": 0,

                       "shippingtype": "Free"

                   },

                   "businessPayment": 29594.04,

                   "productOptionCertTitle": null,

                   "orderPaymentGatewayCharge": 0,

                   "amountDetails": {

                       "admin": {

                           "subTotal": "30198.00000",

                           "serviceCharge": "0.00",

                           "commission": "603.96",

                           "ccCharge": 0,

                           "tax": 0,

                           "shippingAmount": 0,

                           "businessPayment": 29594.04,

                           "totalAmount": 30198

                       }

                   },

                   "itemDetails": {

                       "admin": {

                           "productOptionName": "Samsung Galaxy Tab 2 P3100 White"

                       },

                       "user": {

                           "productOptionName": "Samsung Galaxy Tab 2 P3100 White"

                       }

                   }

               },

               "shipmentStatus": "Delivered",

               "shipmentDate": "2013-07-10 11:26:14",

               "carrierDetails": "",

               "shippingMethod": "Free (3-5 Days)",

               "combinationHash": 0,

               "redeemSlotID": 0,

           }

       ]

   }

]

Modify Orders

HTTP Method: PUT /order

Description: Allows you to update existing Order details (Editable Fields).

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.

Parameters:


Example: JSON


Request Body:

[

   {

       "masterOrderID": "157",

       "paymentStatus": "Completed",

       "orderStatus": "Received",

   },

   {

       "masterOrderID": "158",

       "paymentStatus": "Completed",

       "orderStatus": "Received",

   },

   {

       "masterOrderID": "159",

       "paymentStatus": "Completed",

       "orderStatus": "Received",

   },

   {

       "masterOrderID": "160",

       "paymentStatus": "Completed",

       "orderStatus": "Received",

   }

]



Response Body:

{

 "oorjit_api": {

   "success": {

     "data_item": {

       "message": "Resource updated successful.",

       "code": "200",

       "masterOrderID": "157"

     }

   },

   "error": {

     "data_item": [

       {

         "message": "Resource not found.",

         "code": "404",

         "masterOrderID": "158"

       },

       {

         "message": "Resource not found.",

         "code": "404",

         "masterOrderID": "159"

       },

       {

         "message": "Empty value for \"productOrderID\" in request.",

         "code": "400",

         "masterOrderID": "160"

       }

     ]

   }

 }

}

HTTP Method: DELETE /order/

Description: Not allowed


REST API: Order

URI: /order/:id

Allows you to update, delete, or retrieve information on a single Order

URL Structurehttp://projecthost/api/rest/order/:id
Version: 1

HTTP Method : GET /order/:id

Description: Allows you to retrieve the Order information.
Authentication: Admin

Response Example: JSON


Response Body:

[

   {

       "masterOrderID": 1,

       "orderNumber": 1,

       "orderType": "product",

       "productType": "Product",

       "orderTotalAmount": 30198,

       "convertedMasterOrderTotal": 30198,

       "orderSubtotal": 30198,

       "convertedMasterOrderSubtotal": 30198,

       "orderQty": 2,

       "promoID": 0,

       "orderPromoCode": "",

       "orderPromoDiscountAmount": 0,

       "convertedOrderPromoDiscountAmount": 0,

       "orderUserCreditAmount": 0,

       "convertedOrderUserCreditAmount": 0,

       "paymentSettingsGroupID": 4,

       "orderPaymentMethodName": "Free_Checkout",

       "paymentType": "AUTH_CAPTURE",

       "languageID": 1,

       "purchasedCurrency": 1,

       "billingAddress": {

           "billingFirstName": "Anfas",

           "billingLastName": "Ansary",

           "billingAddress1": "Address 1",

           "billingAddress2": "",

           "billingCity": "Cochin",

           "billingProvince": "",

           "billingZip": "682024",

           "billingState": "1490",

           "billingCountry": "99",

           "billingPhone": "",

           "billingEmail": "[email protected]"

       },

       "shippingAddress": {

           "shippingFname": "Anfas",

           "shippingLname": "Ansary",

           "shippingAddress1": "Address 1",

           "shippingAddress2": "",

           "shippingCity": "Cochin",

           "shippingProvince": "",

           "shippingZip": "682024",

           "shippingStateID": "1490",

           "shippingCountryID": "99"

       },

       "netpayOrderID": 0,

       "netpayPaymentType": "",

       "orderHold": "No",

       "transactionID": 0,

       "paymentStatus": "Received",

       "orderStatus": "Completed",

       "paymentNotes": "",

       "userID": 1,

       "cityID": 0,

       "orderCreatedDate": "2013-07-09 16:03:55",

       "orderStatusDate": "2013-08-06 12:48:07",

       "orderTaxAmount": 0,

       "orderCommissionAmount": 603.96,

       "orderPaymentGatewayCharge": 0,

       "orderOtherServiceCharge": 0,

       "orderRemoved": "No",

       "shippingAmount": 0,

       "shippingSetting": "business",

       "businessID": 2,

       "businessPayment": 29594.04,

       "convertedBusinessPayment": 29594.04,

       "extraData": {

           "amountDetails": {

               "admin": {

                   "subTotal": 30198,

                   "serviceCharge": 0,

                   "commission": 603.96,

                   "ccCharge": 0,

                   "tax": 0,

                   "shippingAmount": 0,

                   "businessPayment": 29594.04,

                   "orderTotalAmount": 30198

               }

           }

       },

       "orderCharityID": 0,

       "orderCharityAmount": 0,

       "taxSetting": "admin",

       "orderItems": [

           {

               "orderItemID": 1,

               "masterOrderID": 1,

               "productID": 1,

               "productOptionID": 1,

               "orderItemPrice": 15099,

               "orderItemQuantity": 2,

               "orderItemSubtotal": 30198,

               "orderGiveAsGift": "No",

               "productOptionName": "Samsung Galaxy Tab 2 P3100 White",

               "addedTime": "2013-07-09 16:03:56",

               "extra": {

                   "productOptionName": "Samsung Galaxy Tab 2 P3100 White",

                   "imagePath": "tab2.jpg",

                   "orderCommissionAmount": "603.96",

                   "orderOtherServiceCharge": "0.00",

                   "promoCode": null,

                   "orderItemQuantity": "2",

                   "orderItemSubtotal": "30198.00",

                   "orderItemTotal": 30198,

                   "unitPrice": "15099.00",

                   "productCommissionRate": "2.00",

                   "businessKey": "",

                   "productImage": "tab2.jpg",

                   "productDefaultCurrency": "1",

                   "orderTaxAmount": 0,

                   "shippingAmount": 0,

                   "productURL": "product/tab2/1/",

                   "combinationValues": null,

                   "customOptionValues": null,

                   "combinationHash": "",

                   "orderPromoDiscountAmount": 0,

                   "isTaxable": "No",

                   "orderItemTaxRate": 0,

                   "orderItemTaxDescription": "",

                   "shippingMethod": {

                       "methodName": "Free (3-5 Days)",

                       "methodID": "73",

                       "settingsGroupKey": "free_custom1",

                       "settingsGroupParent": "1",

                       "shippingCharge": 0,

                       "shippingtype": "Free"

                   },

                   "businessPayment": 29594.04,

                   "productOptionCertTitle": null,

                   "orderPaymentGatewayCharge": 0,

                   "amountDetails": {

                       "admin": {

                           "subTotal": "30198.00000",

                           "serviceCharge": "0.00",

                           "commission": "603.96",

                           "ccCharge": 0,

                           "tax": 0,

                           "shippingAmount": 0,

                           "businessPayment": 29594.04,

                           "totalAmount": 30198

                       }

                   },

                   "itemDetails": {

                       "admin": {

                           "productOptionName": "Samsung Galaxy Tab 2 P3100 White"

                       },

                       "user": {

                           "productOptionName": "Samsung Galaxy Tab 2 P3100 White"

                       }

                   }

               },

               "shipmentStatus": "Delivered",

               "shipmentDate": "2013-07-10 11:26:14",

               "carrierDetails": "",

               "shippingMethod": "Free (3-5 Days)",

               "combinationHash": 0,

               "redeemSlotID": 0,

               "shipping_history": [

                   {

                       "shippingID": 1,

                       "activityDate": "2013-07-10 11:25:52",

                       "comment": "",

                       "notifyCustomer": "No",

                       "orderID": 1,

                       "orderItemID": 1,

                       "shippingStatus": "Dispatched",

                       "trackingNumber": "",

                       "carrier": ""

                   },

                   {

                       "shippingID": 2,

                       "activityDate": "2013-07-10 11:26:14",

                       "comment": "",

                       "notifyCustomer": "No",

                       "orderID": 1,

                       "orderItemID": 1,

                       "shippingStatus": "Delivered",

                       "trackingNumber": "",

                       "carrier": ""

                   }

               ]

           }

       ]

   }

]

Order - Shipping

Retrieve Order Shipping

REST API: Shipping

URI: /orderhipping/:id

Allows you to manage shipments .

URL Structurehttp://projecthost/api/rest/ordershipping/:id
Version: 1

HTTP Method : GET /order/:id

Description: Allows you to retrieve the Order shipping details list.
Authentication: Admin

Response Example: JSON


Response Body:

[

   {

       "shippingID": 1,

       "activityDate": "2013-07-10 11:25:52",

       "comment": "",

       "notifyCustomer": "No",

       "orderID": 1,

       "orderItemID": 1,

       "shippingStatus": "Dispatched",

       "trackingNumber": "",

       "carrier": ""

   },

   {

       "shippingID": 2,

       "activityDate": "2013-07-10 11:26:14",

       "comment": "",

       "notifyCustomer": "No",

       "orderID": 1,

       "orderItemID": 1,

       "shippingStatus": "Delivered",

       "trackingNumber": "",

       "carrier": ""

   }

]

Create Order Shipping

HTTP Method: POST /orderhipping/

Description: Allows you to create new shipping activity

Authentication: Admin
Default Format: JSON

Parameters:


Name

Type

shippingID

int

activityDate

datetime

comment

text

notifyCustomer

enum('Yes', 'No')

orderID

int

orderItemID

int

shippingStatus

enum('Pending', 'Delivered', 'Dispatched')

trackingNumber

varchar

carrier

varchar



Order - Address

Retrieve Order Address

REST API: Order Addresses

URI: /order/:orderid/addresses

Allows you to retrieve information about billing and shipping addresses of the required order.

URL Structurehttp://projecthost/api/rest/order/:orderid/addresses
Version: 1

HTTP Method: GET

Description: Allows you to retrieve information on billing and shipping addresses from the required order.
Notes: Customers can retrieve addresses only from their orders.

Default Format: JSON
Parameters:
No Parameters

Example:

Response Body:

{

   "billingAddress": {

       "billingFirstName": "Anfas",

       "billingLastName": "Ansary",

       "billingAddress1": "Address 1",

       "billingAddress2": "",

       "billingCity": "Cochin",

       "billingProvince": "",

       "billingZip": "682024",

       "billingState": "1490",

       "billingCountry": "99",

       "billingPhone": "",

       "billingEmail": "[email protected]"

   },

   "shippingAddress": {

       "shippingFname": "Anfas",

       "shippingLname": "Ansary",

       "shippingAddress1": "Address 1",

       "shippingAddress2": "",

       "shippingCity": "Cochin",

       "shippingProvince": "",

       "shippingZip": "682024",

       "shippingStateID": "1490",

       "shippingCountryID": "99"

   }

}


HTTP Method: POST

Description: Not allowed.

HTTP Method: PUT

Description: Not allowed.

HTTP Method: DELETE

Description: Not allowed.

Retrieve Order Billing

URI: /order/:orderid/addresses/billing

HTTP Method: GET

Description: Allows you to retrieve information on the order billing address.
Notes: Customers can retrieve information on billing addresses only from their own orders.

Default Format: JSON
Parameters:
No Parameters

Example:

Response example:

{

   "billingAddress": {

       "billingFirstName": "Anfas",

       "billingLastName": "Ansary",

       "billingAddress1": "Address 1",

       "billingAddress2": "",

       "billingCity": "Cochin",

       "billingProvince": "",

       "billingZip": "682024",

       "billingState": "1490",

       "billingCountry": "99",

       "billingPhone": "",

       "billingEmail": "[email protected]"

   }

}


URI: /order/:orderid/addresses/shipping

HTTP Method: GET

Description: Allows you to retrieve information on the order shipping address.
Notes: Customers can retrieve information on shipping addresses only from their own orders.

Default Format: JSON
Parameters:
No Parameters

Example:

GET http://projecthost/api/rest/order/32/addresses/shipping

Response example:


 

{"shippingAddress": {

       "shippingFname": "Anfas",

       "shippingLname": "Ansary",

       "shippingAddress1": "Address 1",

       "shippingAddress2": "",

       "shippingCity": "Cochin",

       "shippingProvince": "",

       "shippingZip": "682024",

       "shippingStateID": "1490",

       "shippingCountryID": "99"

   }}



Order - Items

Retrieve Order Items

REST API: Order Items

URI: /order/:orderId/items

Allows you to retrieve information about order items.

URL Structurehttp://projecthost/api/rest/order/:orderId/items
Version: 1

HTTP Method: GET

Description: Allows you to retrieve the list of existing order items with detailed items information.
Notes: The list of attributes that will be returned for order items is configured in the oorjit Admin Panel.

Authentication: Admin
Default Format: JSON
Parameters:
No Parameters

Response Example: JSON

Response Body:

           [{

               "orderItemID": 1,

               "masterOrderID": 1,

               "productID": 1,

               "productOptionID": 1,

               "orderItemPrice": 15099,

               "orderItemQuantity": 2,

               "orderItemSubtotal": 30198,

               "orderGiveAsGift": "No",

               "productOptionName": "Samsung Galaxy Tab 2 P3100 White",

               "addedTime": "2013-07-09 16:03:56",

               "extra": {

                   "productOptionName": "Samsung Galaxy Tab 2 P3100 White",

                   "imagePath": "tab2.jpg",

                   "orderCommissionAmount": "603.96",

                   "orderOtherServiceCharge": "0.00",

                   "promoCode": null,

                   "orderItemQuantity": "2",

                   "orderItemSubtotal": "30198.00",

                   "orderItemTotal": 30198,

                   "unitPrice": "15099.00",

                   "productCommissionRate": "2.00",

                   "businessKey": "",

                   "productImage": "tab2.jpg",

                   "productDefaultCurrency": "1",

                   "orderTaxAmount": 0,

                   "shippingAmount": 0,

                   "productURL": "product/tab2/1/",

                   "combinationValues": null,

                   "customOptionValues": null,

                   "combinationHash": "",

                   "orderPromoDiscountAmount": 0,

                   "isTaxable": "No",

                   "orderItemTaxRate": 0,

                   "orderItemTaxDescription": "",

                   "shippingMethod": {

                       "methodName": "Free (3-5 Days)",

                       "methodID": "73",

                       "settingsGroupKey": "free_custom1",

                       "settingsGroupParent": "1",

                       "shippingCharge": 0,

                       "shippingtype": "Free"

                   },

                   "businessPayment": 29594.04,

                   "productOptionCertTitle": null,

                   "orderPaymentGatewayCharge": 0,

                   "amountDetails": {

                       "admin": {

                           "subTotal": "30198.00000",

                           "serviceCharge": "0.00",

                           "commission": "603.96",

                           "ccCharge": 0,

                           "tax": 0,

                           "shippingAmount": 0,

                           "businessPayment": 29594.04,

                           "totalAmount": 30198

                       }

                   },

                   "itemDetails": {

                       "admin": {

                           "productOptionName": "Samsung Galaxy Tab 2 P3100 White"

                       },

                       "user": {

                           "productOptionName": "Samsung Galaxy Tab 2 P3100 White"

                       }

                   }

               },

               "shipmentStatus": "Delivered",

               "shipmentDate": "2013-07-10 11:26:14",

               "carrierDetails": "",

               "shippingMethod": "Free (3-5 Days)",

               "combinationHash": 0,

               "redeemSlotID": 0,

               

           }

       ]

Modify Order Items

HTTP Method: PUT

Description: Allows you to update existing Order item.

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.

Parameters:

Name

Type

orderItemID

int

shippingID

int

activityDate

datetime

comment

text

notifyCustomer

enum('Yes', 'No')

orderID

int

orderItemID

int

shippingStatus

enum('Pending', 'Delivered', 'Dispatched')

trackingNumber

varchar

carrier

varchar

Example: JSON


Request Body:

[

   {

       "orderItemID": "157",

       "shipmentStatus": "Dispatched",

   },

   {

       "orderItemID": "158",

       "shipmentStatus": "Dispatched",

   },

   {

       "orderItemID": "159",

       "shipmentStatus": "Dispatched",

   },

   {

       "orderItemID": "160",

       "shipmentStatus": "Dispatched",

       

   }

]



Response Body:

{

 "oorjit_api": {

   "success": {

     "data_item": {

       "message": "Resource updated successful.",

       "code": "200",

       "orderItemID": "157"

     }

   },

   "error": {

     "data_item": [

       {

         "message": "Resource not found.",

         "code": "404",

         "orderItemID": "158"

       },

       {

         "message": "Resource not found.",

         "code": "404",

         "orderItemID": "159"

       },

       {

         "message": "Empty value for \"orderItemID\" in request.",

         "code": "400",

         "orderItemID": "160"

       }

     ]

   }

 }

}


Order - Shippment

Retrieve Order Shippment

REST API: Order Shipment

URI: order/id/:id/child/shipments

Allows you to retrieve information about order shipment

URL Structurehttp://projecthost/api/rest/order/id/:id/child/shipments
Version: 1

HTTP Method: GET

Description: Allows you to retrieve the list of existing order shipment items information.

Authentication: Admin
Default Format: JSON
Parameters:
No Parameters

Response Example: JSON

Response Body:

[

               {

       "shippingID": "113",

       "activityDate": "2013-10-22 15:42:15",

       "comment": "",

       "notifyCustomer": "No",

       "masterOrderID": "741",

       "shippingStatus": "Delivered",

       "trackingNumber": "",

       "carrier": "",

       "createdBy": "admin",

       "shipmentItems": [

           {

               "shipmentItemID": "113",

               "shippingID": "113",

               "orderItemID": "490",

               "quantity": "2"

           },

           {

               "shipmentItemID": "124",

               "shippingID": "113",

               "orderItemID": "499",

               "quantity": "1"

           }

       ]

   }

]

Modify Order Shippment

HTTP Method: POST

Description: Allows you to update existing Order item.

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.

Parameters:

Name

Type

shippingID

int

activityDate

date

comment

text

notifyCustomer

enum('Yes', 'No')

masterOrderID

int

shippingStatus

enum('Pending', 'Delivered', 'Dispatched')

trackingNumber

char

carrier

char

createdBy

enum('admin', 'business')


Name

Type

shipmentItemID

int

shippingID

int

orderItemID

int

quantity

int


Example: JSON


[

               {

       "shippingID": "113",

       "activityDate": "2013-10-22 15:42:15",

       "comment": "",

       "notifyCustomer": "No",

       "masterOrderID": "741",

       "shippingStatus": "Delivered",

       "trackingNumber": "",

       "carrier": "",

       "createdBy": "admin",

       "shipmentItems": [

           {

               "shipmentItemID": "113",

               "shippingID": "113",

               "orderItemID": "490",

               "quantity": "2"

           },

           {

               "shipmentItemID": "124",

               "shippingID": "113",

               "orderItemID": "499",

               "quantity": "1"

           }

       ]

   }

]

Product Reviews

Retrieve Product Reviews

REST API: Review

URI: product/id/:id/child/review/

Allows you to retrieve the Review details.

URL Structurehttp://projecthost/api/rest/product/id/:id/child/review/
Version: 1

HTTP Method: GET product/id/:id/child/review/

Description: Allows you to retrieve the Review details.

Authentication: Admin
Parameters :
No Parameters

Response Example: JSON

GET http://projecthost/api/rest/product/id/:id/child/review/


[

   {

       "ProductReviewID": 8,

       "productID": 29,

       "userID": 3,

       "languageID": 1,

       "reviewTitle": "***** Rated",

       "reviewText": "GOOD",

       "productRating": 5,

       "reviwedDate": "2013-05-04 14:23:17",

       "reviewStatus": "Deleted",

       "updatedDate": "2013-05-07 15:07:37",

       "approvedBy": 0,

       "reviewFollow": "No"

   },

   {

       "ProductReviewID": 15,

       "productID": 29,

       "userID": 33,

       "languageID": 1,

       "reviewTitle": "Jaggu Again",

       "reviewText": "OUTSTANDING",

       "productRating": 4,

       "reviwedDate": "2013-05-07 14:59:30",

       "reviewStatus": "Deleted",

       "updatedDate": "0000-00-00 00:00:00",

       "approvedBy": 0,

       "reviewFollow": "No"

   }

]


Create Product Reviews

HTTP Method: POST product/id/:id/child/review/

Description: Not available


HTTP Method: PUT product/id/:id/child/review/

Description: Allows you to update existing Review.

Authentication: Admin

Notes: The Content-Type: text/json parameter must be added to the request header.

Parameters:


Name

Type

ProductReviewID

int

productID

int

userID

int

languageID

int

reviewTitle

varchar

reviewText

text

productRating

tinyint

reviwedDate

timestamp

reviewStatus

enum('New', 'Active', 'Inactive', 'Deleted')

updatedDate

datetime

approvedBy

int

reviewFollow

enum('Yes', 'No')

Example: JSON


Request Body:

[

   {

       "ProductReviewID": "157",

       "reviewStatus": "New Review1",

       "approvedBy": "'Active'",

   },

   {

       "ProductReviewID": "158",

       "reviewStatus": "New Review2",

       "approvedBy": "'Active'",

   },

   {

       "ProductReviewID": "159",

       "reviewStatus": "New Review3",

       "approvedBy": "'Active'",

   },

   {

       "ProductReviewID": "160",

       "reviewStatus": "New Review4",

       "approvedBy": "'Deleted'",

   }

]


Response Body:

{

 "oorjit_api": {

   "success": {

     "data_item": {

       "message": "Resource updated successful.",

       "code": "200",

       "ProductReviewID": "157"

     }

   },

   "error": {

     "data_item": [

       {

         "message": "Resource not found.",

         "code": "404",

         "ProductReviewID": "158"

       },

       {

         "message": "Resource not found.",

         "code": "404",

         "ProductReviewID": "159"

       },

       {

         "message": "Empty value for \"productReviewID\" in request.",

         "code": "400",

         "ProductReviewID": "160"

       }

     ]

   }

 }

}