freshbooks-php-sdk

Expense extends DataTransferObject implements DataModel

Expenses are used to track expenditures your business incurs.

Tags
link
https://www.freshbooks.com/api/expenses

Table of Contents

Interfaces

DataModel

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.

$accountingSystemId

public string $accountingSystemId

Unique identifier of business the expense exists on.

$accountName

public string $accountName

Name of related account if applicable.

$amount

public Money $amount

Total amount of invoice

Money object containing amount and currency code.

$bankName

public string $bankName

Name of bank expense was imported from, if applicable.

$billable

public bool $billable

Can the expense be billed to a Client or Project.

$categoryId

public int $categoryId

Id of the expense category.

$clientId

public int $clientId

Id of client the expense has been assigned to if applicable.

$date

public DateTime $date

Date of the expense.

The API returns this in YYYY-MM-DD format. It is converted to a DateTime.

$expenseId

public int $expenseId

Duplicate of id

$extAccountId

public int $extAccountId

The id of related contractor account if applicable.

$extInvoiceId

public int $extInvoiceId

The id of related contractor invoice if applicable.

$extSystemId

public int $extSystemId

The id of related contractor system if applicable.

$fromBulkImport

public bool $fromBulkImport

Indicates if the expense was created via a bulk import action.

$hasReceipt

public bool $hasReceipt

Indicates if the expense has an attached receipt.

$id

public int $id

The unique identifier of this expense within this business.

$includeReceipt

public bool|null $includeReceipt

$invoiceId

public int $invoiceId

The id of related invoice if applicable.

$isCogs

public bool $isCogs

If the expense counts as "Cost of Goods Sold" and is associated with a client.

$isDuplicate

public bool $isDuplicate

If the expense is a duplicated expense.

$markupPercent

public string $markupPercent

Note of percent to mark expense up.

$modernProjectId

public int $modernProjectId

Id of related new FreshBooks (not Classic) project if applicable.

$notes

public string $notes

Notes about the expense.

$potentialBillPayment

public bool|null $potentialBillPayment

$profileId

public int $profileId

Id of related recurring expense profile if applicable.

$projectId

public int $projectId

Id of related FreshBooks Classic project if applicable.

$staffId

public int $staffId

The id of related staff member if applicable.

$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
see
ExpenseStatus

for a value constants.

link
https://www.freshbooks.com/api/expenses

$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.

$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.

$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.

$updated

public DateTimeImmutable $updated

The time of last modification.

$vendor

public string $vendor

The name of the vendor.

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>
Return values
array<string|int, mixed>

        
On this page

Search results