Paiements

Initiez, confirmez et gérez des paiements sur tous les fournisseurs avec un seul endpoint.

Initier un paiement

POST https://api.germinopay.com/v1/paiement/initier

Crée un paiement et retourne une URL de redirection. Envoyez l'utilisateur sur cette URL.

Paramètres

Champ Type Requis Description
montant number Oui Montant à débiter (dans l'unité de la devise).
devise string Oui Code devise : XOF, XAF, EUR, USD, NGN, GHS.
fournisseur string Oui paypal, cinetpay, fedapay, paydunya
reference string Oui Votre propre référence unique (n° de commande, facture...).
client_email string Non Email du client payeur (pour les reçus).
client_nom string Non Nom du client.
return_url string Non URL vers laquelle rediriger le client après paiement réussi.
cancel_url string Non URL vers laquelle rediriger si le client annule.
metadata object Non Données personnalisées attachées à la transaction (renvoyées dans les webhooks).

Réponses

200 OK Paiement initié avec succès
{
  "success": true,
  "message": "Payment initiated successfully",
  "data": {
    "reference": "GP-20251001-ABC123",
    "transaction_id": "txn_9f8e7d6c5b4a",
    "fournisseur": "cinetpay",
    "montant": 5000,
    "devise": "XOF",
    "frais": 75,
    "montant_net": 4925,
    "statut": "initie",
    "payment_url": "https://checkout.cinetpay.com/pay/GP-20251001-ABC123",
    "expires_at": "2025-10-01T14:30:00Z",
    "created_at": "2025-10-01T13:30:00Z",
    "metadata": {
      "commande_id": 1042
    }
  }
}
400 Bad Request Paramètres invalides
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "The 'montant' field must be a positive number",
    "field": "montant",
    "docs": "https://germinopay.com/docs/erreurs#INVALID_PARAMETER"
  }
}
401 Unauthorized Signature invalide
{
  "success": false,
  "error": {
    "code": "INVALID_SIGNATURE",
    "message": "The HMAC signature does not match",
    "docs": "https://germinopay.com/docs/erreurs#INVALID_SIGNATURE"
  }
}
409 Conflict Référence déjà utilisée
{
  "success": false,
  "error": {
    "code": "DUPLICATE_REFERENCE",
    "message": "A transaction with this reference already exists",
    "docs": "https://germinopay.com/docs/erreurs#DUPLICATE_REFERENCE"
  }
}

Vérifier un paiement

GET https://api.germinopay.com/v1/paiement/{reference}
curl https://api.germinopay.com/v1/paiement/GP-20251001-ABC123 \
  -H "X-Public-Key: pk_live_xxxx" \
  -H "X-Timestamp: 1730000000" \
  -H "X-Signature: hmac_sha256_signature"
<?php
$reference = "GP-20251001-ABC123";
$timestamp = time();
$message = "GET/v1/paiement/" . $reference . $timestamp;
$signature = hash_hmac("sha256", $message, $secretKey);

$ch = curl_init("https://api.germinopay.com/v1/paiement/" . $reference);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "X-Public-Key: " . $publicKey,
        "X-Timestamp: " . $timestamp,
        "X-Signature: " . $signature,
    ],
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);

echo $data["data"]["statut"]; // initie, en_cours, succes, echoue, rembourse
200 OK
{
  "success": true,
  "data": {
    "reference": "GP-20251001-ABC123",
    "transaction_id": "txn_9f8e7d6c5b4a",
    "fournisseur": "cinetpay",
    "montant": 5000,
    "devise": "XOF",
    "frais": 75,
    "montant_net": 4925,
    "statut": "succes",
    "client_email": "client@example.com",
    "metadata": { "commande_id": 1042 },
    "created_at": "2025-10-01T13:30:00Z",
    "paid_at": "2025-10-01T13:32:15Z"
  }
}

Spécificités par fournisseur

PayPal

CinetPay

FedaPay

PayDunya