OtherIncomes
Other Income is for recording income that doesn’t require an invoice and is received through other means.
Table Specific Information
Insert
To insert OtherIncomes Date and Source fields are required. To insert OtherIncomes with multiple taxes, you can either insert an aggregate value into the TaxesAggregate field, or use a temporary table. This section provides examples of both procedures.You can insert OtherIncomes with multiple taxes using aggregates. For example:
Insert INTO OtherIncomes (Date, Source, TaxesAggregate) VALUES ('2018-02-03','Shopify','[{\"amount\" : \"5\", \"name\" : \"GST\"}]')"
You can also insert OtherIncomes with multiple taxes using a temporary table.
The temporary table you are populating is dynamic and will be created at run time the first time you insert to it. Temporary tables are denoted by a # appearing in their name. When using a temporary table to insert, the temporary table must be named in the format of [TableName]#TEMP, where TableName is the name of the table you will be inserting to. For example:
INSERT INTO OtherIncomesTaxes#TEMP (Name, Amount) VALUES ('Tax1', 500) INSERT INTO OtherIncomesTaxes#TEMP (Name, Amount) VALUES ('Tax2', 200)
Once your temporary table is populated, it is now time to insert to the actual table in FreshBooks. You can do this by performing an INSERT to the actual table and setting the name of the temporary table as a value for TaxesAggregate. For example:
Insert INTO OtherIncomes (Date, Source, TaxesAggregate) VALUES ('2018-02-03','Shopify', OtherIncomesTaxes#TEMP)
Update
To update, the IncomeId value is required in the WHERE clause. To update TaxesAggregate, you need to override the aggregate TaxesAggregate field, either by setting an aggregate value, or by using a temporary table. For example:INSERT INTO OtherIncomesTaxes#TEMP (Name, Amount) VALUES ('Tax1', 500) INSERT INTO OtherIncomesTaxes#TEMP (Name, Amount) VALUES ('Tax2', 300) UPDATE OtherIncomes SET Date = '2018-01-01', TaxesAggregate = 'InvoiceLineItems#TEMP' WHERE IncomeId = 29153
Delete
To delete, IncomeId value is required in the WHERE clause.DELETE from OtherIncomes where IncomeId = '26157'
Columns
Name | Type | ReadOnly | Description |
IncomeId [KEY] | Integer | True |
Unique identifier of this other income entry within the business |
Amount | String | False |
Amount of the income, to two decimal places |
AmountCode | String | False |
Three-letter currency code |
CategoryName | String | False |
Options include: advertising, in_person_sales, online_sales, rentals, other |
CreatedAt | Datetime | True |
Time the other income entry was created, YYYY-MM-DD HH:MM:SS format |
Date | Date | False |
The date the income was received, YYYY-MM-DD format |
Note | String | False |
Notes on the income |
PaymentType | String | False |
Optional type of payment made. “Check”, “Credit”, “Cash”, etc. |
Source | String | False |
Source of external income. E.g. Shopify, Etsy, Farmers’ Market |
Sourceid | Unknown | False |
Source ID |
TaxesAggregate | String | False |
Taxes Aggregate |
UpdatedAt | Datetime | True |
Time the other income entry was last updated, YYYY-MM-DD HH:MM:SS format |
Userid | Unknown | True |
User Id |
VisState | Integer | True |
0 for active,1 for deleted,2 for archived(more info on vis_state) |