If you want to supply your sales data to Feefo in real time, you’re going to want to use our API. Sending your data automatically via the Feefo API means that your customers can start receiving feedback requests almost immediately after the transaction, which is a great way to start increasing your response rates.  


Sending separate order requests 

For every order line of each transaction, you’ll need to send a separate request to the API. These are linked together using the orderref parameter.  


Adding URL parameters  

To use this method, a call is made to the following secure URL: 


Depending on your requirements, the URL has several required and optional parameters that need to be added. For more information about each API Parameter take a look at our  API Parameter Summary. 

An example for there would be tags. Tags define the sales/product attributes for uploaded sales data allowing you to create subsets of the full data which can then be used to generate reports filtered by the tags. Tagging associates one or more ‘key value pairs’ to sales and feedback data. The tags can then be used to analyse the data in complex ways through the Feefo Hub. The full list of available tags is shown in Sales And Product Tags. 

Tags are added as comma separated ‘key value pairs’ in the following formats:

For GET: tags=[keyA%3DvalueA,keyB%3DvalueB…]

e.g. tags=[saleschannel%3Dweb,productline%3DCar%20Insurance]

For POST: tags=[keyA=valueA,keyB=valueB…]

e.g. tags=[saleschannel=web,productline=Car Insurance]

Note: Tags are combined as a logical AND. This means that in the examples above, the sale must have both tags present to be included in the filter.

Having added tags to the relevant sales lines, the tag can then be used to filter the data for reporting. Where multiple tags have been added to a single sale, filtering can be set up using each tag individually or they can be combined to create complex filtering operations to identify the sales concerned.  


Keeping your customer data secure 

When sending data via our API, we strongly recommend that the request is made using HTTP POST as this ensures that all your customer data is encoded and kept secure and separate from the URL. 

The request can also be submitted using HTTP EG. This means, however, that the parameters will likely be included in the request URL, and therefore exposes customer data as plain text anywhere the request URL is displayed. 


How to use OAuth 2.0 authentication to send your sales data 

You first need to use your App Key credentials to create an access token. The access token can then be used on subsequent requests to access Feefo API resources. 

See more details on how to generate token here

Once token is generated you should be able to send a new sale using the URL below 

https://api.feefo.com/api/20/entersaleremotely   

With required parameters in it. Sample of the URL with parameters: 

https://api.feefo.com/api/20/entersaleremotely?merchantidentifier={{your-merchant-identifier}}&email={{customer-email-address}}&name={{customer-name}}&description=Sneakers&orderref=remotesale&date=14-08-2019&vendorref=pp1 


How to use API Key authentication to send your sale data.   

An example with PHP:

<?php
//************************************************************** 
//Feefo php example. 
//You will need the PHP cURL module installed for this to run. 
//The Feefo URL
$url = 'https://api.feefo.com/api/entersaleremotely'; 
//The parameters
$params = array(  
    'apikey' => '2de0a1ad-331b-49b1-a3d2-39a908c05209', 
    'merchantidentifier' => 'example-retail-merchant', 
    'email' => 'someone@merchantsemailaddress.com',   
    'name' => 'John',  
    'date' => '2012-11-06',  
    'description' => 'Falcon Mach V', 
    'productsearchcode' => '132',  
    'orderref' => 'order_query_test1', 
    'currency' => 'EUR', 
    'amount' => '2599.90',  
    'productlink' => 'http://www.exampleretailmerchant.com/product_info.php?products_id=132', 
    'customerref' => 'GTD', 
    'locale' => 'fr' 
);
//Build up the query and use curl to execute it. 
$data = http_build_query($params, '', '&');  
$ch=curl_init();  
    curl_setopt($ch, CURLOPT_URL, $url);  
    curl_setopt($ch, CURLOPT_POST, 1);  
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
$reply=curl_exec($ch);  
curl_close($ch);  
echo "The response received was: $reply";  
?>