Stripe
Production-grade database schema for a Stripe-like payment platform covering merchant accounts, customer management, payment methods, payment intents, charges, refunds, disputes, subscription billing with plan management, invoice generation, webhook event delivery, and balance transactions.
paymentsfintechbillingsubscriptionsapi
MySQL9 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique merchant account identifier
Account owner email address
Legal business name
ISO country code for account jurisdiction
Default payout currency
Whether account can accept charges
Whether payouts are enabled
Account creation timestamp
Last update timestamp
IXUQCK|💬
MySQL9 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique customer identifier
Merchant account this customer belongs to
Customer email address
Customer full name or business name
Customer phone number
Arbitrary key-value data attached to customer
Default payment method for charges
Customer creation timestamp
Last update timestamp
IXUQCK|💬
MySQL12 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique payment method identifier
Customer this payment method belongs to
Method type: card, bank_account, wallet
Card network: visa, mastercard, amex
Last 4 digits of card number
Card expiration month 1-12
Card expiration year e.g. 2027
Name on billing statement
Billing email address
Whether this is the default payment method
Payment method creation timestamp
Last update timestamp
IXUQCK|💬
MySQL12 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique payment intent identifier
Merchant account
Customer being charged
Amount in smallest currency unit e.g. cents
ISO currency code e.g. usd
Status: requires_payment_method, requires_confirmation, succeeded, canceled
Payment method used
Internal description of what is being paid for
Arbitrary key-value metadata
Secret token for client-side confirmation
Payment intent creation timestamp
Last update timestamp
IXUQCK|💬
MySQL14 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique charge identifier
Associated payment intent
Customer charged
Charged amount in smallest currency unit
ISO currency code
Charge status: pending, succeeded, failed
Whether charge was successfully paid
Whether charge has been refunded
Total refunded amount in smallest unit
Charge description shown on statement
Error code if charge failed
Human-readable failure reason
Charge creation timestamp
Last update timestamp
IXUQCK|💬
MySQL8 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique refund identifier
Charge being refunded
Refund amount in smallest currency unit
ISO currency code
Refund reason: duplicate, fraudulent, requested_by_customer
Refund status: pending, succeeded, failed
Refund initiation timestamp
Last update timestamp
IXUQCK|💬
MySQL8 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique product identifier
Merchant account that owns this product
Product display name
Product description
Whether product is active and can be sold
Arbitrary key-value metadata
Product creation timestamp
Last update timestamp
IXUQCK|💬
MySQL10 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique price identifier
Product this price belongs to
Price per unit in smallest currency unit
ISO currency code
Pricing type: one_time or recurring
Billing interval: day, week, month, year
Number of intervals between billings
Whether price is currently active
Price creation timestamp
Last update timestamp
IXUQCK|💬
MySQL11 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique subscription identifier
Subscribed customer
Subscription status: active, past_due, canceled, trialing
Start of current billing period
End of current billing period
Trial period start timestamp
Trial period end timestamp
Whether to cancel at end of current period
Timestamp when subscription was cancelled
Subscription creation timestamp
Last update timestamp
IXUQCK|💬
MySQL6 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique subscription item identifier
Parent subscription
Price being subscribed to
Quantity of this price in the subscription
Item creation timestamp
Last update timestamp
IXUQCK|💬
MySQL12 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique invoice identifier
Customer this invoice is for
Associated subscription if recurring
Invoice status: draft, open, paid, void, uncollectible
Total amount due in smallest currency unit
Amount already paid
ISO currency code
Invoice payment due date
Timestamp when invoice was fully paid
Human-readable invoice number
Invoice creation timestamp
Last update timestamp
IXUQCK|💬
MySQL9 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique invoice line item identifier
Parent invoice
Price this line item is for
Line item description
Line item amount in smallest currency unit
Quantity billed
ISO currency code
Item creation timestamp
Last update timestamp
IXUQCK|💬
MySQL9 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique dispute identifier
Disputed charge
Disputed amount in smallest currency unit
ISO currency code
Dispute reason: fraudulent, duplicate, subscription_canceled, etc.
Dispute status: warning_needs_response, needs_response, won, lost
Deadline to submit dispute evidence
Dispute creation timestamp
Last update timestamp
IXUQCK|💬
MySQL8 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique webhook endpoint identifier
Merchant account this webhook belongs to
HTTPS URL to deliver events to
Signing secret for payload verification
Array of event types to deliver
Endpoint status: enabled or disabled
Webhook creation timestamp
Last update timestamp
IXUQCK|💬
MySQL10 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique webhook event identifier
Account this event belongs to
Target webhook endpoint
Event type e.g. payment_intent.succeeded
Full event payload JSON
Delivery status: pending, delivered, failed
Number of delivery attempts
Timestamp of most recent delivery attempt
Event creation timestamp
Last update timestamp
IXUQCK|💬
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Created with ERD Studio
Tables in this template
accountsAccounts
9 colscustomersCustomers
9 colspayment_methodsPayment Methods
12 colspayment_intentsPayment Intents
12 colschargesCharges
14 colsrefundsRefunds
8 colsproductsProducts
8 colspricesPrices
10 colssubscriptionsSubscriptions
11 colssubscription_itemsSubscription Items
6 colsinvoicesInvoices
12 colsinvoice_itemsInvoice Items
9 colsdisputesDisputes
9 colswebhook_endpointsWebhook Endpoints
8 colswebhook_eventsWebhook Events
10 colsRelated Templates
View all templates →Trello Clone
CloneKanban project management with boards, lists, cards, checklists, and labels
PostgreSQL16 tables
kanbanproject-managementtasks+1
SaaS
SaaS Multi-Tenant
Multi-tenant SaaS application database with organizations, team members, roles, subscriptions, and API keys.
PostgreSQL10 tables
saasmulti-tenantsubscription+2
SaaS
Analytics Dashboard
Analytics platform database with workspaces, dashboards, widgets, data sources, events, and reports.
PostgreSQL6 tables
analyticsdashboardwidgets+3
SaaS
Helpdesk Ticketing
Helpdesk platform database with agents, customers, tickets, messages, categories, and SLA policies.
PostgreSQL6 tables
helpdeskticketingsupport+3
SaaS