Documentation API Remboursements

Remboursements

Refund a transaction, fully or partially, directly through the API.

Create a refund

POST https://api.germinopay.com/v1/paiement/{reference}/rembourser
Field Type Required Description
montant number No Amount to refund. If omitted, the full amount is refunded.
raison string No Reason for the refund (shown to the customer).
curl -X POST https://api.germinopay.com/v1/paiement/GP-20251001-ABC123/rembourser \
  -H "Content-Type: application/json" \
  -H "X-Public-Key: pk_live_xxxx" \
  -H "X-Timestamp: 1730000000" \
  -H "X-Signature: hmac_sha256_signature" \
  -d '{
    "raison": "Client a demandé un remboursement"
  }'
<?php
$reference = "GP-20251001-ABC123";
$body = json_encode(["raison" => "Client a demandé un remboursement"]);
$path = "/v1/paiement/" . $reference . "/rembourser";
$timestamp = time();
$signature = hash_hmac("sha256", "POST" . $path . $body . $timestamp, $secretKey);

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

$data = json_decode(curl_exec($ch), true);
const reference = 'GP-20251001-ABC123';
const body = JSON.stringify({ raison: 'Client a demandé un remboursement' });
const path = `/v1/paiement/${reference}/rembourser`;
const timestamp = Math.floor(Date.now() / 1000);
const signature = crypto
  .createHmac('sha256', process.env.GERMINOPAY_SECRET)
  .update(`POST${path}${body}${timestamp}`)
  .digest('hex');

const res = await fetch(`https://api.germinopay.com${path}`, {
  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();
200 OK
{
  "success": true,
  "message": "Refund initiated",
  "data": {
    "refund_id": "rfd_a1b2c3d4e5",
    "reference": "GP-20251001-ABC123",
    "montant_rembourse": 5000,
    "devise": "XOF",
    "statut": "en_cours",
    "raison": "Client a demandé un remboursement",
    "created_at": "2025-10-01T15:00:00Z"
  }
}

Partial refund

curl -X POST https://api.germinopay.com/v1/paiement/GP-20251001-ABC123/rembourser \
  -H "Content-Type: application/json" \
  -H "X-Public-Key: pk_live_xxxx" \
  -H "X-Timestamp: 1730000000" \
  -H "X-Signature: hmac_sha256_signature" \
  -d '{
    "montant": 2000,
    "raison": "Article retourné partiellement"
  }'

Statuts de remboursement

Status Meaning
en_coursRefund is being processed by the provider.
rembourseRefund completed. Amount has been deducted from your balance.
echoueRefund failed (insufficient balance, time limit exceeded...).

Rules & limits

Balance requirement Your merchant balance must be sufficient to cover the refund. Otherwise the request is rejected.