Utilize RapNet Instant Inventory (premium service) with JSON

Introduction
Once you have set up your RapNet Instant Inventory (was RapLink) through RapNet, you can intergrate this in your website using JSON combined with HTTP requests. Each request and response will have two sections: The 'header' and 'body'. The header section will contain meta data, such as your username and password in the request, and in the response this will contain a result code of the operation. All available methods have the same header parameters. The body section contains the parameters and data that are send to and from. The parameters differ per request and response.

General usage information
  • Authentication - each request should have a username and password in the header section
  • All requests should go to a URL starting with HTTPS
  • All data should be send using POST
  • Send request as Content-Type: application/x-www-form-urlencoded
  • URL-Encode the request.
  • Optional values can be omitted or left blank.
  • the response will always contain an 'error_code' field. Value 0 means the operation succeeded.

Available functions
  • Get Diamonds -

  • Get single diamond -


Available values and formats
Parameter type Description
username string mandatory
Example : "myusername"
password string mandatory
Example : "mypassword"
search_type string optional - default is "White" .
Allowed values :
"White", "Fancy"
shapes string optional
Allowed values :
"Round", "Pear", "Princess", "Marquise", "Oval", "Radiant", "Emerald", "Heart", "Cushion", "Asscher"
size_from
size_to
decimal optional
Example : 2.10
color_from
color_to
string optional
Allowed values :
"D", "E", "F", "G", "H", "I", "J", "K", "L", "M"
fancy_colors string optional
Allowed values :
"Yellow","Pink","Orange","Green", "Gray", "Brown","Blue", "Black","Red","Purple","Violet","Champagne","Cognac","Chameleon"
fancy_color_intensity_from
fancy_color_intensity_to
string optional
Allowed values :
"Faint","Very Light","Light","Fancy Light", "Fancy Dark", "Fancy Intense","Fancy Vivid", "Fancy Deep"
clarity_from
clarity_to
string optional
Allowed values :
"IF", "VVS1", "VVS2", "VS1", "VS2", "SI1", "SI2", "SI3", "I1","I2","I3"
cut_from
cut_to
string optional
Allowed values :
"Excellent", "Very Good", "Good", "Fair", "Poor"
polish_from
polish_to
string optional
Allowed values :
"Excellent", "Very Good", "Good", "Fair", "Poor"
symmetry_from
symmetry_to
string optional
Allowed values :
"Excellent", "Very Good", "Good", "Fair", "Poor"
price_total_from
price_total_to
integer optional
Example : 100000
labs string optional
Allowed values :
"GIA", "IGI", "AGS", "HRD", "PGS", "DCLA", "VGR", "GCAL","NGTC", "GSI", "IIDGR", "NONE"
fluorescence_intensities string optional
Allowed values :
"Very Slight", "Faint", "Medium", "Slight", "Strong", "Very Strong","None"
fluorescence_colors string optional
Allowed values :
"Blue", "Yellow", "Green", "Red", "Orange", "White"
depth_percent_from
depth_percent_to
decimal optional
Example : 66.7
table_percent_from
table_percent_to
decimal optional
Example : 54.2
meas_length_from
meas_length_to
decimal optional
Example : 6.41
meas_width_from
meas_width_to
decimal optional
Example : 3.91
meas_depth_from
meas_depth_to
decimal optional
Example : 3.12
girdle_min
girdle_max
string optional
Allowed values :
"Extr Thin", "Very Thin", "Thin", "Slightly Thin", "Medium", "Slightly Thick", "Thick", "Very Thick", "Extr Thick"
culet_sizes string optional
Allowed values :
"Very Small", "Small", "Medium", "Large"
eye_cleans string [] optional
Allowed values :
"Yes", "Borderline", "No"
page_number integer mandatory
Example : 1
page_size integer mandatory - max value 50
Example : 20
sort_by string optional
Allowed values :
"Price","Shape","Size","Color", "Clarity", "Cut","Lab"
sort_direction string optional
Allowed values :
"Asc","Desc"

Get Diamonds - search diamonds - sample request
{
"request": {
"header": {
"username": "awesome",
"password": "jsonrocks"

},
"body": {
"search_type": "White",
"shapes": ["round","Princess","pear"],
"size_from": 0.2,
"size_to": 15.3,
"color_from": "D",
"color_to": "K",
"clarity_from": "IF",
"clarity_to": "VS2",
"cut_from": "Excellent",
"cut_to": "Fair",
"polish_from": "Excellent",
"polish_to": "Fair",
"symmetry_from": "Excellent",
"symmetry_to": "Fair",
"price_total_from": 100,
"price_total_to": 150000,
"labs": ["GIA","IGI"],
"table_percent_from": "26.0",
"table_percent_to": "66.0",
"eye_cleans": ["Yes", "Borderline"],
"page_number": 1,
"page_size": 20,
"sort_by": "price",
"sort_direction": "Asc"
}
}
}


Get Diamonds - sample response
{
"response": {
"header":  {
"error_code": 0,
"error_message": ""

},
"body":  {
"search_results":  {
"diamonds_returned": 20,
"total_diamonds_found": 30,
"sorted_by": "Price",
"sort_direction": "Asc"
} ,
"diamonds": [
{
"diamond_id": 1234567,
"shape": "Round",
"size": 0.22,
"color": "J",
"fancy_color_dominant_color": "",
"fancy_color_secondary_color": "",
"fancy_color_overtone": "",
"fancy_color_intensity": "",
"clarity": "VS1",
"cut": "Fair",
"symmetry": "Fair",
"polish": "Good",
"depth_percent": 62.1,
"table_percent": 62.00,
"meas_length": 3.84,
"meas_width": 3.94,
"meas_depth": 2.41,
"girdle_min": "",
"girdle_max": "",
"girdle_condition": "",
"culet_size": "None",
"culet_condition": "",
"fluor_color": "",
"fluor_intensity": "None",
"has_cert_file": true,
"lab": "GIA",
"total_sales_price": 5678.0000,
"currency_code": "USD",
"currency_symbol": "$",
"total_sales_price_in_currency": 5678.0000,
"cert_num": "123456789",
"stock_num": "ABCDEFG",
"has_image_file": true,
"image_file_url": "//certs.rapnet.com/userfolders/3/Images/D87G.jpg",
"has_sarineloupe" : false,
"eye_clean": ""
} ,
.
.
.
{
"diamond_id": 89101112,
"shape": "Round",
"size": 0.230,
"color": "G",
"fancy_color_dominant_color": "",
"fancy_color_secondary_color": "",
"fancy_color_overtone": "",
"fancy_color_intensity": "",
"clarity": "VS1",
"cut": "Good",
"symmetry": "Fair",
"polish": "Good",
"depth_percent": 60.6,
"table_percent": 64.00,
"meas_length": 3.89,
"meas_width": 3.99,
"meas_depth": 2.38,
"girdle_min": "Very Thin",
"girdle_max": "Very Thick",
"girdle_condition": "",
"culet_size": "None",
"culet_condition": "",
"fluor_color": "",
"fluor_intensity": "None",
"has_cert_file": true,
"lab": "GIA",
"total_sales_price": 8203.0000,
"currency_code": "USD",
"currency_symbol": "$",
"total_sales_price_in_currency": 8203.0000,
"cert_num": "12345678",
"stock_num": "ABCDEFG",
"has_image_file": false,
"image_file_url": "",
"has_sarineloupe" : false,
"eye_clean": ""
}
]
}
}
}


Get Single Diamond - sample request
{
"request": {
"header": {
"username": "awesome",
"password": "jsonrocks"

},
"body": {
"diamond_id": 12345678
}
}
}


Get Single Diamond - sample response
{
"response":  {
"header": {
"error_code": 0,
"error_message": ""

},
"body": {
"diamond":  {
"diamond_id": 12345678,
"shape": "Round",
"size": 0.250,
"color": "H",
"fancy_color_dominant_color": "",
"fancy_color_secondary_color": "",
"fancy_color_overtone": "",
"fancy_color_intensity": "",
"clarity": "VVS2",
"cut": "Fair",
"symmetry": "Good",
"polish": "Good",
"depth_percent": 62.7,
"table_percent": 62.00,
"meas_length": 4.05,
"meas_width": 4.13,
"meas_depth": 2.53,
"girdle_min": "",
"girdle_max": "",
"girdle_condition": "",
"culet_size": "None",
"culet_condition": "",
"fluor_color": "",
"fluor_intensity": "None",
"has_cert_file": true,
"country": "USA",
"city": "New York",
"lab": "GIA",
"total_purchase_price": 5250.0000,
"total_sales_price": 5307.0000,
"currency_code": "USD",
"currency_symbol": "$",
"total_sales_price_in_currency": 5307.0000,
"cert_num": "123456789",
"stock_num": "ABCDEFG",
"has_sarineloupe" : true,
"sarineloupe_url": "https://api.sarine.com/viewer/v1/HFJIdgr/KJ45"
} ,
"seller": {
"account_id": 12345,
"company": "Ben Jerry",
"name": "Ben goldfish",
"email": "Bem@comp.com",
"phone": "1-123-456-7890",
"country": "USA",
"state": "NY",
"city": "New York"
}
}
}
}


Error Format
{
"response": {
"header": {
"error_code": error_code,
"error_message": "error_message"

},
"body": {
}
}
}


Linking to the certificate scan
To get the grading certificate: If HasCertFile=true then you can use the one following urls:
To get the grading certificate:
http://www.diamondselections.com/GetCertificate.aspx?diamondid=XXX
To get the grading certificate path:
http://www.diamondselections.com/GetCertificatePath.aspx?diamondid=XXX

View a code sample