Sending data via API 

 

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 Paramenter take a look at our API Parameter Summary. 

Keeping your customer data secure 

When sending data via our API, we strongly recommend that the request is made using POST HTTP 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 GET HTTP. 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. 

 

An example of using our API to send your sales data with PHP is shown below: 

<?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',  

    '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";  

?>