Pricing API
You need to have a ClientID and ApplicationID before you can use this API.
Get a recommended price
To obtain a recommended price you should make the following call (including the appropriate GET parameters):
http://pricing.mauritskaptein.com/getPrice.php?
cid=[clientID]
&aid=[applicationID]
&hash=[securityHash]
The server will respond with a json object which will look as follows:
{
"error": false,
"advice": {
"id": "2b29f68c13bc518a220c25980fd241e8",
"price": "23.95",
"rowId": "10"
}
}
You can get the recommended price using responseObject.advice.price. If any errors occur then responseObject.error will not be false and an informative error message can be obtained by displaying responseObject.error
This code assumes that you have parsed the JSON object to
responseObject.
Logging the success of a call
If the product is purchased for the recommended price we need feedback to train the models. Hence, you should make a call to:
http://pricing.mauritskaptein.com/logSuccess.php?
cid=[clientID]
&aid=[applicationID]
&hash=[securityHash]
&adviceId=responseObject.advice.id
&rowId=responseObject.advice.rowId
This call should be made ONLY if the product is actually purchased for the recommended price. Keep in mind the additional parameters.
The server will respond again with a json object:
This code assumes again that you have parsed the JSON object to
responseObject.
{
"error": false,
"message: "Success logged"
}
Recommendations of usage:
Please keep the following in mind:
- If you dont have the neccesary ID's, contact Maurits Kaptein
- From the clients side, do implement a time-out and a default value in case server responses on the getAdvice call are slow
- If you do not log the succes of displayed prices the whole thing will have no meaning really and will just end up pitching prices pretty much randomly to your customers
- Hence, do make sure you implement the
logSuccesscall. - The API works well up to 100 calls a minute. If you plan to extend this load please contact us.
For an example of the calls see: an example.
To setup the prices see: setup.