Payment
A Payment records a monetary transaction for an account. Payments can be synced from Stripe or recorded manually.
Schema
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;
}
Properties
| Property |
Type |
Description |
id |
string |
KSUID with pay prefix |
account_id |
string |
Owning account |
amount_cents |
number |
Amount in minor units (cents) |
currency |
string |
ISO 4217 currency code |
status |
enum |
Payment lifecycle status |
paid_at |
string? |
When payment succeeded |
payment_method |
string? |
Payment method type |
external_id |
string? |
Provider payment ID |
external_customer_id |
string? |
Provider customer ID |
external_data |
object? |
Raw provider snapshot |
Status Values
| Status |
Description |
pending |
Awaiting processing |
succeeded |
Payment completed |
failed |
Payment failed |
canceled |
Payment canceled |
refunded |
Returned to customer |
Example
{
"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"
}