Overview
Before creating expense transactions, you need to understand how to map your expense data to the correct accounts, tax rates, suppliers, and customers in your customer’s accounting software. This ensures expenses are categorized correctly and appear in the right place in their books.Configuration levels
Sync2Books supports expense mapping at two levels:- Company-level defaults - Set default mappings that apply to all expenses for a company
- Transaction-level overrides - Specify mappings for individual expense transactions
Company-level configuration
Set default mappings at the company level to ensure expenses are automatically categorized correctly even if specific references are omitted in individual transactions.Configure expense defaults
Request
Response
Get expense configuration
Request
Response
Transaction-level mapping
When creating an expense transaction, you can specify mappings for that specific transaction. These override company-level defaults.Required mappings
accountRef- The expense account to categorize the expensetaxRateRef- The tax rate to apply (if applicable)
Optional mappings
contactRef- Supplier or customer associated with the expensebankAccountRef- Bank account used for the paymenttrackingRefs- Tracking categories for reportinginvoiceTo- Customer to invoice (for billable expenses)
Example expense with mappings
Getting reference IDs
Before creating expenses, you need valid IDs from your customer’s accounting system. You can retrieve these using Sync2Books reference endpoints.Get accounts
Request
Response
Get tax rates
Request
Response
Get suppliers
Request
Response
Get customers
Request
Response
Fallback behavior
If a transaction omits a reference (e.g.,contactRef or bankAccountRef), Sync2Books will:
- Check for company-level defaults
- Use the default if available
- Return an error if required and no default is set
Example: Missing contact reference
If an expense transaction doesn’t include acontactRef:
- Sync2Books checks for a company-level
supplierdefault - If found, uses that supplier
- If not found, checks for a company-level
customerdefault - If still not found, the sync may fail (depending on accounting software requirements)
Best practices
- Set company-level defaults - Configure defaults for common mappings to reduce transaction complexity
- Validate reference IDs - Ensure all IDs exist in the accounting system before creating expenses
- Use tracking categories - Leverage tracking categories for better reporting and categorization
- Handle billable expenses - Use
invoiceToto mark expenses as billable to customers - Document mappings - Keep a record of your mapping strategy for each customer
Read next
- Create transactions - Learn how to create expense transactions with proper mappings
- Sync transactions - Understand how mappings are applied during sync