/addtransaction
This function allows to save transactions for your existing members or for new ones.
- Endpoint: https://app.fideljet.com/rest/addtransaction
- Type: Post
apikey | API KEY | You can get it from your profil https://app.Fideljet.com/profil then apikey section |
Email address | Contact email address, mandatory if mobile value is empty | |
mobile | Mobile | Contact mobile phone mandatory if email value is empty |
name | Name | Contact name |
amount | Transaction amount | Transaction amount |
pos_id | Point of sale | Point of sale id, you can get pos_id from Loyalty->Points of sale |
create | Create unexisting members | Possible values : 0 or 1 |
external_id | External transaction Id | External 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; } ?>