Skip to main content

Accounting APIs and Schemas

Database Schemas

Diagram example

Invoice Table

ColumnTypeDescription
invoice_idintegerPrimary key for the invoice
customer_idintegerForeign key to the customer table
invoice_datedateDate the invoice was created
due_datedateDate payment is due
total_amountdecimalTotal amount due on the invoice
paid_amountdecimalTotal amount paid on the invoice
statusstringStatus of the invoice (e.g. unpaid, partially paid, paid)
created_atdatetimeTimestamp of when the invoice was created
updated_atdatetimeTimestamp of when the invoice was last updated

Payment Table

ColumnTypeDescription
payment_idintegerPrimary key for the payment
customer_idintegerForeign key to the customer table
invoice_idintegerForeign key to the invoice table
payment_datedateDate the payment was made
payment_amountdecimalAmount of the payment
created_atdatetimeTimestamp of when the payment was created
updated_atdatetimeTimestamp of when the payment was last updated

Customer Table

ColumnTypeDescription
customer_idintegerPrimary key for the customer
namestringName of the customer
emailstringEmail address of the customer
phone_numberstringPhone number of the customer
addressstringAddress of the customer
created_atdatetimeTimestamp of when the customer was created
updated_atdatetimeTimestamp of when the customer was last updated

Tax Table

ColumnTypeDescription
tax_idintegerPrimary key for the tax
namestringName of the tax
ratedecimalTax rate as a decimal
created_atdatetimeTimestamp of when the tax was created
updated_atdatetimeTimestamp of when the tax was last updated

Account Table

ColumnTypeDescription
account_idintegerPrimary key for the account
namestringName of the account
account_typestringType of the account (e.g. asset, liability, equity, revenue, expense)
balancedecimalCurrent balance of the account
created_atdatetimeTimestamp of when the account was created
updated_atdatetimeTimestamp of when the account was last updated

Journal Entry Table

ColumnTypeDescription
journal_entry_idintegerPrimary key for the journal entry
datedateDate of the journal entry
descriptionstringDescription of the journal entry
created_atdatetimeTimestamp of when the journal entry was created
updated_atdatetimeTimestamp of when the journal entry was last updated

Accounting APIs

APIs and Microservices