🚧
This is a low level API, we recommend you to use the simple recommendation route to enable easy configuration via the Merchant Dashboard.
Get a list of items that have been purchased together with the currently viewed item in the same session by other customers.
You can pass an array of rules to the widget to filer widget results.
An example of rules object for different types of data:
[{
type: 'text',
name: 'brand',
values: [{value: ['Some-Test-Brand']}, {value: ['Some-Other-Brand']}]
}, {
type: 'range',
name: 'price',
values: [{from: 10}, {to: 20}, {from: 10, to: 20}]
}, {
type: 'category',
name: 'category',
values: [{value: ['Top-Level']}, {value: ['Top-Level', 'Second-level']}]
}]
Path Paramsitem_idsstringrequired
Item IDs separated by comma
Body Paramst_clientdate-timerequireduserobjectrequireduser objectuidstringrequired
max length: 32 characters
sidstringrequired
max length: 32 characters
emailstringipstringuastringlangarray of stringsADD stringoffsetint32Defaults to 0limitint32Defaults to 5
max = 20
callbackstringlogbooleanlabelstring
Optional recommendation label (by providing this parameter you'll be able to view analytcs info in Merchant Dashboard for this recommendation widget)
rulesarray of objects
Rules to filter recommendation results
ADD object
Responses
200
200
Response bodyobjectmetaobjectlimitintegerDefaults to 0offsetintegerDefaults to 0user_idstringitem_idsarray of stringstotalintegerDefaults to 0ridstringitemsarray of objectsobjectproduct_urlstringcolorarrayvariants_idsarray of stringsdescriptionstringdiscountarray of integerscreated_atstringavailabilitybooleanDefaults to truevariantsarraytitlestringthumbnail_urlstringpricearray of numbersstickersobjectstickers objectidstringskuarray of stringsbrandstringquantityintegerDefaults to 0color_variantsintegerDefaults to 0image_urlstringtagsarray of stringscategoryarray of objectsobjectcategory2stringcategory3stringcategory4stringcategory1string
Credentials
Header 2e963f3e-38bd-4c00-9636-c00e48945eb7
Shell
curl --request POST --url https://api-v3.findify.io/v3/recommend/items/6411354119,10116071626/bought/bought --header "X-Key: 2e963f3e-38bd-4c00-9636-c00e48945eb7" --header "Content-Type: application/json" --data '{"user":{"lang":["en-GB"],"uid":"test1","sid":"ssid","email":"test@test .com","ip":"192.168.0.1","ua":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"},"t_client":1484742065791,"offset":0,"limit":5,"log":false,"label":"bought-bought-recommendation"}'
Javascript Default
//Please, don't forget to include the SDK script
//Which you can find here: https://github.com/findify/javascript-sdk
var client = FindifySDK.init({
key: '2e963f3e-38bd-4c00-9636-c00e48945eb7',
user: {
uid: 'test1',
sid: 'ssid',
email: 'test@test .com'
},
log: false
});
var request = {
offset: 0,
limit: 5,
item_ids: ['6411354119', '10116071626'],
label: 'bought-bought-recommendation'
};
client.recommendations('frequentlyPurchased', request).then(function (response) {
console.log(response);
});
Javascript Node
var request = require("request");
var options = {
method: 'POST',
headers: {
"X-key": "2e963f3e-38bd-4c00-9636-c00e48945eb7"
},
url: 'https://api-v3.findify.io/v3/recommend/items/6411354119,10116071626/bought/bought',
body: {
user: {
lang: ['en-GB'],
uid: 'test1',
sid: 'ssid',
email: 'test@test .com',
ip: '192.168.0.1',
ua: 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'
},
t_client: 1484742065791,
offset: 0,
limit: 5,
log: false,
label: 'bought-bought-recommendation'
},
json: true
};
request(options, function(error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
PHP
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Key', '2e963f3e-38bd-4c00-9636-c00e48945eb7');
$api_instance = new Swagger\Client\Api\DefaultApi();
$recommendation = new \Swagger\Client\Model\RecommendationRequest(array(
'user' => array(
'uid' => 'test1',
'sid' => 'ssid',
'email' => 'test@test .com',
'ip' => '192.168.0.1',
'ua' => 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36',
'lang' => array(
'en-US',
'en-GB',
'no'
)
),
't_client' => '1484741395471',
'offset' => 0,
'limit' => 5,
'log' => false,
'label' => 'bought-bought-recommendation'
));
try {
$result = $api_instance->recommendItemsItemIdBoughtBoughtPost('6411354119,10116071626', $recommendation);
echo $result;
}
catch (Exception $e) {
echo 'Exception when calling DefaultApi->recommendItemsItemIdBoughtBoughtPost: ', $e->getMessage(), PHP_EOL;
}
?>