Remboursements

Création d’un remboursement sur un paiement existant (Sandbox uniquement pour le moment).

Via API clé

POST/v1/payments/:id/refunds

Scope payments:write. Header Idempotency-Key obligatoire.

Body
{
  "amount": 5000,
  "reason": "partial_refund"
}
Réponse 201
{
  "refund": {
    "refundId": "…",
    "status": "…",
    "amount": "5000",
    "transactionStatus": "…"
  }
}

Via session marchand

POST/api/merchant/payments/:id/refunds

CSRF + Idempotency-Key (ou body). Body : storeId, amount, reason?.

Réponse 409 (Production)
{
  "error": {
    "code": "REFUND_NOT_AVAILABLE",
    "message": "Le remboursement n'est pas encore disponible en Production. Contactez le support AIFI PAY."
  }
}