KaspaNova.io

Documentation API
FR EN

Introduction

L’API KaspaNova permet aux marchands de créer des paiements en $KAS, d’afficher une session de paiement à leur client, puis de vérifier la confirmation sur la blockchain Kaspa.

Créer un paiement

POST /api/create-payment

Crée une session de paiement que le client peut utiliser.

Paramètres attendus

{
  "amountFiat": 49.99,
  "currency": "CAD",
  "merchantId": "WIX-123"
}

Réponse

{
  "paymentId": "d98551ce-939a-4205-8613-350f4bf0d717",
  "merchantId": "WIX-123",
  "currency": "CAD",
  "amountFiat": 49.99,
  "kasPrice": 0.365,
  "amountKas": 136.92,
  "kasAddress": "kaspa:demo_WIX-123_ab19d4f22d91",
  "expiresAt": 1736114189000
}

Exemple cURL

curl -X POST https://kaspanova.io/api/create-payment \
  -H "Content-Type: application/json" \
  -d '{
    "amountFiat": 49.99,
    "currency": "CAD",
    "merchantId": "WIX-123"
  }'

Vérifier un paiement

GET /api/verify-payment/:paymentId

Récupère le statut blockchain d’une session.

Réponse possible

{
  "status": "confirmed",
  "expectedKas": 136.92,
  "receivedKas": 137.02,
  "expiresAt": 1736114189000,
  "kasAddress": "kaspa:demo_WIX-123_ab19d4f22d91"
}

Statuts possibles

Intégration rapide

Wix / Velo

wixLocation.to("/pay/?id=" + paymentId);

Node.js

const r = await fetch("https://kaspanova.io/api/create-payment", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    amountFiat: 49.99,
    currency: "CAD",
    merchantId: "SHOP-22"
  })
});
const session = await r.json();