Overview
Customer data is managed as part of invoice creation and updates. There is no separate customer API endpoint. Customer information is embedded within invoice objects.Customer object structure
The customer object is included in every invoice and contains the following fields:Unique customer identifier
Customer or company name
Customer email address for invoice delivery
Street address
City
State or province
Postal or ZIP code
Country name
Optional URL to customer logo image
Example customer object
Working with customers
Creating an invoice with customer data
When creating an invoice, include the complete customer object in the request body:Updating customer information
To update customer information for an existing invoice, use the PATCH endpoint:Using customer data in templates
Templates can include partial customer data that will be pre-filled when creating new invoices:Storage implementation
Currently, the Invoice Generator application uses localStorage on the client side to store customer data. Customer information persists as part of invoice objects and can be reused across multiple invoices. When implementing a database backend, consider:- Creating a separate
customerstable for normalized data storage - Linking invoices to customers via foreign key relationships
- Implementing a dedicated customer API for CRUD operations
- Adding customer search and filtering capabilities
app/lib/types.ts:6-16 for the complete Customer interface.