Documentation API Démarrage

Démarrage

Créez votre compte, obtenez vos clés et effectuez votre premier paiement.

Prerequisites

Step 1: Create your account

Sign up, fill in your business information. Our team validates your account within 24 hours.

Sign up

Step 2: Get your API keys

From your dashboard, generate your API keys:

Security note The secret key is displayed only once. Store it securely in an environment variable, never in your source code.

Step 3: Your first API call

POST https://api.germinopay.com/v1/paiement/initier
curl -X POST https://api.germinopay.com/v1/paiement/initier \
  -H "Content-Type: application/json" \
  -H "X-Public-Key: pk_live_votre_cle_publique" \
  -H "X-Timestamp: 1730000000" \
  -H "X-Signature: hmac_sha256_signature" \
  -d '{
    "montant": 5000,
    "devise": "XOF",
    "fournisseur": "cinetpay",
    "reference": "CMD-1042",
    "client_email": "client@example.com",
    "return_url": "https://monsite.com/paiement/succes",
    "cancel_url": "https://monsite.com/paiement/annule"
  }'
<?php
$payload = [
    "montant"      => 5000,
    "devise"       => "XOF",
    "fournisseur"  => "cinetpay",
    "reference"    => "CMD-1042",
    "client_email" => "client@example.com",
    "return_url"   => "https://monsite.com/paiement/succes",
    "cancel_url"   => "https://monsite.com/paiement/annule",
];

$body = json_encode($payload);
$timestamp = time();
$signature = hash_hmac("sha256", "POST/v1/paiement/initier" . $body . $timestamp, $secretKey);

$ch = curl_init("https://api.germinopay.com/v1/paiement/initier");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "X-Public-Key: " . $publicKey,
        "X-Timestamp: " . $timestamp,
        "X-Signature: " . $signature,
    ],
    CURLOPT_POSTFIELDS => $body,
]);

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

if ($data["success"]) {
    header("Location: " . $data["data"]["payment_url"]);
    exit;
}
const crypto = require('crypto');

const payload = {
  montant: 5000,
  devise: "XOF",
  fournisseur: "cinetpay",
  reference: "CMD-1042",
  client_email: "client@example.com",
  return_url: "https://monsite.com/paiement/succes",
  cancel_url: "https://monsite.com/paiement/annule",
};

const body = JSON.stringify(payload);
const timestamp = Math.floor(Date.now() / 1000);
const signature = crypto
  .createHmac('sha256', process.env.GERMINOPAY_SECRET)
  .update(`POST/v1/paiement/initier${body}${timestamp}`)
  .digest('hex');

const res = await fetch('https://api.germinopay.com/v1/paiement/initier', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Public-Key': process.env.GERMINOPAY_PUBLIC,
    'X-Timestamp': timestamp,
    'X-Signature': signature,
  },
  body,
});

const data = await res.json();
if (data.success) {
  // Rediriger l'utilisateur
  console.log(data.data.payment_url);
}
import hashlib
import hmac
import json
import time
import requests

payload = {
    "montant": 5000,
    "devise": "XOF",
    "fournisseur": "cinetpay",
    "reference": "CMD-1042",
    "client_email": "client@example.com",
    "return_url": "https://monsite.com/paiement/succes",
    "cancel_url": "https://monsite.com/paiement/annule",
}

body = json.dumps(payload, separators=(',', ':'))
timestamp = int(time.time())
message = f"POST/v1/paiement/initier{body}{timestamp}"
signature = hmac.new(
    b"votre_cle_secrete",
    message.encode(),
    hashlib.sha256
).hexdigest()

response = requests.post(
    "https://api.germinopay.com/v1/paiement/initier",
    data=body,
    headers={
        "Content-Type": "application/json",
        "X-Public-Key": "pk_live_votre_cle_publique",
        "X-Timestamp": str(timestamp),
        "X-Signature": signature,
    }
)

data = response.json()
if data["success"]:
    print(data["data"]["payment_url"])
200 OK Success response
{
  "success": true,
  "message": "Payment initiated",
  "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"
  }
}

Step 4: Configure your webhook

A webhook is an HTTP POST sent to your server when a payment status changes. Configure it once in your dashboard and we'll notify you automatically.

Why use webhooks? Because redirects can be cancelled by the user. Webhooks guarantee delivery even if the user closes the browser.

See the complete guide → Webhooks

What's next?