Skip to content

SaveBill

Enters a bill that your company received, as Add Bill does on the Bills page: for example a bill read by your own system from a supplier’s email. The new bill is Received, with no accounts allocated yet. Your finance team then allocates its accounts and validates it in TrakIT (see Allocate accounts). To read it back, use GetBill; to attach the scanned bill, use UploadDoc with Ref set to bill; to fill in its data fields, use SaveDataField.

SaveBill is called by your company’s own system, signed in as a TrakIT user with API access. To let a supplier send its own bills to you from its system, use the vendor bill API instead.

How to sign in and read the response: Authentication, Responses.

POST /api/v1/SaveBill
Token: your-token
Content-Type: application/json
{
"BillID": 0,
"OfficeID": 3,
"EntID": 2214,
"BillNumber": "INV-2026-0042",
"BillDate": "2026-10-20",
"Received": "2026-10-21",
"DueDate": "2026-11-19",
"CurrCode": "USD",
"BillActual": 1150.00,
"TaxAmount": 150.00,
"ProfitCenter": "TRUCKING",
"Remarks": "Trucking for October"
}
Field Required Meaning
BillID No 0 or left out to create a bill. The ID of an existing bill to set its profit centre: see Change a bill.
OfficeID Yes The ID of the company that received the bill.
EntID Yes The ID of the entity that sent the bill, for example a transporter. See GetEntity.
EntType No The ID of the entity type the bill is from, as Entity Type on the bill. Left out, it is the entity’s own type.
BillNumber Yes The number printed on the bill, up to 30 characters. TrakIT stores it in capitals, without spaces.
BillDate Yes The date printed on the bill, as yyyy-MM-dd.
Received Yes The date you received the bill, as yyyy-MM-dd.
DueDate No The date payment is due, as yyyy-MM-dd.
CurrCode Yes The bill’s currency, for example USD.
BillActual Yes The billed amount, tax included: Total Amount (incl Tax). It cannot be 0, but it can be negative.
TaxAmount No The tax on the bill: Total Tax Amount.
TaxDeduct No The tax deduction: tax withheld from the supplier’s payment, 0 or more.
ProfitCenter No The Code of one of the company’s profit centres. Spaces and capitals do not matter. null or "" for none. Left out, a new bill takes the entity’s Default Profit Center if it is one of the bill company’s.
Submitted No true to create the bill as Submitted, so that it must be accepted before it is processed. The default, false, creates it as Received.
Remarks No Internal remarks.
ExtRemarks No External remarks, which the supplier sees in the portal.

Field names are not case-sensitive, except ProfitCenter, which must be written exactly so. Send dates as yyyy-MM-dd (see Dates) and amounts as JSON numbers.

Rule Info when it fails
The request has a Token header. Token missing in header
The body is JSON. Incorrect Json syntax or bill missing
Every field has the right type, for example dates TrakIT can read. The reason, with Code -1
The token is valid. Token invalid or expired, or another answer listed in Login token
The user is a system administrator with API access. API User must be SysAdmin with API Access
With a BillID, a bill has that ID. Not found
ProfitCenter, if given, is the code of a profit centre of the bill’s company. Profit Center '...' not found for this company
OfficeID is given. Company is required
EntID is given. Entity is required
BillDate is not after today. Bill Date cannot be in the future
BillDate is given and at most 5 years old. Bill Date cannot be older than 5 years
The bill is not validated. Bill is already validated
CurrCode is given. Bill Currency is required
DueDate, if given, is not before the bill date. Bill Due Date must be same or later than Bill Date
Received is given and is not before the bill date. Bill Received cannot be earlier than Bill Date
BillActual is given and is not 0. Billed Amount is required
BillActual has at most 13 digits before the decimal point. Billed Amount is too large.
TaxAmount is at most a quarter of BillActual. Tax Amount cannot exceed 25% of Billed Amount
TaxAmount has the same sign as BillActual. Tax Amount and Billed Amount must have the same sign
Remarks and ExtRemarks hold no HTML: no < followed by a letter, and they do not start with =, + or @. Internal Remarks has possible html tags or disallowed text, External Remarks has possible html tags or disallowed text
BillNumber is given. Bill Number is required
BillNumber holds no HTML, by the same rule as the remarks. Bill Number contains invalid characters
BillNumber has at most 30 characters, without its spaces. Bill Number cannot exceed 30 characters
Your company’s own checks for saving bills, if it has any (see Validations and actions). The message of the check
The entity has no other bill with this number. Bill Number specified already exists for this entity and office
The company, entity, entity type and currency exist in TrakIT. Unable to create Bill: ..., with Code -1

When a bill is created, Code is 1 and Identity is the new bill’s ID. RetInfo is null: read the bill with GetBill.

{
"Code": 1,
"Info": "",
"RetInfo": null,
"RowsAffected": 0,
"Scalar": null,
"Identity": 109827
}

When an existing bill is saved, Code is 1 and Identity is 0.

To change the profit centre of a bill that is not validated, send its BillID with ProfitCenter. SaveBill sets the bill’s profit centre and keeps the bill’s other details as they are; it still checks them by the rules above. Change the bill’s other details on the bill page in TrakIT: see Modify the bill.

{
"BillID": 109827,
"ProfitCenter": "TRUCKING"
}
  • Saving a bill does what saving it on the page does: it is recorded in the bill’s action log, your company’s own actions for bills run, the bill’s exchange rate is set again from your company’s exchange rates, and computed data fields are worked out again.
  • A new bill sends the bills’ Created notification to the users who subscribed to it (see Notifications).
  • A bill number can be used only once per entity. If a request times out and you do not know whether the bill was created, look for it with GetBillList (DateType Added) before you send it again.