Update Invoices
/unified/accounting/invoices/{id}
Path Parameters
The ID of the resource.
23423523Query Parameters
Refer Specifying query parameters in Truto APIs
The type of the invoice
billinvoice
1 supported1 required
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
The unique identifier for invoices
14 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
The remaining balance of the invoice
9 supported
Bank account shown on the invoice. Invoices only, and REQUIRED on update.
1 supported
Bills only. Defaults to BILL.
BILLPAYROLLREIMBURSEMENT
1 supported
BILLPAYROLLREIMBURSEMENTThe company the invoice belongs to
4 supported
Intacct customer; sent as customer.id.
10 supported1 required
Wave customer id.
The name of the contact
The type of the contact - vendor or customer.
Zoho currency_id, not the code
10 supported1 required
DualEntry custom field values.
1 supported
How total_discount is read. Invoices only.
PERCENTAGEFIXED
1 supported
PERCENTAGEFIXEDIntacct dueDate.
9 supported
The unique identifier for the specific version of the resource.
1 supported1 required
FreeAgent exchange_rate.
7 supported
General-ledger impact date. Bills only.
1 supported
Intacct invoiceDate.
9 supported1 required
Zoho line_items; omit to leave existing lines untouched on update
8 supported1 required
Rillet account code. Required on every bill line.
The currency of the line item
Department id for the line.
The description of the line item
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
Wave product id. Required on every line.
The name of the line item
Invoices only.
Tag ids for the line.
The tax amount for the line item
The ID of the tax rate
Bills only. Sent as the line amount.
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
Invoices only. Sent as amount_per_unit.
Location id. Invoices only.
1 supported
Intacct description.
6 supported
Intacct invoiceNumber and referenceNumber.
9 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
Customer PO reference. Invoices only.
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.
draftsubmitteddeletedauthorisedpaidvoideddraftpostedarchivedactivedeleted
8 supported
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
The total tax amount of the invoice
8 supported
Routes to Zoho invoices or bills.
billinvoiceinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebill+ 10 more
15 supported11 required
invoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillinvoicebillbexio user id to own the invoice.
1 supported
Response Body
The unique identifier for invoices
14 supported
The remaining balance of the invoice
9 supported
The company the invoice belongs to
4 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
8 supported
The currency of the invoice
9 supported
The due date of the invoice
9 supported
The exchange rate of the invoice
7 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
6 supported
The number of the invoice
9 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
9 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
9 supported
This represents the date when the invoice was updated
9 supported
The invoice URLs
1 supported
Type of invoice URL
The invoice URL
truto unified accounting invoices '<resource_id>' \
-m update \
-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",
"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",
"line_items": [],
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"etag": "your_etag",
"id": "your_id",
"total_tax_amount": 0,
"balance": 0,
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"remote_data": {}
}' \
-o jsonimport Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
const result = await truto.unifiedApi.update(
'accounting',
'invoices',
'<resource_id>',
{
"type": "bill",
"memo": "your_memo",
"contact": {},
"issue_date": "your_issue_date",
"due_date": "your_due_date",
"user_id": 0,
"tax_treatment": "inclusive",
"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",
"line_items": [],
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"etag": "your_etag",
"id": "your_id",
"total_tax_amount": 0,
"balance": 0,
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"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.update(
"accounting",
"invoices",
"<resource_id>",
{
"type": "bill",
"memo": "your_memo",
"contact": {},
"issue_date": "your_issue_date",
"due_date": "your_due_date",
"user_id": 0,
"tax_treatment": "inclusive",
"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",
"line_items": [],
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"etag": "your_etag",
"id": "your_id",
"total_tax_amount": 0,
"balance": 0,
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"remote_data": {}
},
{"integrated_account_id": "<integrated_account_id>"}
)
print(result)
asyncio.run(main())curl -X PATCH 'https://api.truto.one/unified/accounting/invoices/{id}?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",
"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",
"line_items": [],
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"etag": "your_etag",
"id": "your_id",
"total_tax_amount": 0,
"balance": 0,
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"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",
"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",
"line_items": [],
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"etag": "your_etag",
"id": "your_id",
"total_tax_amount": 0,
"balance": 0,
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"remote_data": {}
};
const response = await fetch(`https://api.truto.one/unified/accounting/invoices/{id}?integrated_account_id=${integratedAccountId}`, {
method: 'PATCH',
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/{id}"
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",
"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",
"line_items": [],
"status": "draft",
"discount_type": "PERCENTAGE",
"term_id": 0,
"ar_account_id": 0,
"ap_account_id": 0,
"location_id": 0,
"custom_fields": [],
"etag": "your_etag",
"id": "your_id",
"total_tax_amount": 0,
"balance": 0,
"subsidiary_id": "your_subsidiary_id",
"impact_date": "your_impact_date",
"bank_account_id": "your_bank_account_id",
"remote_data": {}
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())