Envoi de la réponse du webhook
curl --request POST \
--url https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"transaction_id": "EFB.144358",
"amount": 1000,
"benefice": 1000,
"commission": 0,
"destination": "0500156008",
"fee": 0,
"response": "operation success",
"error": "message de l'erreur (si transaction Echec)",
"service_id": 14,
"customer_name": "KAYBIC AFRICA",
"state": "FAILED",
"custom_data": "custom_data",
"ipn_url": "",
"provider_id": null,
"sms_link": 0,
"created_at": "2022-10-18T02:38:44.000+00:00",
"updated_at": "2022-10-18T02:38:44.000+00:00",
"ipn_state": 0,
"w_amount_after_transaction": "",
"p_last_wallet_amount": 11,
"p_new_wallet_amount": null,
"p_id": 1,
"hash": ""
}
EOFimport requests
url = "https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook"
payload = {
"transaction_id": "EFB.144358",
"amount": 1000,
"benefice": 1000,
"commission": 0,
"destination": "0500156008",
"fee": 0,
"response": "operation success",
"error": "message de l'erreur (si transaction Echec)",
"service_id": 14,
"customer_name": "KAYBIC AFRICA",
"state": "FAILED",
"custom_data": "custom_data",
"ipn_url": "",
"provider_id": None,
"sms_link": 0,
"created_at": "2022-10-18T02:38:44.000+00:00",
"updated_at": "2022-10-18T02:38:44.000+00:00",
"ipn_state": 0,
"w_amount_after_transaction": "",
"p_last_wallet_amount": 11,
"p_new_wallet_amount": None,
"p_id": 1,
"hash": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_id: 'EFB.144358',
amount: 1000,
benefice: 1000,
commission: 0,
destination: '0500156008',
fee: 0,
response: 'operation success',
error: 'message de l\'erreur (si transaction Echec)',
service_id: 14,
customer_name: 'KAYBIC AFRICA',
state: 'FAILED',
custom_data: 'custom_data',
ipn_url: '',
provider_id: null,
sms_link: 0,
created_at: '2022-10-18T02:38:44.000+00:00',
updated_at: '2022-10-18T02:38:44.000+00:00',
ipn_state: 0,
w_amount_after_transaction: '',
p_last_wallet_amount: 11,
p_new_wallet_amount: null,
p_id: 1,
hash: ''
})
};
fetch('https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'transaction_id' => 'EFB.144358',
'amount' => 1000,
'benefice' => 1000,
'commission' => 0,
'destination' => '0500156008',
'fee' => 0,
'response' => 'operation success',
'error' => 'message de l\'erreur (si transaction Echec)',
'service_id' => 14,
'customer_name' => 'KAYBIC AFRICA',
'state' => 'FAILED',
'custom_data' => 'custom_data',
'ipn_url' => '',
'provider_id' => null,
'sms_link' => 0,
'created_at' => '2022-10-18T02:38:44.000+00:00',
'updated_at' => '2022-10-18T02:38:44.000+00:00',
'ipn_state' => 0,
'w_amount_after_transaction' => '',
'p_last_wallet_amount' => 11,
'p_new_wallet_amount' => null,
'p_id' => 1,
'hash' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook"
payload := strings.NewReader("{\n \"transaction_id\": \"EFB.144358\",\n \"amount\": 1000,\n \"benefice\": 1000,\n \"commission\": 0,\n \"destination\": \"0500156008\",\n \"fee\": 0,\n \"response\": \"operation success\",\n \"error\": \"message de l'erreur (si transaction Echec)\",\n \"service_id\": 14,\n \"customer_name\": \"KAYBIC AFRICA\",\n \"state\": \"FAILED\",\n \"custom_data\": \"custom_data\",\n \"ipn_url\": \"\",\n \"provider_id\": null,\n \"sms_link\": 0,\n \"created_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"updated_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"ipn_state\": 0,\n \"w_amount_after_transaction\": \"\",\n \"p_last_wallet_amount\": 11,\n \"p_new_wallet_amount\": null,\n \"p_id\": 1,\n \"hash\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"EFB.144358\",\n \"amount\": 1000,\n \"benefice\": 1000,\n \"commission\": 0,\n \"destination\": \"0500156008\",\n \"fee\": 0,\n \"response\": \"operation success\",\n \"error\": \"message de l'erreur (si transaction Echec)\",\n \"service_id\": 14,\n \"customer_name\": \"KAYBIC AFRICA\",\n \"state\": \"FAILED\",\n \"custom_data\": \"custom_data\",\n \"ipn_url\": \"\",\n \"provider_id\": null,\n \"sms_link\": 0,\n \"created_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"updated_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"ipn_state\": 0,\n \"w_amount_after_transaction\": \"\",\n \"p_last_wallet_amount\": 11,\n \"p_new_wallet_amount\": null,\n \"p_id\": 1,\n \"hash\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_id\": \"EFB.144358\",\n \"amount\": 1000,\n \"benefice\": 1000,\n \"commission\": 0,\n \"destination\": \"0500156008\",\n \"fee\": 0,\n \"response\": \"operation success\",\n \"error\": \"message de l'erreur (si transaction Echec)\",\n \"service_id\": 14,\n \"customer_name\": \"KAYBIC AFRICA\",\n \"state\": \"FAILED\",\n \"custom_data\": \"custom_data\",\n \"ipn_url\": \"\",\n \"provider_id\": null,\n \"sms_link\": 0,\n \"created_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"updated_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"ipn_state\": 0,\n \"w_amount_after_transaction\": \"\",\n \"p_last_wallet_amount\": 11,\n \"p_new_wallet_amount\": null,\n \"p_id\": 1,\n \"hash\": \"\"\n}"
response = http.request(request)
puts response.read_bodyAPI references
Réponses Webhook (IPN)
Envoie une notification IPN au partenaire après le traitement d’une transaction.
POST
https://proxy-airtime.easytransfert.app/api_v1/transaction
/
votre_url_webhook
Envoi de la réponse du webhook
curl --request POST \
--url https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"transaction_id": "EFB.144358",
"amount": 1000,
"benefice": 1000,
"commission": 0,
"destination": "0500156008",
"fee": 0,
"response": "operation success",
"error": "message de l'erreur (si transaction Echec)",
"service_id": 14,
"customer_name": "KAYBIC AFRICA",
"state": "FAILED",
"custom_data": "custom_data",
"ipn_url": "",
"provider_id": null,
"sms_link": 0,
"created_at": "2022-10-18T02:38:44.000+00:00",
"updated_at": "2022-10-18T02:38:44.000+00:00",
"ipn_state": 0,
"w_amount_after_transaction": "",
"p_last_wallet_amount": 11,
"p_new_wallet_amount": null,
"p_id": 1,
"hash": ""
}
EOFimport requests
url = "https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook"
payload = {
"transaction_id": "EFB.144358",
"amount": 1000,
"benefice": 1000,
"commission": 0,
"destination": "0500156008",
"fee": 0,
"response": "operation success",
"error": "message de l'erreur (si transaction Echec)",
"service_id": 14,
"customer_name": "KAYBIC AFRICA",
"state": "FAILED",
"custom_data": "custom_data",
"ipn_url": "",
"provider_id": None,
"sms_link": 0,
"created_at": "2022-10-18T02:38:44.000+00:00",
"updated_at": "2022-10-18T02:38:44.000+00:00",
"ipn_state": 0,
"w_amount_after_transaction": "",
"p_last_wallet_amount": 11,
"p_new_wallet_amount": None,
"p_id": 1,
"hash": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_id: 'EFB.144358',
amount: 1000,
benefice: 1000,
commission: 0,
destination: '0500156008',
fee: 0,
response: 'operation success',
error: 'message de l\'erreur (si transaction Echec)',
service_id: 14,
customer_name: 'KAYBIC AFRICA',
state: 'FAILED',
custom_data: 'custom_data',
ipn_url: '',
provider_id: null,
sms_link: 0,
created_at: '2022-10-18T02:38:44.000+00:00',
updated_at: '2022-10-18T02:38:44.000+00:00',
ipn_state: 0,
w_amount_after_transaction: '',
p_last_wallet_amount: 11,
p_new_wallet_amount: null,
p_id: 1,
hash: ''
})
};
fetch('https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'transaction_id' => 'EFB.144358',
'amount' => 1000,
'benefice' => 1000,
'commission' => 0,
'destination' => '0500156008',
'fee' => 0,
'response' => 'operation success',
'error' => 'message de l\'erreur (si transaction Echec)',
'service_id' => 14,
'customer_name' => 'KAYBIC AFRICA',
'state' => 'FAILED',
'custom_data' => 'custom_data',
'ipn_url' => '',
'provider_id' => null,
'sms_link' => 0,
'created_at' => '2022-10-18T02:38:44.000+00:00',
'updated_at' => '2022-10-18T02:38:44.000+00:00',
'ipn_state' => 0,
'w_amount_after_transaction' => '',
'p_last_wallet_amount' => 11,
'p_new_wallet_amount' => null,
'p_id' => 1,
'hash' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook"
payload := strings.NewReader("{\n \"transaction_id\": \"EFB.144358\",\n \"amount\": 1000,\n \"benefice\": 1000,\n \"commission\": 0,\n \"destination\": \"0500156008\",\n \"fee\": 0,\n \"response\": \"operation success\",\n \"error\": \"message de l'erreur (si transaction Echec)\",\n \"service_id\": 14,\n \"customer_name\": \"KAYBIC AFRICA\",\n \"state\": \"FAILED\",\n \"custom_data\": \"custom_data\",\n \"ipn_url\": \"\",\n \"provider_id\": null,\n \"sms_link\": 0,\n \"created_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"updated_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"ipn_state\": 0,\n \"w_amount_after_transaction\": \"\",\n \"p_last_wallet_amount\": 11,\n \"p_new_wallet_amount\": null,\n \"p_id\": 1,\n \"hash\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"EFB.144358\",\n \"amount\": 1000,\n \"benefice\": 1000,\n \"commission\": 0,\n \"destination\": \"0500156008\",\n \"fee\": 0,\n \"response\": \"operation success\",\n \"error\": \"message de l'erreur (si transaction Echec)\",\n \"service_id\": 14,\n \"customer_name\": \"KAYBIC AFRICA\",\n \"state\": \"FAILED\",\n \"custom_data\": \"custom_data\",\n \"ipn_url\": \"\",\n \"provider_id\": null,\n \"sms_link\": 0,\n \"created_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"updated_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"ipn_state\": 0,\n \"w_amount_after_transaction\": \"\",\n \"p_last_wallet_amount\": 11,\n \"p_new_wallet_amount\": null,\n \"p_id\": 1,\n \"hash\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://proxy-airtime.easytransfert.app/api_v1/transaction/votre_url_webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_id\": \"EFB.144358\",\n \"amount\": 1000,\n \"benefice\": 1000,\n \"commission\": 0,\n \"destination\": \"0500156008\",\n \"fee\": 0,\n \"response\": \"operation success\",\n \"error\": \"message de l'erreur (si transaction Echec)\",\n \"service_id\": 14,\n \"customer_name\": \"KAYBIC AFRICA\",\n \"state\": \"FAILED\",\n \"custom_data\": \"custom_data\",\n \"ipn_url\": \"\",\n \"provider_id\": null,\n \"sms_link\": 0,\n \"created_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"updated_at\": \"2022-10-18T02:38:44.000+00:00\",\n \"ipn_state\": 0,\n \"w_amount_after_transaction\": \"\",\n \"p_last_wallet_amount\": 11,\n \"p_new_wallet_amount\": null,\n \"p_id\": 1,\n \"hash\": \"\"\n}"
response = http.request(request)
puts response.read_bodyCette page documente les notifications IPN (Instant Payment Notification) que vous recevrez sur votre webhook.
Description:
- Type: Webhook (callback POST)
- Utilisation: KAYBIC AFRICA envoie automatiquement les mises à jour de statut de transaction à l’URL IPN que vous avez configurée.
Exemple de réponse Webhook - SUCCESSFUL
{
"transaction_id": "EFB.144358",
"amount": 1000,
"benefice": 1000,
"commission": 0,
"destination": "0500156008",
"fee": 0,
"response": "operation success",
"error": "",
"service_id": 14,
"customer_name": "KAYBIC AFRICA",
"state": "SUCCESSFUL",
"custom_data": "custom_data",
"ipn_url": "",
"provider_id": null,
"sms_link": 0,
"created_at": "2022-10-18T02:38:44.000+00:00",
"updated_at": "2022-10-18T02:38:44.000+00:00",
"ipn_state": 0,
"w_amount_after_transaction": "",
"p_last_wallet_amount": 11,
"p_new_wallet_amount": null,
"p_id": 1,
"hash": ""
}
Exemple de réponse Webhook - FAILED
{
"transaction_id": "EFB.144359",
"amount": 2000,
"benefice": 2000,
"commission": 0,
"destination": "0670123456",
"fee": 0,
"response": "",
"error": "message de l'erreur",
"service_id": 10,
"customer_name": "KAYBIC AFRICA",
"state": "FAILED",
"custom_data": "transaction_ref_123",
"ipn_url": "",
"provider_id": null,
"sms_link": 0,
"created_at": "2022-10-18T02:38:44.000+00:00",
"updated_at": "2022-10-18T02:38:44.000+00:00",
"ipn_state": 0,
"w_amount_after_transaction": "",
"p_last_wallet_amount": 11,
"p_new_wallet_amount": null,
"p_id": 1,
"hash": ""
}
Champs importants
transaction_id: Identifiant unique de la transactionstate: Statut final de la transaction (SUCCESSFULouFAILED)response: Message de réponse en cas de succèserror: Message d’erreur en cas d’échecamount: Montant de la transactioncustom_data: Données personnalisées que vous avez envoyées lors de l’initiation
Notes
- ⚠️ Important: Vous devez retourner un code HTTP 200 pour confirmer la réception du webhook.
- Si vous ne répondez pas, KAYBIC AFRICA tentera de renvoyer la notification plusieurs fois.
- Les webhooks arrivent généralement dans les secondes suivant le traitement de la transaction.
- Utilisez le champ
custom_datapour réconcilier les transactions avec vos données internes.
Body
application/json
Example:
"EFB.144358"
Example:
1000
Example:
1000
Example:
0
Example:
"0500156008"
Example:
0
Example:
"operation success"
Example:
"message de l'erreur (si transaction Echec)"
Example:
14
Example:
"KAYBIC AFRICA"
Example:
"FAILED"
Example:
"custom_data"
Example:
""
Example:
null
Example:
0
Example:
"2022-10-18T02:38:44.000+00:00"
Example:
"2022-10-18T02:38:44.000+00:00"
Example:
0
Example:
""
Example:
11
Example:
null
Example:
1
Example:
""
⌘I

