Invoice
An Invoice tracks a maker's purchase of Credits. Invoices support multiple payment providers and include VAT handling.
Properties
| Property | Type | Description |
|---|---|---|
Id | int | Primary key |
UserId | int | FK → AppUser |
Sku | string | Credit pack SKU |
Quantity | int | Number of packs purchased |
NetAmountSats | long | Price before VAT |
VatRate | decimal | VAT percentage |
VatAmountSats | long | VAT amount in satoshis |
TotalSats | long | Total price including VAT |
VatExempt | bool | Whether VAT is exempt (valid EU VAT ID) |
BuyerVatId | string? | Buyer's VAT number |
BuyerCompanyName | string? | Company name |
PaymentProvider | PaymentProvider | Which provider processed the payment |
PaymentChannel | string? | Provider-specific channel |
PaymentReference | string? | Provider-specific transaction ID |
Status | InvoiceStatus | Current status |
Payment Providers
| Name | Description |
|---|---|
| Stripe | Credit/debit card via Stripe Checkout |
| Mollie | European payment methods via Mollie |
| DirectBitcoin | Pay directly with Bitcoin |
Invoice Statuses
| Status | Description |
|---|---|
| Pending | Payment initiated, awaiting confirmation |
| Paid | Payment confirmed, credits granted |
| Cancelled | Payment cancelled |
| Expired | Payment window expired |
Relationships
Invoice (N) ──── (1) AppUser
Invoice (1) ──── (N) CreditWhen an invoice is marked Paid, the corresponding Credit records are created and added to the user's balance.