Create Invoices
/unified/accounting/invoices
Query Parameters
Refer Specifying query parameters in Truto APIs
Show Truto-specific parameters
The ID of the integrated account to use for the request.
62f44730-dd91-461e-bd6a-aedd9e0ad79dThe format of the response.
unifiedreturns the response with unified mappings applied.rawreturns the unprocessed, raw response from the remote API.normalizedapplies the unified mappings and returns the data in a normalized format.streamreturns the response as a stream, which is ideal for transmitting large datasets, files, or binary data. Using streaming mode helps to efficiently handle large payloads or real-time data flows without requiring the entire data to be buffered in memory.debugreturns the final unified result alongside raw remote fetch information. The response is an envelope containingresult(identical to unified mode output) anddebug(withrequestUrl,requestOptions,data,responseHeaders, and for list operations:nextCursor,isLooping,isEmptyResult,resultCount). When the upstream body exceeds 1 MiB,datais replaced by{ truto_truncated: true, truto_max_bytes, truto_excerpt }.debugisnullfor static responses or whentruto_skip_api_call=true. An integrated account token that cannot read credentials (the kind the connect flow gives a browser) gets a403fordebug.
Defaults to unified.
unifiedunifiedrawnormalizedstreamdebug
Excludes the remote_data attribute from the response.
Validates the request body against this method's request_body_schema before the request is sent to the underlying integration. When a field marked required is missing, Truto responds 400 with the missing field names under truto_error_insight.missing_required_body_fields instead of forwarding the call. Only the fields documented in request_body_schema are checked. A body carrying a non-empty remote_data object is forwarded unchecked, because remote_data is merged into the provider request and may already carry the required values. A field the mapping always supplies through its default body is treated as present, and a field that is only conditionally required is reported under truto_error_insight.conditionally_required_body_fields rather than rejected. Some integrations declare fields required on update that the provider only requires on create; check meta/{method} for the resource before enabling this on update calls. If you sent an Idempotency-Key and the request was rejected, use a fresh key when you retry with a corrected body: the idempotency cache is keyed on the integrated account, path and key only — it ignores the query string and the body — so reusing the key replays the rejection. Defaults to false, which forwards the request as-is.
Array of fields to exclude from the response.
truto_exclude_fields[]=id&truto_exclude_fields[]=nameQuery parameters to pass to the underlying API without any transformations. Refer this guide to see how to structure the query parameters.
remote_query[foo]=barRequest Body
Refer Writing data using Unified APIs
1 supported
ERPNext credit_to on a bill, debit_to on an invoice — the payable or receivable control account. ERPNext falls back to the company default when it is omitted.
1 supported
Payable account id. Bills only.
1 supported
Payable account. Bills only.
1 supported
Receivable account id. Invoices only.
1 supported
Receivable account. Invoices only.
1 supported
Bank account shown on the invoice. Invoices only, and REQUIRED on update.
1 supported
Bills only. Defaults to BILL.
BILLPAYROLLREIMBURSEMENT
1 supported
BILLPAYROLLREIMBURSEMENTSAP company code.
6 supported3 required
Rillet customer id on an invoice, vendor id on a bill. Required on both.
15 supported12 required
Wave customer id.
The name of the contact
The type of the contact - vendor or customer.
Zoho currency_id, not the code
11 supported2 required
DualEntry custom field values.
1 supported
How total_discount is read. Invoices only.
PERCENTAGEFIXED
1 supported
PERCENTAGEFIXEDRequired on a bill. On an invoice, defaults to the issue date.
9 supported
FreeAgent exchange_rate.
6 supported
General-ledger impact date. Bills only.
1 supported
Invoice date (YYYY-MM-DD); also the posting and baseline date unless posting_date is given.
12 supported4 required
Zoho line_items; omit to leave existing lines untouched on update
9 supported4 required
G/L account (G/L item).
Wave product id. Required on every line.
PO-reference items: quantity in the PO unit.
Net item amount.
Invoices only. Sent as amount_per_unit.
The currency of the line item
Department id for the line.
Odoo line name.
The discount amount for the line item
The discount rate for the line item
The exchange rate of the currency for the line item
The unique identifier for line item
The name of the line item
Purchase order number (PO-reference item).
PO item, e.g. 10.
Tag ids for the line.
The tax amount for the line item
SAP tax jurisdiction code; required by company codes with jurisdiction-based tax (e.g. US company 1710: 7700000000).
Wave sales tax id.
Bills only. Sent as the line amount.
Tracking categories of the line item
3 properties
Cost center.
The name of the tracking category
The option of the tracking category
The type of the line item
PO-reference items: PO quantity unit.
Location id. Invoices only.
1 supported
Header text.
7 supported
Required by Zoho for bills; auto-generated for invoices
11 supported
FreeAgent payment_terms_in_days, which it REQUIRES on create. Omitted, the mapping derives it from due_date minus issue_date, and falls back to 30 when neither is given.
1 supported
Optional posting date (YYYY-MM-DD).
1 supported
Customer PO reference. Invoices only.
1 supported
Buying price list
1 supported
Your own reference for the document.
1 supported
Any additional data that should be passed as part of the request body. This data is not transformed by Truto and is passed as is to the remote API.
DRAFT or SAVED. Defaults to DRAFT.
draftsubmitteddeletedauthorisedpaidvoideddraftpostedarchiveddraft
8 supported
Net invoice amount (sum of the line amounts).
9 supported1 required
Rillet subsidiary. Defaults to the organization's primary entity.
1 supported
inclusive = line prices already contain tax (mwst_type 0, mwst_is_net false); exclusive = tax added on top (mwst_type 0, mwst_is_net true), THE DEFAULT; exempt = no tax (mwst_type 2). Verified live: mwst_type 1 books ZERO tax, and omitting the field entirely makes bexio default to exempt and silently discard every tax_rate.
inclusiveexclusiveexempt
1 supported
inclusiveexclusiveexemptPayment term id.
1 supported
Document total.
1 supported
Document-level discount, sent as discount_value. Invoices only.
5 supported
Tax amount; SAP gross amount = sub_total + total_tax_amount (omit for tax-free invoices).
8 supported
Routes to Zoho invoices or bills.
billinvoiceinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillbillinvoicebill+ 11 more
16 supported13 required
invoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillbillinvoicebillbexio user id to own the invoice.
1 supported
Response Body
The unique identifier for invoices
17 supported
The remaining balance of the invoice
9 supported
The company the invoice belongs to
5 supported
The contact for whom the invoice is raised.
9 supported
The unique identifier for the contact
The name of the contact
The type of the contact - vendor or customer.
This represents the date when the invoice was created
9 supported
The currency of the invoice
10 supported
The due date of the invoice
9 supported
The exchange rate of the invoice
6 supported
The issue date of the invoice
8 supported
The line items of the invoice
7 supported
The ID of the account
The currency of the line item
The description of the line item
The exchange rate of the currency for the line item
The unique identifier for line item
The ID of the item
The name of the line item
The quantity of the line item
The ID of the tax rate
The total line amount of the line item.
Tracking categories of the line item
3 properties
The ID of the tracking category
The name of the tracking category
The option of the tracking category
The type of the line item
The unit price of the line item
The private note of the invoice
7 supported
The number of the invoice
11 supported
The paid on date of the invoice
2 supported
List of payment IDs associated with the invoice
3 supported
Raw data returned from the remote API call.
The status of the invoice
draftsubmitteddeletedauthorisedpaidvoided
8 supported
The sub total of the invoice
8 supported
The total discount of the invoice
5 supported
The total tax amount of the invoice
8 supported
Tracking categories of the invoices
2 supported
The ID of the tracking category
The name of the tracking category
The option of the tracking category
The type of the invoice
billinvoice
10 supported
This represents the date when the invoice was updated
9 supported
The invoice URLs
2 supported
Type of invoice URL
The invoice URL
truto unified accounting invoices \
-m create \
-a '<integrated_account_id>' \
-b '{
"type": "bill",
"memo": "your_memo",
"contact": {},
"issue_date": "your_issue_date",
"due_date": "your_due_date",
"user_id": 0,
"tax_treatment": "inclusive",
"line_items": [],
"company": "your_company",
"number": "your_number",
"currency": "your_currency",
"exchange_rate": 0,
"total_amount": 0,
"total_discount": 0,
"purchase_order_number": "your_purchase_order_number",
"bill_type": "BILL",
"ar_account": 0,
"ap_account": 0,
"ref_number": "your_ref_number",
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"accounts_payable_account": "your_accounts_payable_account",
"purchase_price_list": "your_purchase_price_list",
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"posting_date": "your_posting_date",
"sub_total": 0,
"total_tax_amount": 0,
"remote_data": {}
}' \
-o jsonimport Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
const result = await truto.unifiedApi.create(
'accounting',
'invoices',
{
"type": "bill",
"memo": "your_memo",
"contact": {},
"issue_date": "your_issue_date",
"due_date": "your_due_date",
"user_id": 0,
"tax_treatment": "inclusive",
"line_items": [],
"company": "your_company",
"number": "your_number",
"currency": "your_currency",
"exchange_rate": 0,
"total_amount": 0,
"total_discount": 0,
"purchase_order_number": "your_purchase_order_number",
"bill_type": "BILL",
"ar_account": 0,
"ap_account": 0,
"ref_number": "your_ref_number",
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"accounts_payable_account": "your_accounts_payable_account",
"purchase_price_list": "your_purchase_price_list",
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"posting_date": "your_posting_date",
"sub_total": 0,
"total_tax_amount": 0,
"remote_data": {}
},
{ integrated_account_id: '<integrated_account_id>' }
);
console.log(result);import asyncio
from truto_python_sdk import TrutoApi
truto_api = TrutoApi(token="<your_api_token>")
async def main():
result = await truto_api.unified_api.create(
"accounting",
"invoices",
{
"type": "bill",
"memo": "your_memo",
"contact": {},
"issue_date": "your_issue_date",
"due_date": "your_due_date",
"user_id": 0,
"tax_treatment": "inclusive",
"line_items": [],
"company": "your_company",
"number": "your_number",
"currency": "your_currency",
"exchange_rate": 0,
"total_amount": 0,
"total_discount": 0,
"purchase_order_number": "your_purchase_order_number",
"bill_type": "BILL",
"ar_account": 0,
"ap_account": 0,
"ref_number": "your_ref_number",
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"accounts_payable_account": "your_accounts_payable_account",
"purchase_price_list": "your_purchase_price_list",
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"posting_date": "your_posting_date",
"sub_total": 0,
"total_tax_amount": 0,
"remote_data": {}
},
{"integrated_account_id": "<integrated_account_id>"}
)
print(result)
asyncio.run(main())curl -X POST 'https://api.truto.one/unified/accounting/invoices?integrated_account_id=<integrated_account_id>' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"type": "bill",
"memo": "your_memo",
"contact": {},
"issue_date": "your_issue_date",
"due_date": "your_due_date",
"user_id": 0,
"tax_treatment": "inclusive",
"line_items": [],
"company": "your_company",
"number": "your_number",
"currency": "your_currency",
"exchange_rate": 0,
"total_amount": 0,
"total_discount": 0,
"purchase_order_number": "your_purchase_order_number",
"bill_type": "BILL",
"ar_account": 0,
"ap_account": 0,
"ref_number": "your_ref_number",
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"accounts_payable_account": "your_accounts_payable_account",
"purchase_price_list": "your_purchase_price_list",
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"posting_date": "your_posting_date",
"sub_total": 0,
"total_tax_amount": 0,
"remote_data": {}
}'const integratedAccountId = '<integrated_account_id>';
const body = {
"type": "bill",
"memo": "your_memo",
"contact": {},
"issue_date": "your_issue_date",
"due_date": "your_due_date",
"user_id": 0,
"tax_treatment": "inclusive",
"line_items": [],
"company": "your_company",
"number": "your_number",
"currency": "your_currency",
"exchange_rate": 0,
"total_amount": 0,
"total_discount": 0,
"purchase_order_number": "your_purchase_order_number",
"bill_type": "BILL",
"ar_account": 0,
"ap_account": 0,
"ref_number": "your_ref_number",
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"accounts_payable_account": "your_accounts_payable_account",
"purchase_price_list": "your_purchase_price_list",
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"posting_date": "your_posting_date",
"sub_total": 0,
"total_tax_amount": 0,
"remote_data": {}
};
const response = await fetch(`https://api.truto.one/unified/accounting/invoices?integrated_account_id=${integratedAccountId}`, {
method: 'POST',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/unified/accounting/invoices"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
"integrated_account_id": "<integrated_account_id>"
}
payload = {
"type": "bill",
"memo": "your_memo",
"contact": {},
"issue_date": "your_issue_date",
"due_date": "your_due_date",
"user_id": 0,
"tax_treatment": "inclusive",
"line_items": [],
"company": "your_company",
"number": "your_number",
"currency": "your_currency",
"exchange_rate": 0,
"total_amount": 0,
"total_discount": 0,
"purchase_order_number": "your_purchase_order_number",
"bill_type": "BILL",
"ar_account": 0,
"ap_account": 0,
"ref_number": "your_ref_number",
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"accounts_payable_account": "your_accounts_payable_account",
"purchase_price_list": "your_purchase_price_list",
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"posting_date": "your_posting_date",
"sub_total": 0,
"total_tax_amount": 0,
"remote_data": {}
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())