Vérification…API REST · v1
Construisez avec
l'API Revenzo
Branchez votre caisse, votre site ou votre tableur sur votre programme de fidélité : clients, passages, tampons, récompenses et cartes cadeaux, en quelques lignes.
https://revenzo.fr/api/v1
Toutes les routes
GET/meVotre commerce : nom, type de programme, paliers de récompense, lien d’inscription, et le type de la clé utilisée (live ou test)GET/customersListe des clients, avec recherche et filtres combinablesGET/customers/:idUn client et son historique (500 derniers événements)GET/eventsJournal de tous les passages, du plus ancien au plus récentGET/statsChiffres clés du commerceGET/stats/dailyActivité jour par jour : passages, nouveaux clients, récompenses, tampons ou points distribuésGET/stats/topVos meilleurs clients sur la période (nombre de passages)GET/gift-cardsVos cartes cadeaux, les plus récentes d’abordGET/gift-cards/:codeUne carte cadeau par son code (vérifier le solde en caisse)GET/messagesLes derniers messages envoyés à vos clientsPOST/customersCrée un clientPOST/customers/:idModifie un clientDELETE/customers/:idSupprime un client et tout son historique (droit à l’effacement RGPD)POST/customers/:id/stampsAjoute des tampons, ou des points calculés à partir d’un montant (programme à points)POST/customers/:id/unstampRetire des tampons ou des points (erreur de caisse)POST/customers/:id/redeemRemet une récompense disponiblePOST/gift-cardsCrée une carte cadeau déjà payée (vente en ligne ou en caisse)POST/gift-cards/:code/useDéduit un montant du solde (jamais plus que le solde)POST/gift-cards/:code/cancelAnnule une carte cadeau (son solde n’est plus utilisable)POST/messagesEnvoie une notification sur le téléphone de vos clientsPOST/webhooksAbonne une adresse aux événementsGET/webhooksVos webhooks et le résultat de leur dernier envoiPOST/webhooks/:id/testEnvoie un événement testDELETE/webhooks/:idSupprime un webhook
Authentification
Créez une clé dans Mon espace → API. Elle n'est affichée qu'une fois : nous n'en gardons qu'une empreinte. Envoyez-la dans l'en-tête Authorization :
Authorization: Bearer rz_live_4f1c…
| Type de clé | Permet |
|---|---|
| lecture seule | Toutes les routes GET. |
| lecture + écriture | Les routes GET et POST (créer un client, tamponner, remettre une récompense, utiliser une carte cadeau). |
Premier appel
curl https://revenzo.fr/api/v1/me \
-H "Authorization: Bearer $REVENZO_KEY"
const res = await fetch('https://revenzo.fr/api/v1/customers?limit=10', {
headers: { Authorization: `Bearer ${process.env.REVENZO_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error);
const { data } = await res.json();
console.log(data.map((c) => `${c.first_name} : ${c.stamps} tampons`));
import os, requests
r = requests.get("https://revenzo.fr/api/v1/customers", params={"limit": 10},
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"}, timeout=10)
r.raise_for_status()
for c in r.json()["data"]:
print(c["first_name"], c["stamps"])
<?php
$ch = curl_init("https://revenzo.fr/api/v1/me");
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
]);
$me = json_decode(curl_exec($ch), true);
echo $me["business_name"];
Testeur en direct
Lancez de vrais appels depuis cette page. Utilisez de préférence une clé de test (rz_test_…) : elle agit sur un bac à sable avec de faux clients. La clé reste dans cet onglet (elle est oubliée à sa fermeture) et n'est envoyée qu'à l'API.
Format des réponses
Toutes les réponses sont en JSON. Les montants sont en euros (nombres décimaux), les dates en ISO 8601 UTC. Chaque réponse porte un en-tête X-Request-Id : donnez-le au support si besoin.
Un client a soit des tampons (stamps), soit des points (points), selon le programme du commerce (loyalty_type dans /me).
Erreurs
En cas d'erreur, le code HTTP l'indique et le corps explique en français, avec un code stable à utiliser dans votre programme :
{ "error": "count : entier de 1 à 10.", "code": "invalid_parameter", "request_id": "req_9f2c…" }
| HTTP | code | Signification |
|---|---|---|
| 400 | invalid_json | Le corps n'est pas un JSON valide. |
| 401 | invalid_key | Clé absente, fausse ou révoquée. |
| 403 | read_only_key · plan_required · subscription_inactive · account_unavailable | Droits insuffisants, offre Pro requise, abonnement inactif ou compte suspendu. |
| 404 | not_found | Client, carte cadeau ou route introuvable. |
| 405 | method_not_allowed | Seuls GET et POST existent. |
| 409 | already_exists · conflict | Doublon, ou carte modifiée au même moment ailleurs : réessayez. |
| 413 | payload_too_large | Corps de plus de 16 ko. |
| 415 | json_required | Ajoutez Content-Type: application/json. |
| 422 | invalid_parameter · invalid_request | Paramètre manquant ou invalide (ex. carte pleine). |
| 429 | rate_limited | Trop de requêtes : attendez Retry-After secondes. |
| 500 | server_error | Erreur de notre côté. Réessayez plus tard avec la même Idempotency-Key. |
Limites de requêtes
| Limite | Valeur |
|---|---|
| Lectures par clé | 120 par minute |
| Écritures par clé | 30 par minute |
| Toutes requêtes par adresse IP | 300 par minute |
| Clés invalides par adresse IP | 20 par 15 minutes, puis blocage |
| Taille du corps | 16 ko |
Les en-têtes RateLimit-Limit, RateLimit-Remaining et RateLimit-Reset indiquent où vous en êtes. Après un 429, attendez le nombre de secondes de Retry-After, puis réessayez en augmentant le délai à chaque fois (1 s, 2 s, 4 s…).
Idempotence
Une coupure réseau pendant un ajout de tampon ? Renvoyez exactement la même requête avec le même en-tête Idempotency-Key : le tampon n'est compté qu'une fois, et vous recevez la première réponse (avec Idempotent-Replayed: true). La clé est gardée 24 h.
Idempotency-Key: ticket-48213
Utilisez une valeur unique par opération : le numéro de ticket de caisse, ou un UUID.
Pagination
/customers utilise limit et offset ; continuez tant que pagination.has_more vaut true. /events utilise un curseur de date : rappelez avec since=next_since tant que has_more vaut true.
Mode test
Cochez « Clé de test » en créant une clé : vous obtenez une clé rz_test_… qui agit sur un bac à sable : une copie de votre programme avec 5 faux clients (Camille, Lucas, Inès, Hugo, Léa). Ajoutez des tampons, créez des clients, supprimez-en : vos vraies données ne bougent pas.
- Chaque réponse porte l'en-tête
Revenzo-Mode: test(oulive). - Les webhooks reçoivent aussi les événements de test, avec
"livemode": false: filtrez-les en production. - Passez en production en changeant seulement la clé.
Droits des clés
Chaque clé lit toujours. Pour écrire, donnez-lui seulement les droits utiles : une caisse n'a pas besoin d'envoyer des messages.
| Droit | Routes |
|---|---|
customers | Créer, modifier, supprimer des clients |
stamps | Ajouter ou retirer des tampons / points |
rewards | Remettre des récompenses |
gifts | Créer, utiliser, annuler des cartes cadeaux |
messages | Envoyer des notifications aux clients |
webhooks | Gérer les webhooks par l'API |
Sans le bon droit : 403 missing_scope, avec le nom du droit manquant dans scope.
GET/me
toute clé
Votre commerce : nom, type de programme, paliers de récompense, lien d’inscription, et le type de la clé utilisée (live ou test).
curl "https://revenzo.fr/api/v1/me" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/me" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/me" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/me', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/me",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/me");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/me")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/me", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/me"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/me");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"id": "boulangerie-lina",
"business_name": "Boulangerie Lina",
"loyalty_type": "stamps",
"points_per_euro": null,
"tiers": [
{
"threshold": 10,
"reward": "Une viennoiserie offerte"
}
],
"address": "3 rue du Four, Lille",
"join_url": "https://revenzo.fr/j/boulangerie-lina",
"key": {
"name": "Caisse",
"scope": "read,stamps",
"mode": "live"
}
}GET/customers
toute clé
Liste des clients, avec recherche et filtres combinables. Exemple : les fidèles (5 visites et +) qui ne sont pas venus depuis 30 jours.
Paramètres
searchtexte- Prénom, nom, email ou téléphone (80 caractères max).
min_visits / max_visitsentier- Nombre de visites minimum / maximum.
inactive_daysentier- Pas venus depuis au moins N jours.
active_daysentier- Venus dans les N derniers jours.
min_balanceentier- Solde de tampons ou points minimum.
has_rewardtrue- Seulement ceux qui ont une récompense à récupérer (filtré sur la page).
opt_intrue / false- Ont accepté (ou non) de recevoir vos offres.
created_afterdate ISO- Inscrits après cette date.
sortlast_activity · created · visits · balance · name- Tri (last_activity par défaut).
orderasc / desc- Sens du tri (desc par défaut).
limit / offset1 à 100 / entier- Pagination (50 par défaut).
curl "https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/customers",
params={"min_visits": 5, "inactive_days": 30, "sort": "visits", "limit": 20},
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/customers?min_visits=5&inactive_days=30&sort=visits&limit=20");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"data": [
{
"id": "Xk2pQ7vL9aB3",
"first_name": "Camille",
"last_name": "Martin",
"email": "camille@exemple.fr",
"phone": "0612345678",
"stamps": 6,
"points": 0,
"visits": 14,
"rewards_claimed": 1,
"rewards_available": [],
"marketing_opt_in": true,
"created_at": "2026-10-12T09:41:00.000Z",
"last_activity": "2026-10-05T17:02:11.000Z"
}
],
"pagination": {
"total": 1,
"limit": 20,
"offset": 0,
"has_more": false
}
}GET/customers/:id
toute clé
Un client et son historique (500 derniers événements).
Paramètres
idtexte- Identifiant du client (champ id).
curl "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"id": "Xk2pQ7vL9aB3",
"first_name": "Camille",
"stamps": 6,
"visits": 14,
"history": [
{
"type": "stamp",
"amount": 1,
"detail": null,
"at": "2026-11-05T17:02:11.000Z"
},
{
"type": "reward",
"amount": 10,
"detail": "Une viennoiserie offerte",
"at": "2026-10-28T08:15:40.000Z"
}
]
}GET/events
toute clé
Journal de tous les passages, du plus ancien au plus récent. Pour synchroniser : rappelez avec since = next_since tant que has_more vaut true.
Paramètres
sincedate ISO- Seulement après cette date.
typeliste- stamp, unstamp, reward, join, wheel.
limit1 à 200- 100 par défaut.
curl "https://revenzo.fr/api/v1/events?since=2026-11-01T00%3A00%3A00Z&type=stamp%2Creward" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/events?since=2026-11-01T00%3A00%3A00Z&type=stamp%2Creward" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/events?since=2026-11-01T00%%3A00%%3A00Z&type=stamp%%2Creward" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/events?since=2026-11-01T00%3A00%3A00Z&type=stamp%2Creward', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/events",
params={"since": "2026-11-01T00:00:00Z", "type": "stamp,reward"},
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/events?since=2026-11-01T00%3A00%3A00Z&type=stamp%2Creward");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/events?since=2026-11-01T00%3A00%3A00Z&type=stamp%2Creward")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/events?since=2026-11-01T00%3A00%3A00Z&type=stamp%2Creward", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/events?since=2026-11-01T00%3A00%3A00Z&type=stamp%2Creward"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/events?since=2026-11-01T00%3A00%3A00Z&type=stamp%2Creward");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"data": [
{
"id": 812,
"type": "stamp",
"customer_id": "Xk2pQ7vL9aB3",
"amount": 1,
"detail": null,
"by": "staff",
"at": "2026-11-01T10:12:00.000Z"
}
],
"next_since": "2026-11-01T10:12:00.000Z",
"has_more": false
}GET/stats
toute clé
Chiffres clés du commerce.
curl "https://revenzo.fr/api/v1/stats" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/stats" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/stats" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/stats', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/stats",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/stats");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/stats")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/stats", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/stats"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/stats");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"customers": 248,
"active_last_30_days": 97,
"visits_last_30_days": 311,
"rewards_given": 42,
"balance_outstanding": 1180
}GET/stats/daily
toute clé
Activité jour par jour : passages, nouveaux clients, récompenses, tampons ou points distribués. Parfait pour un graphique.
Paramètres
days1 à 365- 30 par défaut.
curl "https://revenzo.fr/api/v1/stats/daily?days=7" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/stats/daily?days=7" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/stats/daily?days=7" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/stats/daily?days=7', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/stats/daily",
params={"days": 7},
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/stats/daily?days=7");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/stats/daily?days=7")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/stats/daily?days=7", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/stats/daily?days=7"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/stats/daily?days=7");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"data": [
{
"date": "2026-11-06",
"visits": 23,
"new_customers": 4,
"rewards": 2,
"units": 25
}
]
}GET/stats/top
toute clé
Vos meilleurs clients sur la période (nombre de passages).
Paramètres
days1 à 365- 30 par défaut.
limit1 à 50- 10 par défaut.
curl "https://revenzo.fr/api/v1/stats/top?days=30&limit=5" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/stats/top?days=30&limit=5" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/stats/top?days=30&limit=5" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/stats/top?days=30&limit=5', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/stats/top",
params={"days": 30, "limit": 5},
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/stats/top?days=30&limit=5");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/stats/top?days=30&limit=5")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/stats/top?days=30&limit=5", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/stats/top?days=30&limit=5"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/stats/top?days=30&limit=5");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"data": [
{
"customer_id": "Xk2pQ7vL9aB3",
"first_name": "Camille",
"last_name": "Martin",
"visits": 9
}
]
}GET/gift-cards
toute clé
Vos cartes cadeaux, les plus récentes d’abord.
Paramètres
limit1 à 100- 50 par défaut.
curl "https://revenzo.fr/api/v1/gift-cards" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/gift-cards" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/gift-cards" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/gift-cards', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/gift-cards",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/gift-cards");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/gift-cards")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/gift-cards", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/gift-cards"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/gift-cards");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"data": [
{
"code": "4M8DCJYPXKLS",
"amount": 30,
"balance": 17.5,
"currency": "EUR",
"status": "active",
"recipient": "Léa",
"expires_at": "2027-11-05T16:56:02.000Z",
"created_at": "2026-11-05T16:56:02.000Z"
}
]
}GET/gift-cards/:code
toute clé
Une carte cadeau par son code (vérifier le solde en caisse).
Paramètres
codetexte- Code imprimé sous le QR.
curl "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"code": "4M8DCJYPXKLS",
"amount": 30,
"balance": 17.5,
"currency": "EUR",
"status": "active"
}GET/messages
toute clé
Les derniers messages envoyés à vos clients.
Paramètres
limit1 à 100- 20 par défaut.
curl "https://revenzo.fr/api/v1/messages" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/messages" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/messages" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/messages', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/messages",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/messages");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/messages")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/messages", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/messages"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/messages");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"data": [
{
"id": 41,
"text": "Les croissants sortent du four !",
"target": "all",
"status": "sent",
"recipients": 212,
"sent_at": "2026-11-06T07:30:00.000Z",
"scheduled_at": null
}
]
}POST/customers
droit « customers »
Crée un client. Il récupère sa carte avec card_url. Email ou téléphone déjà connu : réponse 409 avec le client existant.
Paramètres
first_nametexte, obligatoire- 80 caractères max.
last_nametexteemailemailphonetéléphone- Ex. 0612345678 ou +33612345678.
marketing_opt_inbooléen- true seulement si le client a accepté vos offres.
curl -X POST "https://revenzo.fr/api/v1/customers" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{"first_name":"Inès","phone":"0612345678","marketing_opt_in":true}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{"first_name":"Inès","phone":"0612345678","marketing_opt_in":true}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/customers" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/customers" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{\"first_name\":\"Inès\",\"phone\":\"0612345678\",\"marketing_opt_in\":true}"const res = await fetch('https://revenzo.fr/api/v1/customers', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({
"first_name": "Inès",
"phone": "0612345678",
"marketing_opt_in": true
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/customers",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={
"first_name": "Inès",
"phone": "0612345678",
"marketing_opt_in": True
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/customers");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode(["first_name" => "Inès", "phone" => "0612345678", "marketing_opt_in" => true]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/customers")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{\"first_name\":\"Inès\",\"phone\":\"0612345678\",\"marketing_opt_in\":true}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/customers", strings.NewReader(`{"first_name":"Inès","phone":"0612345678","marketing_opt_in":true}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/customers"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"first_name\":\"Inès\",\"phone\":\"0612345678\",\"marketing_opt_in\":true}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{\"first_name\":\"Inès\",\"phone\":\"0612345678\",\"marketing_opt_in\":true}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/customers", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 201
{
"id": "Pq9rT2",
"first_name": "Inès",
"stamps": 0,
"visits": 0,
"card_url": "https://revenzo.fr/c/Pq9rT2?installer=1"
}POST/customers/:id
droit « customers »
Modifie un client. Envoyez seulement les champs à changer.
Paramètres
first_name · last_name · email · phone · marketing_opt_in- Mêmes règles qu’à la création.
curl -X POST "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{"last_name":"Diallo","marketing_opt_in":false}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{"last_name":"Diallo","marketing_opt_in":false}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{\"last_name\":\"Diallo\",\"marketing_opt_in\":false}"const res = await fetch('https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({
"last_name": "Diallo",
"marketing_opt_in": false
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={
"last_name": "Diallo",
"marketing_opt_in": False
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode(["last_name" => "Diallo", "marketing_opt_in" => false]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{\"last_name\":\"Diallo\",\"marketing_opt_in\":false}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3", strings.NewReader(`{"last_name":"Diallo","marketing_opt_in":false}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"last_name\":\"Diallo\",\"marketing_opt_in\":false}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{\"last_name\":\"Diallo\",\"marketing_opt_in\":false}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"id": "Xk2pQ7vL9aB3",
"first_name": "Camille",
"last_name": "Diallo",
"marketing_opt_in": false
}DELETE/customers/:id
droit « customers »
Supprime un client et tout son historique (droit à l’effacement RGPD). Irréversible.
curl -X DELETE "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Delete -Uri "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" -Headers $headerscurl.exe -X DELETE "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.delete(
"https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.DELETE()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.DeleteAsync("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"id": "Xk2pQ7vL9aB3",
"deleted": true
}POST/customers/:id/stamps
droit « stamps »
Ajoute des tampons, ou des points calculés à partir d’un montant (programme à points). Le client reçoit la notification. Le happy hour et le parrainage s’appliquent.
Paramètres
count1 à 10- Nombre de tampons (1 par défaut).
amounteuros- Programme à points : montant de l’achat, ex. 12.5.
curl -X POST "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ticket-48213" \
-d '{"count":1}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "ticket-48213" }
$body = '{"count":1}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: ticket-48213" ^
-d "{\"count\":1}"const res = await fetch('https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'ticket-48213',
},
body: JSON.stringify({
"count": 1
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "ticket-48213"},
json={
"count": 1
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: ticket-48213"],
CURLOPT_POSTFIELDS => json_encode(["count" => 1]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "ticket-48213"
req.body = "{\"count\":1}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps", strings.NewReader(`{"count":1}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "ticket-48213")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "ticket-48213")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"count\":1}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "ticket-48213");
var content = new StringContent("{\"count\":1}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/stamps", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"id": "Xk2pQ7vL9aB3",
"stamps": 7,
"visits": 15,
"rewards_available": []
}POST/customers/:id/unstamp
droit « stamps »
Retire des tampons ou des points (erreur de caisse).
Paramètres
countentier- 1 par défaut.
curl -X POST "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{"count":1}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{"count":1}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{\"count\":1}"const res = await fetch('https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({
"count": 1
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={
"count": 1
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode(["count" => 1]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{\"count\":1}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp", strings.NewReader(`{"count":1}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"count\":1}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{\"count\":1}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/unstamp", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"id": "Xk2pQ7vL9aB3",
"stamps": 6
}POST/customers/:id/redeem
droit « rewards »
Remet une récompense disponible. Sans threshold : la première disponible.
Paramètres
thresholdentier- Palier à remettre (ex. 10).
curl -X POST "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{"threshold":10}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{"threshold":10}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{\"threshold\":10}"const res = await fetch('https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({
"threshold": 10
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={
"threshold": 10
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode(["threshold" => 10]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{\"threshold\":10}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem", strings.NewReader(`{"threshold":10}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"threshold\":10}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{\"threshold\":10}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/customers/Xk2pQ7vL9aB3/redeem", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"reward": "Une viennoiserie offerte",
"customer": {
"id": "Xk2pQ7vL9aB3",
"stamps": 0
}
}POST/gift-cards
droit « gifts »
Crée une carte cadeau déjà payée (vente en ligne ou en caisse). Renvoie le lien de la page cadeau à envoyer.
Paramètres
amounteuros, obligatoire- 1 à 1 000 €.
recipient · buyertexte- Pour qui, de la part de qui.
messagetexte- 200 caractères max.
months1 à 36- Validité (12 par défaut).
curl -X POST "https://revenzo.fr/api/v1/gift-cards" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{"amount":30,"recipient":"Léa","buyer":"Marc","months":12}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{"amount":30,"recipient":"Léa","buyer":"Marc","months":12}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/gift-cards" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/gift-cards" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{\"amount\":30,\"recipient\":\"Léa\",\"buyer\":\"Marc\",\"months\":12}"const res = await fetch('https://revenzo.fr/api/v1/gift-cards', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({
"amount": 30,
"recipient": "Léa",
"buyer": "Marc",
"months": 12
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/gift-cards",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={
"amount": 30,
"recipient": "Léa",
"buyer": "Marc",
"months": 12
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/gift-cards");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode(["amount" => 30, "recipient" => "Léa", "buyer" => "Marc", "months" => 12]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/gift-cards")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{\"amount\":30,\"recipient\":\"Léa\",\"buyer\":\"Marc\",\"months\":12}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/gift-cards", strings.NewReader(`{"amount":30,"recipient":"Léa","buyer":"Marc","months":12}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/gift-cards"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"amount\":30,\"recipient\":\"Léa\",\"buyer\":\"Marc\",\"months\":12}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{\"amount\":30,\"recipient\":\"Léa\",\"buyer\":\"Marc\",\"months\":12}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/gift-cards", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 201
{
"code": "4M8DCJYPXKLS",
"amount": 30,
"balance": 30,
"status": "active",
"url": "https://revenzo.fr/cadeau/4M8DCJYPXKLS"
}POST/gift-cards/:code/use
droit « gifts »
Déduit un montant du solde (jamais plus que le solde).
Paramètres
amounteuros- Montant à déduire.
curl -X POST "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{"amount":12.5}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{"amount":12.5}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{\"amount\":12.5}"const res = await fetch('https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({
"amount": 12.5
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={
"amount": 12.5
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode(["amount" => 12.5]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{\"amount\":12.5}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use", strings.NewReader(`{"amount":12.5}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"amount\":12.5}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{\"amount\":12.5}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"used": 12.5,
"code": "4M8DCJYPXKLS",
"balance": 5,
"status": "active"
}POST/gift-cards/:code/cancel
droit « gifts »
Annule une carte cadeau (son solde n’est plus utilisable).
curl -X POST "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{}"const res = await fetch('https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode([]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel", strings.NewReader(`{}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/cancel", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"code": "4M8DCJYPXKLS",
"status": "annulée"
}POST/messages
droit « messages »
Envoie une notification sur le téléphone de vos clients. 20 messages par jour au maximum.
Paramètres
texttexte, obligatoire- 200 caractères max.
targetall · near · inactive · new- Tous, proches d’une récompense, absents depuis 30 jours, inscrits ce mois-ci.
curl -X POST "https://revenzo.fr/api/v1/messages" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{"text":"Ce soir, le dessert est offert aux habitués 🍰","target":"inactive"}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{"text":"Ce soir, le dessert est offert aux habitués 🍰","target":"inactive"}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/messages" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/messages" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{\"text\":\"Ce soir, le dessert est offert aux habitués 🍰\",\"target\":\"inactive\"}"const res = await fetch('https://revenzo.fr/api/v1/messages', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({
"text": "Ce soir, le dessert est offert aux habitués 🍰",
"target": "inactive"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/messages",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={
"text": "Ce soir, le dessert est offert aux habitués 🍰",
"target": "inactive"
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/messages");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode(["text" => "Ce soir, le dessert est offert aux habitués 🍰", "target" => "inactive"]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/messages")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{\"text\":\"Ce soir, le dessert est offert aux habitués 🍰\",\"target\":\"inactive\"}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/messages", strings.NewReader(`{"text":"Ce soir, le dessert est offert aux habitués 🍰","target":"inactive"}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/messages"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"text\":\"Ce soir, le dessert est offert aux habitués 🍰\",\"target\":\"inactive\"}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{\"text\":\"Ce soir, le dessert est offert aux habitués 🍰\",\"target\":\"inactive\"}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/messages", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 201
{
"text": "Ce soir, le dessert est offert aux habitués 🍰",
"target": "inactive",
"recipients": 37
}POST/webhooks
droit « webhooks »
Abonne une adresse aux événements. Le secret de signature n’est renvoyé qu’à la création.
Paramètres
urlhttps, obligatoire- Adresse publique (les adresses internes sont refusées).
kindjson · discord · slack · telegram- Format envoyé.
eventsliste- Vide = tous les événements.
curl -X POST "https://revenzo.fr/api/v1/webhooks" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{"url":"https://monsite.fr/revenzo","kind":"json","events":["stamp.added","reward.redeemed"]}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{"url":"https://monsite.fr/revenzo","kind":"json","events":["stamp.added","reward.redeemed"]}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/webhooks" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/webhooks" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{\"url\":\"https://monsite.fr/revenzo\",\"kind\":\"json\",\"events\":[\"stamp.added\",\"reward.redeemed\"]}"const res = await fetch('https://revenzo.fr/api/v1/webhooks', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({
"url": "https://monsite.fr/revenzo",
"kind": "json",
"events": [
"stamp.added",
"reward.redeemed"
]
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={
"url": "https://monsite.fr/revenzo",
"kind": "json",
"events": [
"stamp.added",
"reward.redeemed"
]
},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/webhooks");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode(["url" => "https://monsite.fr/revenzo", "kind" => "json", "events" => ["stamp.added", "reward.redeemed"]]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/webhooks")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{\"url\":\"https://monsite.fr/revenzo\",\"kind\":\"json\",\"events\":[\"stamp.added\",\"reward.redeemed\"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/webhooks", strings.NewReader(`{"url":"https://monsite.fr/revenzo","kind":"json","events":["stamp.added","reward.redeemed"]}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/webhooks"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"url\":\"https://monsite.fr/revenzo\",\"kind\":\"json\",\"events\":[\"stamp.added\",\"reward.redeemed\"]}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{\"url\":\"https://monsite.fr/revenzo\",\"kind\":\"json\",\"events\":[\"stamp.added\",\"reward.redeemed\"]}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/webhooks", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 201
{
"id": 3,
"url": "https://monsite.fr/revenzo",
"kind": "json",
"events": [
"stamp.added",
"reward.redeemed"
],
"active": true,
"secret": "whsec_9b1f…"
}GET/webhooks
droit « webhooks »
Vos webhooks et le résultat de leur dernier envoi.
curl "https://revenzo.fr/api/v1/webhooks" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Get -Uri "https://revenzo.fr/api/v1/webhooks" -Headers $headerscurl.exe "https://revenzo.fr/api/v1/webhooks" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/webhooks', {
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.get(
"https://revenzo.fr/api/v1/webhooks",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/webhooks");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/webhooks")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://revenzo.fr/api/v1/webhooks", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/webhooks"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.GET()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.GetAsync("https://revenzo.fr/api/v1/webhooks");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"data": [
{
"id": 3,
"url": "https://monsite.fr/revenzo",
"kind": "json",
"events": [
"*"
],
"active": true,
"last_status": 200,
"last_at": "2026-11-06T18:02:00.000Z"
}
]
}POST/webhooks/:id/test
droit « webhooks »
Envoie un événement test.ping tout de suite et renvoie la réponse de votre serveur.
curl -X POST "https://revenzo.fr/api/v1/webhooks/3/test" \
-H "Authorization: Bearer $REVENZO_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: commande-123" \
-d '{}'$headers = @{ Authorization = "Bearer $env:REVENZO_KEY"; "Idempotency-Key" = "commande-123" }
$body = '{}'
Invoke-RestMethod -Method Post -Uri "https://revenzo.fr/api/v1/webhooks/3/test" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bodycurl.exe -X POST "https://revenzo.fr/api/v1/webhooks/3/test" ^
-H "Authorization: Bearer %REVENZO_KEY%" ^
-H "Content-Type: application/json" ^
-H "Idempotency-Key: commande-123" ^
-d "{}"const res = await fetch('https://revenzo.fr/api/v1/webhooks/3/test', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'commande-123',
},
body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.post(
"https://revenzo.fr/api/v1/webhooks/3/test",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}", "Idempotency-Key": "commande-123"},
json={},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/webhooks/3/test");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY"), "Content-Type: application/json", "Idempotency-Key: commande-123"],
CURLOPT_POSTFIELDS => json_encode([]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/webhooks/3/test")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
req["Content-Type"] = "application/json"
req["Idempotency-Key"] = "commande-123"
req.body = "{}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://revenzo.fr/api/v1/webhooks/3/test", strings.NewReader(`{}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "commande-123")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/webhooks/3/test"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "commande-123")
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("{}"))
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
http.DefaultRequestHeaders.Add("Idempotency-Key", "commande-123");
var content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://revenzo.fr/api/v1/webhooks/3/test", content);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"delivered": true,
"status": 200,
"response": "ok"
}DELETE/webhooks/:id
droit « webhooks »
Supprime un webhook.
curl -X DELETE "https://revenzo.fr/api/v1/webhooks/3" \
-H "Authorization: Bearer $REVENZO_KEY"$headers = @{ Authorization = "Bearer $env:REVENZO_KEY" }
Invoke-RestMethod -Method Delete -Uri "https://revenzo.fr/api/v1/webhooks/3" -Headers $headerscurl.exe -X DELETE "https://revenzo.fr/api/v1/webhooks/3" ^
-H "Authorization: Bearer %REVENZO_KEY%"const res = await fetch('https://revenzo.fr/api/v1/webhooks/3', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code} : ${data.error}`);
console.log(data);import os, requests
r = requests.delete(
"https://revenzo.fr/api/v1/webhooks/3",
headers={"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"},
timeout=10,
)
r.raise_for_status()
print(r.json())<?php
$ch = curl_init("https://revenzo.fr/api/v1/webhooks/3");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("REVENZO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://revenzo.fr/api/v1/webhooks/3")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer #{ENV["REVENZO_KEY"]}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://revenzo.fr/api/v1/webhooks/3", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("REVENZO_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
}var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://revenzo.fr/api/v1/webhooks/3"))
.header("Authorization", "Bearer " + System.getenv("REVENZO_KEY"))
.DELETE()
.build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("REVENZO_KEY"));
var res = await http.DeleteAsync("https://revenzo.fr/api/v1/webhooks/3");
Console.WriteLine(await res.Content.ReadAsStringAsync());
Réponse 200
{
"id": 3,
"deleted": true
}Webhooks : fonctionnement
Au lieu d'interroger l'API en boucle, laissez Revenzo vous prévenir : à chaque événement (nouveau client, tampon, récompense…), Revenzo envoie un POST à votre adresse, en moins d'une seconde.
- Ajoutez un webhook dans Mon espace → API (ou avec
POST /webhooks) : votre adresse https, le format (JSON signé, Discord, Slack, Telegram) et les événements. - Votre serveur répond
2xxen moins de 5 secondes. Traitez le travail long après avoir répondu. - Pas de réponse ou une erreur ? Revenzo réessaie après 1 min, 5 min, 30 min, 2 h, 6 h et 24 h. Après 15 échecs d'affilée, le webhook se met en pause (réactivable en un clic).
- Un même événement peut arriver deux fois (réseau) : dédoublonnez avec l'en-tête
Revenzo-Delivery(identique àid).
En-têtes reçus
Content-Type: application/json
User-Agent: Revenzo-Webhooks/1.0
Revenzo-Event: stamp.added
Revenzo-Delivery: evt_5c9e1f0a7b2d4e6f8a1b
Revenzo-Signature: t=1793908800,v1=3b8f…Corps reçu
{
"id": "evt_5c9e1f0a7b2d4e6f8a1b",
"type": "stamp.added",
"created": "2026-11-06T18:00:00.000Z",
"livemode": true,
"data": {
"customer": {
"id": "Xk2pQ7vL9aB3",
"first_name": "Camille",
"last_name": "Martin",
"balance": 7,
"unit": "stamps",
"visits": 15
},
"amount": 1,
"detail": null
}
}https publiques sont acceptées (les adresses internes et locales sont refusées, même après résolution du nom), pas de redirection suivie, 5 secondes maximum.Événements
| Type | Quand | Contenu de data |
|---|---|---|
customer.created | Un client crée sa carte (QR, comptoir ou API) | customer |
stamp.added | Tampons ou points ajoutés (y compris bonus) | customer, amount, detail |
stamp.removed | Tampons ou points retirés | customer, amount |
reward.redeemed | Récompense remise | customer, reward, threshold |
wheel.won | Lot gagné à la roue de la chance | customer, prize |
giftcard.created | Carte cadeau créée | code, amount, recipient, expires_at |
giftcard.used | Montant déduit d'une carte cadeau | code, used, balance |
message.sent | Notification envoyée aux clients | text, target, recipients |
test.ping | Bouton « Tester » | vide |
Vérifier la signature
Prouvez que l'appel vient bien de Revenzo : recalculez HMAC-SHA256(secret, t + "." + corps brut) et comparez avec v1. Refusez si t a plus de 5 minutes (protection contre le rejeu). Le secret whsec_… est donné à la création du webhook.
const crypto = require('crypto');
const express = require('express');
const app = express();
app.post('/revenzo', express.raw({ type: 'application/json' }), (req, res) => {
const sig = String(req.get('Revenzo-Signature') || '');
const t = Number((/t=(d+)/.exec(sig) || [])[1]);
const v1 = (/v1=([a-f0-9]+)/.exec(sig) || [])[1] || '';
const expected = crypto.createHmac('sha256', process.env.REVENZO_WEBHOOK_SECRET)
.update(t + '.' + req.body).digest('hex');
const ok = v1.length === expected.length && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
if (!ok || Math.abs(Date.now() / 1000 - t) > 300) return res.sendStatus(400);
const event = JSON.parse(req.body);
if (event.type === 'reward.redeemed') console.log(event.data.customer.first_name, 'a reçu', event.data.reward);
res.sendStatus(200);
});
<?php
$payload = file_get_contents('php://input');
$sig = $_SERVER['HTTP_REVENZO_SIGNATURE'] ?? '';
preg_match('/t=(d+)/', $sig, $t);
preg_match('/v1=([a-f0-9]+)/', $sig, $v1);
$expected = hash_hmac('sha256', ($t[1] ?? '') . '.' . $payload, getenv('REVENZO_WEBHOOK_SECRET'));
if (!hash_equals($expected, $v1[1] ?? '') || abs(time() - (int)($t[1] ?? 0)) > 300) {
http_response_code(400); exit;
}
$event = json_decode($payload, true);
http_response_code(200);
import hmac, hashlib, os, re, time
from flask import Flask, request, abort
app = Flask(__name__)
@app.post("/revenzo")
def revenzo():
sig = request.headers.get("Revenzo-Signature", "")
t = re.search(r"t=(d+)", sig); v1 = re.search(r"v1=([a-f0-9]+)", sig)
if not t or not v1:
abort(400)
expected = hmac.new(os.environ["REVENZO_WEBHOOK_SECRET"].encode(),
f"{t.group(1)}.".encode() + request.get_data(), hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, v1.group(1)) or abs(time.time() - int(t.group(1))) > 300:
abort(400)
event = request.get_json()
return "", 200
Discord
Recevez chaque passage, récompense ou nouveau client dans un salon Discord, en clair : « ✅ Boulangerie Lina : +1 pour Camille Martin (7 au total). »
- Dans Discord : Paramètres du salon → Intégrations → Webhooks → Nouveau webhook, puis Copier l'URL.
- Dans Mon espace → API : choisissez Discord, collez l'adresse, cochez les événements voulus.
- Touchez Tester : un message arrive dans le salon.
Slack
- Sur api.slack.com/apps : Create New App → From scratch, puis Incoming Webhooks → activez → Add New Webhook to Workspace → choisissez le canal.
- Copiez l'adresse
https://hooks.slack.com/services/…. - Dans Revenzo : format Slack, collez l'adresse, puis Tester.
Telegram
- Dans Telegram, écrivez à @BotFather :
/newbot, choisissez un nom. Il vous donne un jeton123456:ABC…. - Ajoutez votre bot dans le groupe voulu (ou écrivez-lui), puis ouvrez
https://api.telegram.org/bot<jeton>/getUpdates: relevezchat.id. - Dans Revenzo, format Telegram, adresse :
https://api.telegram.org/bot<jeton>/sendMessage?chat_id=<chat.id>, puis Tester.
WhatsApp et Messenger
WhatsApp et Messenger n'acceptent pas les webhooks entrants directs : Meta impose un compte WhatsApp Business validé et des modèles de messages approuvés. La solution simple :
- Créez un scénario sur Make, Zapier ou n8n qui commence par « Webhook personnalisé » (Custom Webhook) : il vous donne une adresse https.
- Ajoutez cette adresse dans Revenzo au format JSON signé.
- Dans le scénario, ajoutez l'étape WhatsApp Business (ou Messenger, SMS, email, Google Chat…) et utilisez les champs reçus (
data.customer.first_name,data.reward…).
Guide : brancher une caisse
- Créez une clé lecture + écriture nommée « Caisse ».
- À l'encaissement, cherchez le client :
GET /customers?search=0612345678. Absent ? Créez-le avecPOST /customers. - Ajoutez le passage :
POST /customers/:id/stampsavec{"count":1}(ou{"amount": total}en points), et le numéro de ticket enIdempotency-Key. - Si
rewards_availablen'est pas vide, proposez la récompense puisPOST /customers/:id/redeem.
Guide : synchroniser un tableur
Toutes les heures, appelez GET /events?since=… avec la dernière valeur de next_since que vous avez gardée, et ajoutez les lignes reçues. Exemple Google Sheets (Apps Script) :
function sync() {
const props = PropertiesService.getScriptProperties();
const since = props.getProperty('since') || '1970-01-01T00:00:00Z';
const r = UrlFetchApp.fetch('https://revenzo.fr/api/v1/events?limit=200&since=' + encodeURIComponent(since), {
headers: { Authorization: 'Bearer ' + props.getProperty('REVENZO_KEY') },
});
const body = JSON.parse(r.getContentText());
const sheet = SpreadsheetApp.getActive().getSheetByName('Passages');
body.data.forEach((e) => sheet.appendRow([e.at, e.type, e.customer_id, e.amount, e.detail]));
if (body.next_since) props.setProperty('since', body.next_since);
}
Guide : inscription depuis votre site
Votre site a déjà un formulaire (réservation, commande, newsletter) ? Créez la carte de fidélité au même moment, côté serveur, puis envoyez au client le lien de sa carte.
- Votre serveur reçoit le formulaire (jamais le navigateur : la clé doit rester secrète).
- Il appelle
POST /customersavec le prénom, l'email ou le téléphone, etmarketing_opt_inseulement si la case a été cochée. - Il récupère
card_urldans la réponse et l'affiche sur la page de remerciement ou l'envoie par email. - Réponse
409 already_exists? Le client a déjà une carte : utilisez lecustomerrenvoyé.
app.post('/reservation', async (req, res) => {
const r = await fetch('https://revenzo.fr/api/v1/customers', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': `resa-${req.body.id}`,
},
body: JSON.stringify({
first_name: req.body.prenom,
email: req.body.email,
marketing_opt_in: req.body.newsletter === 'on',
}),
});
const data = await r.json();
const client = r.status === 409 ? data.customer : data;
res.render('merci', { carte: client.card_url || null });
});
Guide : carte cadeau en caisse
- Le client présente sa carte cadeau : scannez le QR ou tapez le code imprimé.
GET /gift-cards/:code: vérifiez questatusvautactiveet affichezbalance.- À l'encaissement,
POST /gift-cards/:code/useavec le montant (jamais plus que le solde : l'API plafonne d'elle-même). - Imprimez le nouveau solde sur le ticket.
import os, requests
H = {"Authorization": f"Bearer {os.environ['REVENZO_KEY']}"}
card = requests.get("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS", headers=H, timeout=10).json()
if card["status"] != "active":
raise SystemExit("Carte " + card["status"])
paid = min(23.90, card["balance"])
r = requests.post("https://revenzo.fr/api/v1/gift-cards/4M8DCJYPXKLS/use", json={"amount": paid},
headers={**H, "Idempotency-Key": "ticket-48214"}, timeout=10)
print("Reste :", r.json()["balance"], "€")
Guide : réessayer proprement
Le réseau d'un commerce coupe parfois. Pour ne jamais perdre ni doubler un tampon : une Idempotency-Key par opération, un délai d'attente, et des nouvelles tentatives espacées seulement sur les erreurs temporaires (429 et 5xx).
async function revenzo(path, body, key) {
for (let essai = 0; essai < 4; essai++) {
const r = await fetch('https://revenzo.fr/api/v1' + path, {
method: body ? 'POST' : 'GET',
headers: {
Authorization: `Bearer ${process.env.REVENZO_KEY}`,
'Content-Type': 'application/json',
...(key ? { 'Idempotency-Key': key } : {}),
},
body: body ? JSON.stringify(body) : undefined,
signal: AbortSignal.timeout(10000),
});
if (r.status !== 429 && r.status < 500) return r.json();
const attente = Number(r.headers.get('Retry-After')) || 2 ** essai;
await new Promise((ok) => setTimeout(ok, attente * 1000));
}
throw new Error('Revenzo indisponible, réessayez plus tard');
}
WordPress / WooCommerce
Un tampon (ou des points selon le montant) à chaque commande WooCommerce payée, si le client a une carte avec le même email. À coller dans un petit plugin ou dans functions.php de votre thème enfant ; la clé va dans wp-config.php : define('REVENZO_KEY', 'rz_live_…');
add_action('woocommerce_order_status_completed', function ($order_id) {
$order = wc_get_order($order_id);
$h = ['Authorization' => 'Bearer ' . REVENZO_KEY, 'Content-Type' => 'application/json'];
$found = wp_remote_get('https://revenzo.fr/api/v1/customers?search=' . rawurlencode($order->get_billing_email()), ['headers' => $h, 'timeout' => 10]);
$list = json_decode(wp_remote_retrieve_body($found), true);
if (empty($list['data'][0]['id'])) return;
wp_remote_post('https://revenzo.fr/api/v1/customers/' . $list['data'][0]['id'] . '/stamps', [
'headers' => $h + ['Idempotency-Key' => 'wc-' . $order_id],
'body' => wp_json_encode(['amount' => (float) $order->get_total()]),
'timeout' => 10,
]);
});
Shopify
- Installez l'application gratuite Shopify Flow.
- Déclencheur Commande payée, puis action Envoyer une requête HTTP.
- Méthode
POST, adresse d'un petit relais (Make, Zapier, ou votre serveur) qui cherche le client par email puis appellePOST /customers/:id/stampsavec{"amount": total}. Ne mettez jamais votre clé dans le thème Shopify.
Wix (Velo)
Activez le mode développeur, ajoutez la clé dans Gestionnaire de secrets (nom REVENZO_KEY), puis créez backend/revenzo.web.js :
import { Permissions, webMethod } from 'wix-web-module';
import { getSecret } from 'wix-secrets-backend';
import { fetch } from 'wix-fetch';
export const inscrireClient = webMethod(Permissions.Anyone, async (prenom, email) => {
const res = await fetch('https://revenzo.fr/api/v1/customers', {
method: 'post',
headers: { Authorization: 'Bearer ' + await getSecret('REVENZO_KEY'), 'Content-Type': 'application/json' },
body: JSON.stringify({ first_name: prenom, email }),
});
const data = await res.json();
return (res.status === 409 ? data.customer : data).card_url || null;
});
Next.js
Une route serveur (la clé ne part jamais dans le navigateur) : app/api/fidelite/route.ts
export async function POST(req: Request) {
const { prenom, email } = await req.json();
const res = await fetch('https://revenzo.fr/api/v1/customers', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.REVENZO_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ first_name: prenom, email }),
cache: 'no-store',
});
const data = await res.json();
return Response.json({ carte: (res.status === 409 ? data.customer : data).card_url ?? null });
}
Laravel
Clé dans .env (REVENZO_KEY=rz_live_…), puis dans config/services.php : 'revenzo' => ['key' => env('REVENZO_KEY')].
use IlluminateSupportFacadesHttp;
$revenzo = Http::withToken(config('services.revenzo.key'))
->baseUrl('https://revenzo.fr/api/v1')
->timeout(10)
->retry(3, 1000, fn ($e) => in_array(optional($e->response)->status(), [429, 500, 502, 503]));
$client = $revenzo->get('/customers', ['search' => $user->email])->json('data.0');
if ($client) {
$revenzo->withHeaders(['Idempotency-Key' => 'cmd-'.$order->id])
->post("/customers/{$client['id']}/stamps", ['count' => 1]);
}
Django
import os, requests
S = requests.Session()
S.headers["Authorization"] = f"Bearer {os.environ['REVENZO_KEY']}"
BASE = "https://revenzo.fr/api/v1"
def tampon_pour(email, commande_id):
r = S.get(f"{BASE}/customers", params={"search": email}, timeout=10)
r.raise_for_status()
clients = r.json()["data"]
if not clients:
return None
r = S.post(f"{BASE}/customers/{clients[0]['id']}/stamps", json={"count": 1},
headers={"Idempotency-Key": f"cmd-{commande_id}"}, timeout=10)
return r.json()
Windows : PowerShell, CMD et Excel
Enregistrez votre clé une fois pour toutes (PowerShell) : [Environment]::SetEnvironmentVariable("REVENZO_KEY", "rz_live_…", "User"), puis rouvrez la fenêtre. Exporter tous vos clients dans un fichier Excel (CSV) :
$h = @{ Authorization = "Bearer $env:REVENZO_KEY" }
$tous = @(); $offset = 0
do {
$page = Invoke-RestMethod -Uri "https://revenzo.fr/api/v1/customers?limit=100&offset=$offset" -Headers $h
$tous += $page.data; $offset += 100
} while ($page.pagination.has_more)
$tous | Select-Object first_name, last_name, email, phone, visits, stamps, last_activity |
Export-Csv "$HOMEDesktopclients-revenzo.csv" -NoTypeInformation -Encoding UTF8 -Delimiter ";"
"$($tous.Count) clients exportés sur le Bureau"
Avec l'invite de commandes (CMD), utilisez curl.exe (inclus dans Windows 10 et 11) : chaque exemple de la documentation a un onglet CMD. Pour lancer un script tous les jours : Planificateur de tâches → Créer une tâche de base, action powershell -File C:\chemin\export.ps1.
Zapier, Make, n8n (sans coder)
- Recevoir les événements Revenzo : module « Webhooks / Custom webhook », adresse collée dans Revenzo (format JSON signé).
- Agir sur Revenzo : module « HTTP / Make a request », en-tête
Authorization: Bearer rz_live_…, corps JSON. - Idées : un nouveau client → ajouté à Mailchimp ou Brevo ; une récompense remise → ligne dans Google Sheets ; un fidèle absent (
GET /customers?min_visits=5&inactive_days=30) → SMS via votre outil.
Collection Postman
Toutes les routes, prêtes à lancer dans Postman ou Insomnia. Importez le fichier, puis renseignez la variable REVENZO_KEY (une clé de test pour commencer).
État du service
La pastille en haut de page est vérifiée en direct : opérationnelle (vert), ralentie (orange) ou indisponible (rouge). Vous pouvez aussi interroger GET /dev/status (sans clé) depuis votre supervision.
{ "status": "operational", "latency_ms": 4, "checked_at": "2026-11-06T18:00:00.000Z" }
Bonnes pratiques
- Une clé par outil (caisse, site, tableur) : vous pourrez en révoquer une sans couper les autres.
- Clé en lecture seule dès que l'outil n'a pas besoin d'écrire.
- Clé dans une variable d'environnement, jamais dans le code ni dans un dépôt Git.
- Délai d'attente de 10 s et nouvelles tentatives espacées, avec
Idempotency-Keysur chaque POST. marketing_opt_in: trueseulement si le client a vraiment accepté de recevoir vos offres (RGPD).
Versions
La v1 n'évolue qu'en ajoutant des champs ou des routes : vos intégrations ne cassent pas. Un changement incompatible arriverait en /api/v2, annoncé à l'avance sur le changelog.
| 6 novembre 2026 (soir) | Webhooks signés (JSON, Discord, Slack, Telegram), mode test, droits par clé, journal des appels, recherche avancée, modification et suppression des clients, retrait de tampons, création et annulation de cartes cadeaux, messages, statistiques par jour et meilleurs clients, testeur en direct, exemples en 10 langages, collection Postman. |
| 6 novembre 2026 | Clés lecture + écriture, création de clients, tampons, récompenses, cartes cadeaux, /events, idempotence, codes d'erreur. |
| 10 octobre 2026 | Première version : /me, /customers, /stats en lecture seule. |