Skip to content

Invoicing Schema

Per-user invoicing configuration.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
user_iduuidNO
invoice_prefixtextNO'INV-'
quotation_prefixtextNO'QUO-'
payment_prefixtextNO'PAY-'
next_invoice_numberintegerNO1
next_quotation_numberintegerNO1
next_payment_numberintegerNO1
default_currencytextNO'USD'
default_tax_methodtextNO'exclusive'
default_due_daysintegerNO30
default_notetextYES
metadatajsonbYES'{}'
created_attimestamptzNOnow()
updated_attimestamptzNOnow()

Invoicing customer records.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
user_iduuidNO
profile_iduuidYES
nametextNO
companytextYES
emailtextYES
phonetextYES
addresstextYES
citytextYES
statetextYES
postal_codetextYES
countrytextYES
balancenumericNO0
metadatajsonbYES'{}'
created_attimestamptzNOnow()
updated_attimestamptzNOnow()

Reusable product/service catalog.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
user_iduuidNO
nametextNO
descriptiontextYES
pricenumericNO0
tax_methodtextNO'exclusive'
metadatajsonbYES'{}'
created_attimestamptzNOnow()
updated_attimestamptzNOnow()

User-defined tax rates.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
user_iduuidNO
nametextNO
ratenumericNO0
is_fixedbooleanNOfalse
created_attimestamptzNOnow()

Invoice records with totals, payment tracking, and recurrence.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
user_iduuidNO
customer_iduuidNO
platform_payment_iduuidYES
numbertextNO
referencetextYES
hashtextNOsubstr(gen_random_uuid(), 1, 12)
datedateNOCURRENT_DATE
due_datedateYES
statustextNO'draft'
subtotalnumericNO0
total_taxnumericNO0
total_discountnumericNO0
shippingnumericNO0
grand_totalnumericNO0
paid_amountnumericNO0
notetextYES
tax_methodtextNO'exclusive'
receipt_urltextYES
is_recurringbooleanNOfalse
recurring_intervaltextYES
next_recurrence_datedateYES
metadatajsonbYES'{}'
sent_attimestamptzYES
viewed_attimestamptzYES
paid_attimestamptzYES
created_attimestamptzNOnow()
updated_attimestamptzNOnow()

Invoice line items.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
invoice_iduuidNO
catalog_item_iduuidYES
nametextNO
descriptiontextYES
quantitynumericNO1
unit_pricenumericNO0
discountnumericNO0
discount_amountnumericNO0
tax_amountnumericNO0
subtotalnumericNO0
totalnumericNO0
sort_ordersmallintNO0
metadatajsonbYES'{}'

Tax rates applied to invoice items.

ColumnTypeNullableDefault
invoice_item_iduuidNO
tax_rate_iduuidNO

Payments against invoices.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
invoice_iduuidNO
user_iduuidNO
platform_payment_iduuidYES
numbertextNO
amountnumericNO
methodtextNO'stripe'
datedateNOCURRENT_DATE
notetextYES
receipt_urltextYES
metadatajsonbYES'{}'
created_attimestamptzNOnow()

Price quotations (convertible to invoices).

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
user_iduuidNO
customer_iduuidNO
numbertextNO
referencetextYES
hashtextNOsubstr(gen_random_uuid(), 1, 12)
datedateNOCURRENT_DATE
expiry_datedateYES
statustextNO'draft'
subtotalnumericNO0
total_taxnumericNO0
total_discountnumericNO0
shippingnumericNO0
grand_totalnumericNO0
notetextYES
tax_methodtextNO'exclusive'
converted_invoice_iduuidYES
metadatajsonbYES'{}'
sent_attimestamptzYES
viewed_attimestamptzYES
created_attimestamptzNOnow()
updated_attimestamptzNOnow()

Quotation line items.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
quotation_iduuidNO
catalog_item_iduuidYES
nametextNO
descriptiontextYES
quantitynumericNO1
unit_pricenumericNO0
discountnumericNO0
discount_amountnumericNO0
tax_amountnumericNO0
subtotalnumericNO0
totalnumericNO0
sort_ordersmallintNO0
metadatajsonbYES'{}'

Polymorphic notes on invoicing entities.

ColumnTypeNullableDefault
iduuidNOgen_random_uuid()
user_iduuidNO
notable_iduuidNO
notable_typetextNO
contenttextNO
created_attimestamptzNOnow()