Rapaport Developer Documentation
Introduction
Welcome to Rapaport’s Developer and API & SDK integration guides.
This platform is a core part of Rapaport’s mission to support our members with diamond pricing information and selling opportunities.
These documents explain how to connect to Rapaport’s APIs and SDKs, integrate the Rapaport Price Lists in your diamond software, connect your systems or inventory with RapNet, and use RapNet Instant Inventory to showcase diamonds and/or jewelry in your online store.
API and SDK Overview
To get the most value out of RapNet, our APIs and SDKs are designed to allow companies of any shape or size to build robust integrations into their software, website, or RapNet itself.
We offer both APIs and Software Development Kits (SDKs) as methods for integrating development software.
Rapaport APIs:
Rapaport SDK Packages:
Note: To use our APIs or SDKs, you will need to subscribe to a paid Rapaport plan and have a Login Token.
Login Token Requirements
To use our new API codes or SDK packages, you will need to create a Login Token. The Login Token works with API credentials which you can activate from your RapNet account.
Use the same Token for all API services.
Create the Login Token
- Go to RapNet API Access.
- Activate Your API Credentials which contain a Client ID and Client Secret.
- Copy and insert these credentials to use when creating the token. See example:
- Copy the Token response and place it the Authorization Tab of your API.
Note: When obtaining the authorization token, the response is valid for 24 hours.
Use the token until it is expired and then re-aquire a new token .
You can use the same token for all API applications.
For 3rd party Token activation,
Please select the 3rd Party Vendor Token Tab.
POST /api/get HTTP/1.1
Host: authztoken.api.rapaport.com
Content-Type: application/json
Content-Length: 142
{
"client_id":"s78qaoOd9efr5dQm9hsX3gZ",
"client_secret":"B-4kr4b2nwonivo08tb-Z6B-L7sNJkjDnyZMGPbGbCvpfRcRf5FyGd"
}
Token -Response
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik16aERRMFExTURFeVJqSTNRa0k0TTBGRVJUZzFNekUzTWtOQ09UTXhNREZDTVVZM1JURkNNZyJ9.eyJodHRwOi8vcmFwYXBvcnQuY29tL3VzZXIiOnsiYWNjb3VudElkIjoxMTUwNzR9LCJodHRwOi8vcmFwYXBvcnQuY29tL3Njb3BlIjpbInByaWNlTGlzdFdlZWtseSIsImluc3RhbnRJbnZlbnRvcnkiLCJtYW5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udEludmVudG9yeSIsIm1lbWJlckRpcmVjdG9yeSIsInNlYXJjaCIsImluc3RhbnRJbnZlbnRvcnlTZXR1cCIsIm1hbmFnZUxpc3RpbmdzRmlsZSIsImJ1eVJlcXVlc3RzQWRkIiwiaXRlbVNoYXJlZCIsInRyYWRlQ2VudGVyIiwibXlDb250YWN0cyIsIm1lbWJlclJhdGluZyIsImNoYXQiLCJtYW5hZ2VMaXN0aW5ncyIsImxlYWRzIiwiYWRtaW4iLCJidXlSZXF1ZXN0cyJdfSwiaXNzIjoiaHR0cHM6Ly9yYXBhcG9ydC5hdXRoMC5jb20vIiwic3ViIjoiZ1Vja0lRejBSaEVqQ0R4Z2ZOenUyNE5zd3M2NGo5VXBAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vYXBpZ2F0ZXdheS5yYXBuZXRhcGlzLmNvbSIsImlhdCI6MTcwODIwODUyOSwiZXhwIjoxNzA4Mjk0OTI5LCJhenAiOiJnVWNrSVF6MFJoRWpDRHhnZk56dTI0TnN3czY0ajlVcCIsInNjb3BlIjoiYXBpR2F0ZXdheSIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.OzPeC6iAiUQtPKreRVElt4had4zLkBsH9uTUOtwe9fE_99YM1GkouMmuwAUwXn1JptrUGLhv-VwtxvI_MnVLpRVMw2P7rcFtnQ1QPQJNxuar73vXTrORKP0i3nRnyNrsacKhi5KAMBlSVO-JmgAUHbJM5C42cpjG0c4GneZym1WlnErX8Ly2OrTGa3wjwZN3qIIaygjn0Fxrk0c11eNhFXeBqC_C1E3ViiRlNMM9FXRM-nwy9ZJ9DOvWU-IRURQsvmv7awEX-U1hzVPxBaI6JG894EYBkS_BYcl5aOvFxneGMT2hHUQ3yJTnmO9AD58p4HWzv5dOIcnWY9AnX32z_w",
"scope": "apiGateway",
"expires_in": 43825,
"token_type": "Bearer"
}
Place Bearer Token
3rd Party Vendor Access
This is used RapNet by Vendors who need 3rd party access.
Please contact customer service to setup
your redirect URL's on our system
- Request authentication from Auth0 site.
Paste the following URL into your browser : https://rapaport.auth0.com/authorize?&response_type=code&client_id=00000000000000000&redirect_uri=https://localhost:5000&audience=https://apigateway.rapnetapis.com&scope=manageListings%20priceListWeekly%20instantInventory%20offline_access
Field | Value |
---|---|
response_type | Should be code |
client_id | System setting: Authorization client id |
redirect_uri | Redirect uri for redirection after authentication should be on of the callbacks specified in authorization client |
audience | System setting: Audience, should be https://apigateway.rapnetapis.com |
scope | System setting: Scope to access API Gateway, should include required scope per API separated by encoded space (%20), for example: manageListings%20priceListWeekly%20instantInventory |
Note: Replace the following values in the URL :
client_id=0000000000000
redirect_uri=https://localhost:5000
scope=manageListings%20priceListWeekly%20instantInventory
2. Log in with RapNet credentials.
3. A code is created in the browser.
Copy the “code” to the following API.
POST /api/get HTTP/1.1
Host: authztoken.api.rapaport.com
Content-Type: application/json
Content-Length: 351
curl --location --request POST 'https:
--header 'Content-Type: application/json' \
--data-raw '{
"client_id":"1YC9erJlqmXupO7PTUoMr2ecz2YVS7A4",
"client_secret":"yzZUZS_GAtllblJzCfbeW2Rsx_u6yuOT4eitZWiZQi0K1zwGIBgT2pYKZ0x-m_Wn",
"code": "k-LUTtCvZXYfOXObfJ0cW_EgpPjrSPxB5uV8hMpezFfPs",
"redirect_uri": "https://localhost:5000"
}'
Field | Value |
---|---|
client_id | System setting: Authorization client id |
client_secret | System setting: Authorization client secret |
code | Authorization code received from Auth0 during authentication |
redirect_uri | Redirect uri for redirection after authentication should be on of the callbacks specified in authorization client |
The response
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik16aERRMFExTURFeVJqSTNRa0k0TTBGRVJUZzFNekUzTWtOQ09UTXhNREZDTVVZM1JURkNNZyJ9",
"scope": "offline_access",
"expires_in": 86400,
"refresh_token": "ar0m2oa6lhEXRzCkmiSs2KxaxjwzGX1r1sb",
"token_type": "Bearer"
}
4. Replace from the response.
“code”: “k-LUTtCvZXYfOXObfJ0cW_EgpPjrSPxB5uV8hMpezFfPs”,
with
“refresh_token”: “ar0m2oa6lhEXRzCkmiSs2KxaxjwzGX1r1sb”,
5. Use the access token in the response to call the API.
RapNet Api's
Click on the API that you wish to use:
SDK Packages
To use a specific Software Development Kit, there are 3 steps.
- Activate your API Credentials.
- Create your Login Token – as explained above.
- Download your required SDK package.
- Choose from the menu and go to the corresponding SDK.
SDK
Download one of the SDK packages below, then click on the SDK link :
SDK Package Download
Install package:
composer require rapnet/price_list
Initialize:
use Rapnet\RapnetPriceList\Index;
require_once './vendor/autoload.php';
Get token:
$pricelist = new Index($clientId, $clientSecret);
$token = $pricelist->getAuthTokenMachineToMachinMethod()
Install package:
composer require rapnet/instant_inventory
Initialize:
use Rapnet\RapnetInstantInventory\Index;
require_once './vendor/autoload.php';
Get token:
$iinventory = new Index($clientId, $clientSecret);
$token = $iinventory->createAuthorizationCodeToken()
Install package:
composer require rapnet/rapnet_media_upload
This will install package with production environment values, but if you want to have another environment values you can run script manually
composer run-script build-dev
composer run-script build-stage
Initialize:
use Rapnet\RapnetMediaUpload\Index;
require_once './vendor/autoload.php';
Get token:
$media = new Index($clientId, $clientSecret);
$token = $media->createAuthorizationCodeToken()