In Zoho Books, your business is termed as an organization. If you have multiple businesses, you simply set each of those up as an individual organization. Each organization is an independent Zoho Books Organization with it’s own organization ID, base currency, time zone, language, contacts, reports, etc.
The parameter organization_id
should be sent in with every API request to identify the organization.
The organization_id
can be obtained from the GET /organizations
API’s JSON response. Alternatively, it can be obtained from the Manage Organizations page in the admin console.
ID of the expense account.
Date of the expense.
Amount of the Expense.
async
(params, auths) => {
}
// See the API docs: https://www.zoho.com/books/api/v3/#Expenses_Create_an_Expense
if (!params.organization_id || !params.account_id || !params.date || !params.amount) {
throw new Error("Must provide organization_id, account_id, date, and amount parameters.");
}
return await require("@pipedreamhq/platform").axios(this, {
method: "post",
url: `https://books.${auths.zoho_books.base_api_uri}/api/v3/expenses?organization_id=${params.organization_id}`,
headers: {
Authorization: `Zoho-oauthtoken ${auths.zoho_books.oauth_access_token}`,
},
data: {
account_id: params.account_id,
date: params.date,
amount: params.amount,
tax_id: params.tax_id,
source_of_supply: params.source_of_supply,
destination_of_supply: params.destination_of_supply,
place_of_supply: params.place_of_supply,
hsn_or_sac: params.hsn_or_sac,
gst_no: params.gst_no,
reverse_charge_tax_id: params.reverse_charge_tax_id,
line_items: params.line_items,
is_inclusive_tax: params.is_inclusive_tax,
is_billable: params.is_billable,
reference_number: params.reference_number,
description: params.description,
customer_id: params.customer_id,
currency_id: params.currency_id,
exchange_rate: params.exchange_rate,
project_id: params.project_id,
mileage_type: params.mileage_type,
vat_treatment: params.vat_treatment,
tax_treatment: params.tax_treatment,
product_type: params.product_type,
acquisition_vat_id: params.acquisition_vat_id,
reverse_charge_vat_id: params.reverse_charge_vat_id,
start_reading: params.start_reading,
end_reading: params.end_reading,
distance: params.distance,
mileage_unit: params.mileage_unit,
mileage_rate: params.mileage_rate,
employee_id: params.employee_id,
vehicle_type: params.vehicle_type,
can_reclaim_vat_on_mileage: params.can_reclaim_vat_on_mileage,
fuel_type: params.fuel_type,
engine_capacity_range: params.engine_capacity_range,
paid_through_account_id: params.paid_through_account_id,
vendor_id: params.vendor_id,
custom_fields: params.custom_fields
},
params: {
receipt: params.receipt
}
});