Expense data model

Updated:

View field support, webhooks, and list parameters for each integration on the Supported Integrations page.

FieldTypeRequiredDescription
idstringNo
created_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
user_idstringNoreferences a HR employee/user (reference to HrisEmployee)
contact_idstringNo(reference to AccountingContact)
account_idstringNo(reference to AccountingAccount)
namestringNo
payment_methodstringNo
posted_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
total_amountnumberNo
currencystringNo
tax_amountnumberNo
reimbursed_amountnumberNo
reimbursed_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
approved_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
approver_user_idstringNoreferences HR employee/user (reference to HrisEmployee)
lineitemsAccountingLineitem[]No
lineitems[].idstringNo
lineitems[].created_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
lineitems[].updated_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
lineitems[].refunded_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
lineitems[].total_amountnumberNounit_quantity * unit_amount + tax_amount
lineitems[].refund_amountnumberNo
lineitems[].discount_amountnumberNo
lineitems[].tax_amountnumberNo
lineitems[].item_idstringNo(reference to CommerceItem)
lineitems[].unit_amountnumberNo
lineitems[].unit_quantitynumberNo
lineitems[].item_skustringNo
lineitems[].item_namestringNo
lineitems[].item_descriptionstringNo
lineitems[].notesstringNo
lineitems[].taxrate_idstringNo
lineitems[].account_idstringNo(reference to AccountingAccount)
lineitems[].category_idsstring[]No(reference to AccountingCategory)
lineitems[].locationsAccountingReference[]No
lineitems[].locations[].idstringNo
lineitems[].locations[].namestringNo
lineitems[].item_variantsAccountingReference[]No
lineitems[].item_variants[].idstringNo
lineitems[].item_variants[].namestringNo
lineitems[].feesAccountingFee[]No
lineitems[].fees[].typeenumYesUnified fee category Values: TAX, DISCOUNT, PROMOTION, SHIPPING, GIFT_WRAP, COD, SURCHARGE, TIP, SERVICE_CHARGE, OTHER
lineitems[].fees[].original_typestringNoThe provider's original fee label, e.g. "VAT" or a shipping carrier name
lineitems[].fees[].amountnumberYes
lineitems[].fees[].currencystringNoISO 4217 currency code, e.g. USD
lineitems[].contact_idstringNo(reference to AccountingContact)
lineitems[].project_idstringNoref -> AccountingProject; the project this line is coded to (reference to TaskProject)
lineitems[].exchange_ratenumberNoThe exchange rate applied to this line, for multi-currency documents
lineitems[].is_billablebooleanNoTrue when the line is rebillable to a customer
attachmentsAccountingAttachment[]No
attachments[].idstringNo
attachments[].download_urlstringNo
attachments[].namestringNo
attachments[].mime_typestringNo
organization_idstringNo
usersAccountingReference[]No
users[].idstringNo
users[].namestringNo
approver_usersAccountingReference[]Noexpense approver(s); id is HR employee/user when resolved
approver_users[].idstringNo
approver_users[].namestringNo
statusenumNoValues: DRAFT, SUBMITTED, PENDING, APPROVED, REJECTED, PAID
external_numberstringNo
category_idsstring[]No(reference to AccountingCategory)
project_idstringNo(reference to TaskProject)
metadataAccountingMetadata[]No
metadata[].idstringNoThe ID of the custom field definition (from the metadata/metadata endpoint).
metadata[].slugstringNoThe integration's API name (key) of an existing custom field. List valid slugs for this object with the metadata/metadata endpoint; unknown slugs are rejected by the integration.
metadata[].valueobjectNoThe field's value, typed by `format`: DATE as ISO-8601 (`YYYY-MM-DD`, or `YYYY-MM-DDTHH:MM:SSZ` for date-times); NUMBER, PRICE and CURRENCY as a number; BOOLEAN and YES_NO as true/false; MULTIPLE_SELECT as an array of option values; otherwise a string.
metadata[].namespacestringNo
metadata[].formatenumNoThe data type of the custom field, which determines how `value` is formatted. Values: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE_SELECT, MULTIPLE_SELECT, MEASUREMENT, PRICE, YES_NO, CURRENCY, URL
metadata[].extra_dataobjectNo
taxrate_idstringNoref -> AccountingTaxrate applied to the expense
exchange_ratenumberNoExchange rate to the base/home currency at the expense date
typeenumNoUSER = employee spend; COMPANY = books/purchase expense Values: USER, COMPANY

TypeScript

TypeScript
export type AccountingExpense = {
	id?: string;
	created_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	user_id?: string; // references a HR employee/user (reference to HrisEmployee)
	contact_id?: string; // (reference to AccountingContact)
	account_id?: string; // (reference to AccountingAccount)
	name?: string;
	payment_method?: string;
	posted_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	total_amount?: number;
	currency?: string;
	tax_amount?: number;
	reimbursed_amount?: number;
	reimbursed_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	approved_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	approver_user_id?: string; // references HR employee/user (reference to HrisEmployee)
	lineitems?: [];
	attachments?: [];
	organization_id?: string;
	users?: [];
	approver_users?: []; // expense approver(s); id is HR employee/user when resolved
	status?: 'DRAFT' | 'SUBMITTED' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'PAID';
	external_number?: string;
	category_ids?: string[]; // (reference to AccountingCategory)
	project_id?: string; // (reference to TaskProject)
	metadata?: [];
	taxrate_id?: string; // ref -> AccountingTaxrate applied to the expense
	exchange_rate?: number; // Exchange rate to the base/home currency at the expense date
	type?: 'USER' | 'COMPANY'; // USER = employee spend; COMPANY = books/purchase expense
	raw?: any;
} 

Zod

Zod
import { z } from 'zod';

export const ZodAccountingExpense = z.object({
	id: z.string().optional(),
	created_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	user_id: z.string().optional().describe("references a HR employee/user (reference to HrisEmployee)"),
	contact_id: z.string().optional().describe("(reference to AccountingContact)"),
	account_id: z.string().optional().describe("(reference to AccountingAccount)"),
	name: z.string().optional(),
	payment_method: z.string().optional(),
	posted_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	total_amount: z.number().optional(),
	currency: z.string().optional(),
	tax_amount: z.number().optional(),
	reimbursed_amount: z.number().optional(),
	reimbursed_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	approved_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	approver_user_id: z.string().optional().describe("references HR employee/user (reference to HrisEmployee)"),
	lineitems: z.array().optional(),
	attachments: z.array().optional(),
	organization_id: z.string().optional(),
	users: z.array().optional(),
	approver_users: z.array().optional().describe("expense approver(s); id is HR employee/user when resolved"),
	status: z.enum("DRAFT", "SUBMITTED", "PENDING", "APPROVED", "REJECTED", "PAID").optional(),
	external_number: z.string().optional(),
	category_ids: z.array().optional().describe("(reference to AccountingCategory)"),
	project_id: z.string().optional().describe("(reference to TaskProject)"),
	metadata: z.array().optional(),
	taxrate_id: z.string().optional().describe("ref -> AccountingTaxrate applied to the expense"),
	exchange_rate: z.number().optional().describe("Exchange rate to the base/home currency at the expense date"),
	type: z.enum("USER", "COMPANY").optional().describe("USER = employee spend; COMPANY = books/purchase expense"),

});

Python

Python
import dataclasses

@dataclasses.dataclass
class AccountingExpenseStatus(str, Enum):
	DRAFT = 'DRAFT'
	SUBMITTED = 'SUBMITTED'
	PENDING = 'PENDING'
	APPROVED = 'APPROVED'
	REJECTED = 'REJECTED'
	PAID = 'PAID'

@dataclasses.dataclass
class AccountingExpenseType(str, Enum):
	USER = 'USER'
	COMPANY = 'COMPANY'

@dataclasses.dataclass
class AccountingExpense:
	id: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""references a HR employee/user (reference to HrisEmployee)"""
	user_id: Optional[str]
	"""(reference to AccountingContact)"""
	contact_id: Optional[str]
	"""(reference to AccountingAccount)"""
	account_id: Optional[str]
	name: Optional[str]
	payment_method: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	posted_at: Optional[str]
	total_amount: Optional[int]
	currency: Optional[str]
	tax_amount: Optional[int]
	reimbursed_amount: Optional[int]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	reimbursed_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	approved_at: Optional[str]
	"""references HR employee/user (reference to HrisEmployee)"""
	approver_user_id: Optional[str]
	lineitems: Optional[PropertyAccountingExpenseLineitems]
	attachments: Optional[PropertyAccountingExpenseAttachments]
	organization_id: Optional[str]
	users: Optional[PropertyAccountingExpenseUsers]
	"""expense approver(s); id is HR employee/user when resolved"""
	approver_users: Optional[PropertyAccountingExpenseApprover_users]
	status: Optional[AccountingExpenseStatus]
	external_number: Optional[str]
	"""(reference to AccountingCategory)"""
	category_ids: Optional[List[List[str]]]
	"""(reference to TaskProject)"""
	project_id: Optional[str]
	metadata: Optional[PropertyAccountingExpenseMetadata]
	"""ref -> AccountingTaxrate applied to the expense"""
	taxrate_id: Optional[str]
	"""Exchange rate to the base/home currency at the expense date"""
	exchange_rate: Optional[int]
	"""USER = employee spend; COMPANY = books/purchase expense"""
	type: Optional[AccountingExpenseType]
Are we missing anything? Let us know
Was this page helpful?