Paiement
Un paiement enregistre une transaction monétaire pour un compte. Les paiements peuvent être synchronisés depuis Stripe ou enregistrés manuellement.
Schéma
interface Payment {
id: string; // "pay..." - Unique identifier
account_id: string;
amount_cents: number;
currency: string;
status: "pending" | "succeeded" | "failed" | "canceled" | "refunded";
paid_at: string | null;
payment_method: string | null;
external_id: string | null;
external_customer_id: string | null;
external_data: unknown | null;
}
Propriétés
| Propriété | Type | Description |
|---|
id | string | KSUID avec préfixe pay |
account_id | string | Compte propriétaire |
amount_cents | number | Montant en unité mineure (centimes) |
currency | string | Code devise ISO 4217 |
status | enum | Statut du cycle de vie du paiement |
paid_at | string? | Date/heure de réussite du paiement |
payment_method | string? | Type de moyen de paiement |
external_id | string? | ID de paiement côté fournisseur |
external_customer_id | string? | ID client côté fournisseur |
external_data | object? | Snapshot brut du fournisseur |
Valeurs de statut
| Status | Description |
|---|
pending | En attente de traitement |
succeeded | Paiement réussi |
failed | Paiement échoué |
canceled | Paiement annulé |
refunded | Remboursé au client |
Exemple
{
"id": "pay123",
"account_id": "acc456",
"amount_cents": 9900,
"currency": "usd",
"status": "succeeded",
"paid_at": "2026-01-15T10:30:00Z",
"payment_method": "card",
"external_id": "pi_abc123",
"external_customer_id": "cus_xyz789"
}
Liés