Submit Journey Event
curl --request POST \
--url https://adhere-api.smartcomply.com/api/v1/journey/event/ \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"user_id": "<string>",
"session_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"device_id": "<string>",
"ip_address": "<string>",
"metadata": {
"amount": 123,
"currency": "<string>"
}
}
'import requests
url = "https://adhere-api.smartcomply.com/api/v1/journey/event/"
payload = {
"user_id": "<string>",
"session_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"device_id": "<string>",
"ip_address": "<string>",
"metadata": {
"amount": 123,
"currency": "<string>"
}
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
session_id: '<string>',
timestamp: '2023-11-07T05:31:56Z',
device_id: '<string>',
ip_address: '<string>',
metadata: {amount: 123, currency: '<string>'}
})
};
fetch('https://adhere-api.smartcomply.com/api/v1/journey/event/', 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://adhere-api.smartcomply.com/api/v1/journey/event/",
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([
'user_id' => '<string>',
'session_id' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z',
'device_id' => '<string>',
'ip_address' => '<string>',
'metadata' => [
'amount' => 123,
'currency' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$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://adhere-api.smartcomply.com/api/v1/journey/event/"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
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://adhere-api.smartcomply.com/api/v1/journey/event/")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://adhere-api.smartcomply.com/api/v1/journey/event/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "failed",
"data": [
"<unknown>"
],
"message": "<string>"
}{
"status": "failed",
"message": "Authentication credentials were not provided."
}Surveillance des transactions
Suivi du parcours utilisateur
Suivez et validez les événements de transaction utilisateur en séquence pour détecter un comportement hors ordre ou suspect.
POST
/
api
/
v1
/
journey
/
event
/
Submit Journey Event
curl --request POST \
--url https://adhere-api.smartcomply.com/api/v1/journey/event/ \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"user_id": "<string>",
"session_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"device_id": "<string>",
"ip_address": "<string>",
"metadata": {
"amount": 123,
"currency": "<string>"
}
}
'import requests
url = "https://adhere-api.smartcomply.com/api/v1/journey/event/"
payload = {
"user_id": "<string>",
"session_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"device_id": "<string>",
"ip_address": "<string>",
"metadata": {
"amount": 123,
"currency": "<string>"
}
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
session_id: '<string>',
timestamp: '2023-11-07T05:31:56Z',
device_id: '<string>',
ip_address: '<string>',
metadata: {amount: 123, currency: '<string>'}
})
};
fetch('https://adhere-api.smartcomply.com/api/v1/journey/event/', 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://adhere-api.smartcomply.com/api/v1/journey/event/",
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([
'user_id' => '<string>',
'session_id' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z',
'device_id' => '<string>',
'ip_address' => '<string>',
'metadata' => [
'amount' => 123,
'currency' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$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://adhere-api.smartcomply.com/api/v1/journey/event/"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
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://adhere-api.smartcomply.com/api/v1/journey/event/")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://adhere-api.smartcomply.com/api/v1/journey/event/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"device_id\": \"<string>\",\n \"ip_address\": \"<string>\",\n \"metadata\": {\n \"amount\": 123,\n \"currency\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "failed",
"data": [
"<unknown>"
],
"message": "<string>"
}{
"status": "failed",
"message": "Authentication credentials were not provided."
}L’API de parcours utilisateur suit les étapes critiques du flux de transaction d’un utilisateur via des points de contrôle définis. Elle valide que les événements attendus se produisent dans le bon ordre et signale un comportement suspect ou hors ordre en temps réel.
Soumettre un événement
Soumettez un événement de parcours utilisateur pour une évaluation de fraude.Endpoint
POST /api/v1/journey/event/
En-têtes
| En-tête | Valeur | Requis |
|---|---|---|
x-access-token | Votre clé secrète API | Oui |
Content-Type | application/json | Oui |
Paramètres de corps
| Paramètre | Type | Requis | Description |
|---|---|---|---|
user_id | string | Oui | Identifiant unique de l’utilisateur |
session_id | string | Oui | Identifiant de la session en cours |
event | string | Oui | Type d’événement : LOGIN, OTP_VERIFY, PAYMENT_INIT, PAYMENT_COMPLETE ou LOGOUT |
timestamp | string | Oui | Date-heure ISO-8601 de l’événement |
device_id | string | Non | Identifiant de l’appareil |
ip_address | string | Non | Adresse IP pendant l’événement |
metadata.amount | number | Non | Montant de la transaction le cas échéant |
metadata.currency | string | Non | Code de devise |
201 Created
{
"status": "Success",
"data": {
"status": "allow",
"risk_score": 0.12,
"reason": "Normal login pattern",
"session_state": "OTP_VERIFY",
"alert_triggered": false
},
"message": "success"
}
Obtenir l’état de la session
Récupérez l’état actuel et l’historique des événements d’une session.Endpoint
GET /api/v1/journey/session/{session_id}/
Paramètres de chemin
| Paramètre | Type | Requis | Description |
|---|---|---|---|
session_id | string | Oui | Identifiant de la session à récupérer |
200 OK
{
"status": "success",
"data": {
"session_id": "abc-123",
"user_id": "user-456",
"current_state": "PAYMENT_INIT",
"events": [],
"start_time": "2025-08-01T10:00:00Z"
},
"message": "success"
}
Effacer la session
Supprimez toutes les données stockées pour une session.Endpoint
DELETE /api/v1/journey/session/{session_id}/
Paramètres de chemin
| Paramètre | Type | Requis | Description |
|---|---|---|---|
session_id | string | Oui | Identifiant de la session à effacer |
204 No Content
{
"message": "Session cleared"
}
Analytique utilisateur
Récupérez les statistiques de fraude et de risque pour un utilisateur sur toutes les sessions.Endpoint
GET /api/v1/journey/analytics/user/{user_id}/
Paramètres de chemin
| Paramètre | Type | Requis | Description |
|---|---|---|---|
user_id | string | Oui | Identifiant de l’utilisateur |
200 OK
{
"status": "success",
"data": {
"user_id": "user-456",
"total_events": 42,
"average_risk_score": 0.08,
"blocked_events": 1,
"reviewed_events": 3,
"total_sessions": 10,
"average_session_risk": 0.07
},
"message": "Success"
}
Contrôle de santé
Vérifiez l’état de santé du service et le statut des dépendances.Endpoint
GET /api/v1/journey/health/
200 OK
{
"status": "healthy",
"broker": "connected",
"database": "connected",
"timestamp": "2025-08-01T10:00:00Z"
}
Codes d’erreur
| Code | Description |
|---|---|
200 | Succès |
201 | Événement traité avec succès |
400 | Champs manquants, malformés ou invalides |
401 | Échec de l’authentification ou clé API manquante |
403 | Permissions insuffisantes pour cette ressource |
404 | Ressource ou endpoint non trouvé |
429 | Limite de débit dépassée — réessayez après le délai d’attente |
500 | Erreur serveur inattendue |
Autorisations
Your Adhere API secret key
Corps
application/json
Réponse
Event processed

