1. Accueil
  2. API
  3. Add Transaction

Add Transaction

/addtransaction

This function allows to save transactions for your existing members or for new ones.

  • Endpoint: https://app.fideljet.com/rest/addtransaction
  • Type: Post

 

apikeyAPI KEYYou can get it from your profil
https://app.Fideljet.com/profil then apikey section
emailEmail addressContact email address, mandatory if mobile value is empty
mobileMobileContact mobile phone
mandatory if email value is empty
nameNameContact name
amountTransaction amount Transaction amount
pos_idPoint of salePoint of sale id, you can get pos_id from Loyalty->Points of sale
createCreate unexisting membersPossible values : 0 or 1
external_idExternal transaction IdExternal transaction Id

 

Here is a PHP exemple:

<?php 
$curl = curl_init(); $apikey = "YOUR_API_KEY"; 
$email = "[email protected]"; // Email address 
$mobile = "+3300000000"; // International mobile format with + 
$name = "Name"; // Contact name
$amount = "250"; // Transaction amount  
$pos_id = '_Pos_id_'; // Point of sale id 
$create = 0; // 1 or 0 to create or not unexisting members  
$external_id = '_External_id_';// External id
/* Exemple result { "message":"Success", "success":true } */ 
curl_setopt_array($curl, array( CURLOPT_URL => "https://app.fideljet.com/rest/addtransaction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"apikey\":\"$apikey\",\"email\":\"$email\",\"mobile\":\"$mobile\",\"name\":\"$name\",\"amount\":\"$amount\",\"pos_id\":\"$pos_id\",\"create\":\"$create\",\"external_id\":\"$external_id\"}",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"content-type: application/json"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

?>

Cet article vous a-t-il été utile ? Oui Non