Accounting APIs and Schemas
Database Schemas
Diagram example
Invoice Table
Column | Type | Description |
---|---|---|
invoice_id | integer | Primary key for the invoice |
customer_id | integer | Foreign key to the customer table |
invoice_date | date | Date the invoice was created |
due_date | date | Date payment is due |
total_amount | decimal | Total amount due on the invoice |
paid_amount | decimal | Total amount paid on the invoice |
status | string | Status of the invoice (e.g. unpaid, partially paid, paid) |
created_at | datetime | Timestamp of when the invoice was created |
updated_at | datetime | Timestamp of when the invoice was last updated |
Payment Table
Column | Type | Description |
---|---|---|
payment_id | integer | Primary key for the payment |
customer_id | integer | Foreign key to the customer table |
invoice_id | integer | Foreign key to the invoice table |
payment_date | date | Date the payment was made |
payment_amount | decimal | Amount of the payment |
created_at | datetime | Timestamp of when the payment was created |
updated_at | datetime | Timestamp of when the payment was last updated |
Customer Table
Column | Type | Description |
---|---|---|
customer_id | integer | Primary key for the customer |
name | string | Name of the customer |
string | Email address of the customer | |
phone_number | string | Phone number of the customer |
address | string | Address of the customer |
created_at | datetime | Timestamp of when the customer was created |
updated_at | datetime | Timestamp of when the customer was last updated |
Tax Table
Column | Type | Description |
---|---|---|
tax_id | integer | Primary key for the tax |
name | string | Name of the tax |
rate | decimal | Tax rate as a decimal |
created_at | datetime | Timestamp of when the tax was created |
updated_at | datetime | Timestamp of when the tax was last updated |
Account Table
Column | Type | Description |
---|---|---|
account_id | integer | Primary key for the account |
name | string | Name of the account |
account_type | string | Type of the account (e.g. asset, liability, equity, revenue, expense) |
balance | decimal | Current balance of the account |
created_at | datetime | Timestamp of when the account was created |
updated_at | datetime | Timestamp of when the account was last updated |
Journal Entry Table
Column | Type | Description |
---|---|---|
journal_entry_id | integer | Primary key for the journal entry |
date | date | Date of the journal entry |
description | string | Description of the journal entry |
created_at | datetime | Timestamp of when the journal entry was created |
updated_at | datetime | Timestamp of when the journal entry was last updated |
Accounting APIs
APIs and Microservices
- Accounting example