Prices API

General Information

This new web service lets you download your specific purchase prices and the recommended sales prices of our products.

Each customer account is linked to one specific pricelist. We use this link to provide your specific purchase prices.

JSON/REST

The data is provided through one endpoint: get_prices

This webservice is very similar to the other web services in our API's. Therefore:

  • Method to be used is POST

  • Encoding is UTF-8

  • The API must be called with the https prefix

In order to use this system, valid credentials are required. If you do not have one yet, please request an account.

Request an account

If you wish to test your code, you can do so with a tool like Postman.

Integration

Endpoint Settings

Environment
Server
Database
TEST
https://apitest.stanleystella.com
mig_api
PROD
https://api.stanleystella.com
production_api

Note : the test endpoint is deemed to be used with eligible partners when we develop new features with our API. You should connect to our prod environment.

Get JSON

Service
URL
Get Prices/webrequest/products/get_prices

JSON format as input  

Submit this JSON message as input. There are no filters possible on this call.

{
    "jsonrpc":"2.0",
    "method":"call",
    "params":{
        "db_name":"production_api",
        "password":"YOUR_PASSWORD",
        "user":"YOUR_LOGIN"
    },
    "id":0
}
JSON format as output

The following JSON is the output of the call.

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "[
        {
            \"B2BSKUREF\": \"STSW131C002XS\",
            \"PurchasePriceList\": \"K100 (EUR)\",
            \"PurchasePrice\": 14.5,
            \"RecommendedSalesPriceLT10pcs\": 27.55,
            \"RecommendedSalesPriceGT10pcs\": 27.55,
            \"RecommendedSalesPriceGT50pcs\": 26.1,
            \"RecommendedSalesPriceGT100pcs\": 24.65,
            \"RecommendedSalesPriceGT250pcs\": 23.2,
            \"RecommnededSalesPriceGT500pcs\": 21.75,
            \"RecommendedSalesPriceGT1000pcs\": 20.75
        },
        ...
    ]"
}


PHP code example with curl

Here is an example of PHP code used to call the Colours JSON/REST service. This code is given as illustration.

$url = "https://api.stanleystella.com/webrequest/products/get_prices";
$jsonData = array(
'jsonrpc' => '2.0',
'method' => 'call',
'params' => array(
'db_name' => "production_api",
'password' => "YOUR_PASSWORD",
'user' => "YOUR_LOGIN",
),
'id' => 0
);
$ch = curl_init($url);
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$result = curl_exec($ch);
$jsonDataDecoded = json_decode(json_decode($result)->result, true);
curl_close($ch);