Expense
extends DataTransferObject
in package
implements
DataModel
Expenses are used to track expenditures your business incurs.
Tags
Table of Contents
Interfaces
Constants
- RESPONSE_FIELD = 'expense'
Properties
- $accountId : int
- $accountingSystemId : string
- $accountName : string
- $amount : Money
- $attachment : ExpenseAttachment
- $bankName : string
- $billable : bool
- $categoryId : int
- $clientId : int
- $date : DateTime
- $expenseId : int
- $extAccountId : int
- $extInvoiceId : int
- $extSystemId : int
- $fromBulkImport : bool
- $hasReceipt : bool
- $id : int
- $includeReceipt : bool|null
- $invoiceId : int
- $isCogs : bool
- $isDuplicate : bool
- $markupPercent : string
- $modernProjectId : int
- $notes : string
- $potentialBillPayment : bool|null
- $profileId : int
- $projectId : int
- $staffId : int
- $status : int
- $taxAmount1 : Money
- $taxAmount2 : Money
- $taxName1 : string
- $taxName2 : string
- $taxPercent1 : string
- $taxPercent2 : string
- $transactionId : int
- $updated : DateTimeImmutable
- $vendor : string
- $visState : int
Methods
- getContent() : array<string|int, mixed>
- Get the data as an array to POST or PUT to FreshBooks, removing any read-only fields.
Constants
RESPONSE_FIELD
public
mixed
RESPONSE_FIELD
= 'expense'
Properties
$accountId
public
int
$accountId
Id of expense account if applicable.
Attributes
- #[MapFrom]
- 'accountid'
- #[MapTo]
- 'accountid'
$accountingSystemId
public
string
$accountingSystemId
Unique identifier of business the expense exists on.
Attributes
- #[MapFrom]
- 'accounting_systemid'
$accountName
public
string
$accountName
Name of related account if applicable.
Attributes
- #[MapFrom]
- 'account_name'
- #[MapTo]
- 'account_name'
$amount
public
Money
$amount
Total amount of invoice
Money object containing amount and currency code.
Attributes
- #[CastWith]
- \amcintosh\FreshBooks\Model\Caster\MoneyCaster::class
$attachment
public
ExpenseAttachment
$attachment
Attached receipt.
$bankName
public
string
$bankName
Name of bank expense was imported from, if applicable.
Attributes
- #[MapFrom]
- 'bank_name'
- #[MapTo]
- 'bank_name'
$billable
public
bool
$billable
Can the expense be billed to a Client or Project.
$categoryId
public
int
$categoryId
Id of the expense category.
Attributes
- #[MapFrom]
- 'categoryid'
- #[MapTo]
- 'categoryid'
$clientId
public
int
$clientId
Id of client the expense has been assigned to if applicable.
Attributes
- #[MapFrom]
- 'clientid'
- #[MapTo]
- 'clientid'
$date
public
DateTime
$date
Date of the expense.
The API returns this in YYYY-MM-DD format. It is converted to a DateTime.
Attributes
- #[CastWith]
- \amcintosh\FreshBooks\Model\Caster\DateCaster::class
$expenseId
public
int
$expenseId
Duplicate of id
Attributes
- #[MapFrom]
- 'expenseid'
$extAccountId
public
int
$extAccountId
The id of related contractor account if applicable.
Attributes
- #[MapFrom]
- 'ext_accountid'
- #[MapTo]
- 'ext_accountid'
$extInvoiceId
public
int
$extInvoiceId
The id of related contractor invoice if applicable.
Attributes
- #[MapFrom]
- 'ext_invoiceid'
- #[MapTo]
- 'ext_invoiceid'
$extSystemId
public
int
$extSystemId
The id of related contractor system if applicable.
Attributes
- #[MapFrom]
- 'ext_systemid'
- #[MapTo]
- 'ext_systemid'
$fromBulkImport
public
bool
$fromBulkImport
Indicates if the expense was created via a bulk import action.
Attributes
- #[MapFrom]
- 'from_bulk_import'
$hasReceipt
public
bool
$hasReceipt
Indicates if the expense has an attached receipt.
Attributes
- #[MapFrom]
- 'has_receipt'
- #[MapTo]
- 'has_receipt'
$id
public
int
$id
The unique identifier of this expense within this business.
$includeReceipt
public
bool|null
$includeReceipt
Attributes
- #[MapFrom]
- 'include_receipt'
- #[MapTo]
- 'include_receipt'
$invoiceId
public
int
$invoiceId
The id of related invoice if applicable.
Attributes
- #[MapFrom]
- 'invoiceid'
- #[MapTo]
- 'invoiceid'
$isCogs
public
bool
$isCogs
If the expense counts as "Cost of Goods Sold" and is associated with a client.
Attributes
- #[MapFrom]
- 'is_cogs'
- #[MapTo]
- 'is_cogs'
$isDuplicate
public
bool
$isDuplicate
If the expense is a duplicated expense.
Attributes
- #[MapFrom]
- 'isduplicate'
- #[MapTo]
- 'isduplicate'
$markupPercent
public
string
$markupPercent
Note of percent to mark expense up.
Attributes
- #[MapFrom]
- 'markup_percent'
- #[MapTo]
- 'markup_percent'
$modernProjectId
public
int
$modernProjectId
Id of related new FreshBooks (not Classic) project if applicable.
Attributes
- #[MapFrom]
- 'modern_projectid'
- #[MapTo]
- 'modern_projectid'
$notes
public
string
$notes
Notes about the expense.
$potentialBillPayment
public
bool|null
$potentialBillPayment
Attributes
- #[MapFrom]
- 'potential_bill_payment'
- #[MapTo]
- 'potential_bill_payment'
$profileId
public
int
$profileId
Id of related recurring expense profile if applicable.
Attributes
- #[MapFrom]
- 'profileid'
$projectId
public
int
$projectId
Id of related FreshBooks Classic project if applicable.
Attributes
- #[MapFrom]
- 'projectid'
- #[MapTo]
- 'projectid'
$staffId
public
int
$staffId
The id of related staff member if applicable.
Attributes
- #[MapFrom]
- 'staffid'
- #[MapTo]
- 'staffid'
$status
public
int
$status
The status of the expense.
Note: This is only writeable on creation.
Values are:
- 0: INTERNAL. Internal rather than client This is a feature of FreshBooks Classic only and should only appear in migrated accounts.
- 1: OUTSTANDING. Has client, needs to be applied to an invoice
- 2: INVOICED. Has client, attached to an invoice
- 4: RECOUPED. Has client, attached to an invoice, and paid
Tags
$taxAmount1
public
Money
$taxAmount1
The amount of the first tax making up the total amount of the expense.
Money object containing amount and currency code.
Attributes
- #[CastWith]
- \amcintosh\FreshBooks\Model\Caster\MoneyCaster::class
$taxAmount2
public
Money
$taxAmount2
The amount of the second tax making up the total amount of the expense.
Money object containing amount and currency code.
Attributes
- #[CastWith]
- \amcintosh\FreshBooks\Model\Caster\MoneyCaster::class
$taxName1
public
string
$taxName1
The name of first tax.
$taxName2
public
string
$taxName2
The name of second tax.
$taxPercent1
public
string
$taxPercent1
The string-decimal tax amount for first tax – indicates the maximum tax percentage for this expense.
$taxPercent2
public
string
$taxPercent2
The string-decimal tax amount for second tax – indicates the maximum tax percentage for this expense.
$transactionId
public
int
$transactionId
The id of related bank imported transaction if applicable.
Attributes
- #[MapFrom]
- 'transactionid'
- #[MapTo]
- 'transactionid'
$updated
public
DateTimeImmutable
$updated
The time of last modification.
Attributes
- #[CastWith]
- \amcintosh\FreshBooks\Model\Caster\AccountingDateTimeImmutableCaster::class
$vendor
public
string
$vendor
The name of the vendor.
$visState
public
int
$visState
The visibility state: active, deleted, or archived
Attributes
- #[MapFrom]
- 'vis_state'
Methods
getContent()
Get the data as an array to POST or PUT to FreshBooks, removing any read-only fields.
public
getContent() : array<string|int, mixed>