Guides
SDK et outils
Recettes curl, Postman, et état des SDK officiels.
L'API NovPay est une API REST standard : tout client HTTP fonctionne.
curl
# Variable d'environnement pour la clé
export NOVPAY_KEY="nvp_test_sk_..."
curl https://api.novpay.net/v1/balance \
-H "Authorization: Bearer $NOVPAY_KEY"Node.js (fetch natif)
const res = await fetch('https://api.novpay.net/v1/payment_intents', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NOVPAY_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({ amount: 50000, currency: 'htg' }),
});
const intent = await res.json();PHP
$ch = curl_init('https://api.novpay.net/v1/balance');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . getenv('NOVPAY_KEY'),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$balance = json_decode(curl_exec($ch), true);Postman
Importez la spécification OpenAPI (/v1/openapi.json)
dans Postman pour générer automatiquement une collection de tous les endpoints.
Aucun SDK officiel n'est encore publié. La spec OpenAPI permet en attendant de générer des clients dans la plupart des langages (openapi-generator, etc.).