DEVELOPER API {...}

Introduction

API will be developed to give your vendors access to your diamond inventory. The services we are going to provide in this are GetStock, Place Order, Hold Stones and Request Memo

Objective

Aim of this service is to synchronize availability of diamond inventory of excellent diamond so that all the clients of ‘excellent diamond’ can able to synchronize with latest stock.

Technical

Each service will give return two parameter Status and Message; where status =1 means that particular Service executed successfully and the message you will get is ‘SUCCESS’, now if you got status=0 that means some error or validation occurred there, in this case proper error/validation message will be shown in Message parameter.

Get stock api

This service will be used to fetch data from excellent diamond to your (customer) inventory on timely manner.

Input Parameter:

Username, Password & Datetime

Parameter Description

Username: Provided by vendor for security purpose
Password: Provided by vendor for security purpose
Datetime: Stock will be updated according to API called by vendor at last date and time.
(Ex. If vendor pass 2018-10-27 16:15:00 in datetime, all the in-out stock from 27/10/2018 04:15:00 PM will be given to vendor.

Sample Input: http://webapi.excellentdiamonds.com.hk/DeveloperAPI.svc/Get_Stock_List?UserName=YOUR_USER_NAME&Password=YOUR_PASSWORD&Datetime=2018-10-27 04:15:00

Sample Output:

{
"Message": "SUCCESS",
"Status": 1,
"List": [
{
"B2B360Video": "https://s3-ap-southeast-1.amazonaws.com/excellentdiamond/B2BJson/Vision360.html?d=LP25663&v=2&sv=0,1,2,3,4&z=1&btn=1,2,3,5?s=10",
"B2BImage": "https://s3-ap-southeast-1.amazonaws.com/excellentdiamond/B2BJson/imaged/LP25663/still.jpg",
"B2BVideo": "https://s3-ap-southeast-1.amazonaws.com/excellentdiamond/B2BJson/imaged/LP25663/video.mp4",
"B2C360Video": "https://s3-ap-southeast-1.amazonaws.com/excellentdiamond/B2CJson/Vision360.html?d=LP25663&v=2&sv=0,1,2,3,4&z=1&btn=1,2,3,5?s=10",
"B2CImage": "https://s3-ap-southeast-1.amazonaws.com/excellentdiamond/B2CJson/imaged/LP25663/still.jpg",
"B2CVideo": "https://s3-ap-southeast-1.amazonaws.com/excellentdiamond/B2CJson/imaged/LP25663/video.mp4",
"Center_Natts": "CN0",
"Center_White": "SW1",
"Certificate_No": "5191228387",
"Clarity": "VVS2",
"Color": "I",
"Crown_Angle": 36,
"Crown_Height": 16,
"Cts": 7.41,
"Culet": "NONE",
"Cut": "EX",
"Depth_Per": 62.7,
"Eye_Clean": "SN0",
"Fluorescence": "NON",
"Girdle": "STK",
"Girdle_Condition": "Faceted",
"Girdle_Per": 4,
"Height": 7.74,
"HnA": "NO",
"Key_To_Symbols": "NEEDLE",
"Lab": "GIA",
"Laser_Inscription": "YES",
"Length": 12.38,
"Lower_Half_Per": 80,
"Measurement": "12.38 x 12.31 x 7.74",
"Milky": "-",
"Modify_Date": "/Date(1532086383440+0530)/",
"New_Arrival_Date": "/Date(1532086383440+0530)/",
"Pavillion_Angle": 40.6,
"Pavillion_Height": 43,
"Ploting_Image": "https://s3-ap-southeast-1.amazonaws.com/excellentdiamond/PlottingImages/LP25663.gif",
"Polish": "EX",
"RapAmount": 229710,
"RapDisc": 0,
"RapRate": 31000,
"Rapaport": 31000,
"Report_Comment": "PINPOINTS ARE NOT SHOWN.",
"Sell_Amount": 195253.5,
"Sell_Disc": -15,
"Sell_Rate": 26350,
"Shade": "-",
"Shape": "RD",
"Side_Natts": "CW0",
"Side_White": "Y",
"Star_Length": 50,
"Stone_ID": 4031,
"Stone_No": "LP25663",
"Symmetry": "EX",
"Table_per": 57,
"Web_Status": "HOLD",
"Width": 12.31
},]
}

Get stock api (Available)

This service will be used to fetch all available stock data from excellent diamond to your (customer) inventory

Input Parameter:

Username, Password

Parameter Description

Username: Provided by vendor for security purpose
Password: Provided by vendor for security purpose

Sample Input: http://webapi.excellentdiamonds.com.hk/DeveloperAPI.svc/Full_Stock_List?UserName=YOUR_USER_NAME&Password=YOUR_PASSWORD

Sample Output:

Output will be same as Get_Stock_List service

Duration List

For hold and memo you need to pass duration ID and duration time. That list you will be getting by using this service. And when you called this service you have to pass ‘hold’ or ‘memo’ for ‘Type’ (if you need a duration list for Hold you have to pass hold in ‘Type’ and for duration list of memo you have to pass memo in ‘type’)

Input Parameter

Username, Password & Type

Parameter Description

Username: Provided by vendor for security purpose
Password: Provided by vendor for security purpose
Type: Possible value for Type are: hold,memo.

Sample Input: http://webapi.excellentdiamonds.com.hk/DeveloperAPI.svc/Hold_Memo_Duration_List?UserName=YOUR_USER_NAME&Password=YOUR_PASSWORD&Type=memo

Sample Output:

{
"List": [
{
"Duration_For": "Customer",
"Duration_ID": 4,
"Duration_In_Min": 1440,
"Hold_Duration": "24 Hours",
"Is_Active": true
},
{
"Duration_For": "Customer",
"Duration_ID": 5,
"Duration_In_Min": 2880,
"Hold_Duration": "48 Hours",
"Is_Active": true
},
{
"Duration_For": "Customer",
"Duration_ID": 6,
"Duration_In_Min": 4320,
"Hold_Duration": "72 Hours",
"Is_Active": true
}
],
"Message": "Success",
"Status": 1
}

Place order

This service will be used to place an order of stones

Input Parameter

UserName,Password,TotalStone,Total Carat,Avg Dis,Avg Rate,Total Amount,Payable_Amount,Additional_Disc, Stonelist

Parameter Description

Username: Provided by vendor for security purpose
Password: Provided by vendor for security purpose
TotalStone: No of stones you want to ordered
Total Carat: Total carat of placed stone
Avg Dis: Average Disc of placed stone
Avg Rate: Average Rate of placed stone
Total Amount: Total Amount of placed stone
Payable_Amount: payable Amount of placed stone
Additional_Disc: Additional Disc of placed stone
Stonelist: A list of stones which needs to be order with order sell amount and size.

Sample Input: http://webapi.excellentdiamonds.com.hk/DeveloperAPI.svc/PlaceOrder
Method is Post so Request parameter in Body will be :
{
"UserName":Your User Name,
"Password":Your Password,
"Total_Pcs":"2",
"Total_Cts":"1.82",
"Avg_Disc":"-43.00",
"Avg_Rate":"3192",
"Total_Amount":"5809.44",
"Payable_Amount":"5809.44",
"Additional_Disc":"0",
"StoneArr":[
{"Cts":0.91,"Stone_No":"STONE1","Sell_Amount":3112.20,"Sell_Rate":3420,"Sell_Discount":-43,"Additional_Disc_Per":0,"Additional_Disc":0,"Payable_Amount":3112.20 },
{"Cts":0.91,"Stone_No":"STONE2","Sell_Amount":2697.24,"Sell_Rate":2964,"Sell_Discount":-43,"Additional_Disc_Per":0,"Additional_Disc":0,"Payable_Amount":2697.24 }
}

Sample Output:

{
"Message": "Order placed successfully",
"Status": 1
}

Hold stone

This service will be used to hold stones for particular duration

Input Parameter

UserName,Password,Duration_ID,Duration_In_Min,Comments, Stonelist

Parameter Description

Username: Provided by vendor for security purpose
Password: Provided by vendor for security purpose
Duration_ID: Auto ID of Duration (get all possible Ids from Duration List service)
Duration_In_Min: Total minute you want to hold stone (get all possible minute from Duration List service)
Comments: Extra any remarks or comment
Stonelist: A list of stones which needs to be hold with order sell amount and size.

Sample Input: http://webapi.excellentdiamonds.com.hk/DeveloperAPI.svc/Add_To_Hold
Method is Post so Request parameter in Body will be :
{
"UserName":Your User Name,
"Password":Your Password,
"Duration_ID":"3",
"Duration_In_Min":"15",
"Comments":"Test",
"StoneArr":[
{"Cts":0.97,"Stone_No":"Stone1","Sell_Amount":2328 },
{"Cts":0.93,"Stone_No":"Stone2","Sell_Amount":2036.70 }
]
}

Sample Output:

{
"Message": "Stone Hold Successfully",
"Status": 1
}

Request memo

This service will be used to memo request stones for particular duration.

Input Parameter

UserName,Password,Duration_ID,Duration_In_Min,Comments, Stonelist

Parameter Description

Username: Provided by vendor for security purpose
Password: Provided by vendor for security purpose
Duration_ID: Auto ID of Duration (get all possible Ids from Duration List service)
Duration_In_Min: Total minute you want to memo stone (get all possible minute from Duration List service)
Comments: Extra any remarks or comment
Stonelist: A list of stones which needs to memo.

Sample Input: http://webapi.excellentdiamonds.com.hk/DeveloperAPI.svc/MemoRequest
Method is Post so Request parameter in Body will be :
{
"UserName":Your User Name,
"Password":Your Password,
"Duration_ID":"3",
"Duration_In_Min":"15",
"Comments":"Test",
"StoneArr":[
{"Cts":0.97,"Stone_No":"Stone1","Sell_Amount":2328 },
{"Cts":0.93,"Stone_No":"Stone2","Sell_Amount":2036.70 }
]
}

Sample Output:

{
"Message": "Memo Request Saved Successfully",
"Status": 1
}

Download Source Code

Help