Invoices
- Get Invoice Object Definition
- Query and List Invoices
- Query and List Invoices (Legacy)
- Get Invoice
- Get Invoice as PDF Data
- Create Invoice (Legacy)
- Update Invoice (Legacy)
- Reverse Invoice (Legacy)
- Delete Invoice
- Delete Invoice (Legacy)
An AR invoice object represents an invoice sent to a customer for goods or services provided.
About invoice record numbers
Certain types of transaction definitions in Order Entry (e.g. Sales Invoice, Contract Invoice, Sales Credit Memo) are configured to create corresponding invoices in the Accounts Receivable module. When a transaction is updated in Order Entry, the related AR transaction is deleted and recreated. As a result, the AR transaction will have a new RECORDNO
. Integrations relying on these records should consider using a MODULEKEY
filter outlined below.
Get Invoice Object Definition
lookup
List all the fields and relationships for the invoice object:
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ARINVOICE |
Query and List Invoices
query
List the record number and customer name for each invoice where the customer name starts with the letter
B
:
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ARINVOICE |
filter | Optional | object | Filter expression to limit the response to only objects that match the expression. Check the value of a single field using operators such as equalto/like, or multiple fields using and/or. Query fields on related objects using the dot operator (for example, VENDOR.CREDITLIMIT on APBILL). |
select | Required | sequence | The names of the fields that you want included in the response, and an optional aggregate function such as count or sum . Returning all fields is not supported. |
orderby | Optional | object | Provide an order element with a field name and choose an ascending or descending sort order, for example: <order> |
options | Optional | object | Query options:
|
pagesize | Optional | integer | Maximum number of matching objects to return in the response, between 1 and 2000 items (Default: 100 ) |
offset | Optional | integer | Point at which to start indexing into records (Default: 0 ) |
Query and List Invoices (Legacy)
readByQuery
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ARINVOICE |
fields | Optional | string | Comma-separated list of fields on the object to list. For best performance and predictability, limit the number of fields. To return all fields, omit the element or provide * for the value. |
query | Required | string | SQL-like query based on fields on the object. The following operators are supported: < , > , >= , <= , = , like , not like , in , not in , IS NOT NULL , IS NULL , AND , OR . Illegal XML characters must be properly encoded, and single quotes must be escaped with backslashes ('Jane\'s Deli' ). Joins are not supported. |
pagesize | Optional | integer | Custom page size between 1 and 1000 items (Default: 100 ) |
query
Fields
Name | Required | Type | Description |
---|---|---|---|
MODULEKEY | Optional | string | Source module that the transaction was created from. Use 4.AR for Accounts Receivable or 8.SO for Order Entry |
Get Invoice
read
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ARINVOICE |
keys | Required | string | Comma-separated list of invoice RECORDNO to get |
fields | Optional | string | Comma-separated list of fields on the object to get. To return all fields, omit the element or provide * for the value.For best performance and predictability, limit the number of fields. |
returnFormat | Optional | string | Data format for the response body:
|
Get Invoice as PDF Data
retrievepdf
Provides base64-encoded data for a PDF version of the specified invoice:
Retrieve PDF versions of multiple invoices:
Parameters
Name | Required | Type | Description |
---|---|---|---|
ARINVOICE | Required | object | Object type to retrieve as PDF. Use ARINVOICE . |
ARINVOICE
Name | Required | Type | Description |
---|---|---|---|
RECORDNO | Required | string | Record number of the invoice to retrieve. |
Response
pdfdata
The returned data looks like this:
Create Invoice (Legacy)
Release | Changes |
---|---|
2020 Release 4 | Added taxsolutionid, taxentries |
2020 Release 2 | Added costtypeid |
2019 Release 4 | Added taskid |
Note: Currency (amount) values with more than 2 decimal places will be rounded to 2 decimal places to prevent data issues. Best practice is for your application to round long decimal numbers to 2 decimal places before sending them to Intacct.
create_invoice
Create an invoice:
Create an invoice where the first line uses a single tax detail and allows the system to calculate the
trx_tax
value, and the second line overrides the calculatedtrx_tax
value (AU, GB, ZA only):
Parameters
Name | Required | Type | Description |
---|---|---|---|
customerid | Required | string | Customer ID |
datecreated | Required | object | Transaction date |
dateposted | Optional | object | GL posting date |
datedue | Optional | object | Due date. Required if not using termname . |
termname | Optional | string | Payment term. Required if not using datedue . |
batchkey | Optional | integer | Summary RECORDNO |
action | Optional | string | Action. Use Draft or Submit . (Default: Submit ) |
invoiceno | Optional | string | Invoice number |
ponumber | Optional | string | Reference number |
description | Optional | string | Description |
externalid | Optional | string | External ID |
billto | Optional | object | Bill to contact |
shipto | Optional | object | Ship to contact |
basecurr | Optional | string | Base currency code |
currency | Optional | string | Transaction currency code. Required if exchratetype used. |
exchratedate | Optional | object | Exchange rate date. |
exchratetype | Optional | string | Exchange rate type. If used, then currency is required. Do not use if exchrate is set. (Leave blank to use Intacct Daily Rate .) |
exchrate | Optional | currency | Exchange rate value. Do not use if exchangeratetype is set. |
nogl | Optional | boolean | Do not post to GL. Use false for No, true for Yes. (Default: false ) |
supdocid | Optional | string | Attachments ID |
customfields | Optional | array of customfield |
Custom fields |
taxsolutionid | Optional | string | Tax solution name, such as United Kingdom - VAT or Australia - GST . Required only if the company is configured for multiple tax jurisdictions and the transaction is occurring at the top level of the company. The available tax solution names can be found in the Sage Intacct UI in the Taxes application from the top level of a multi-entity company. (GB, AU, and ZA only) |
invoiceitems | Required | lineitem[1...n] |
Invoice lines, must have at least 1. |
datecreated
dateposted
datedue
Name | Required | Type | Description |
---|---|---|---|
year | Required | string | Year yyyy |
month | Required | string | Month mm |
day | Required | string | Day dd |
billto
shipto
Name | Required | Type | Description |
---|---|---|---|
contactname | Required | string | Ship to contact name |
exchratedate
Name | Required | Type | Description |
---|---|---|---|
year | Required | string | Year yyyy |
month | Required | string | Month mm |
day | Required | string | Day dd |
customfield
Name | Required | Type | Description |
---|---|---|---|
customfieldname | Optional | string | Custom field ID |
customfieldvalue | Optional | varies | Custom field value. For a multi-pick-list custom field, implode multiple field values with #~# . |
lineitem
Name | Required | Type | Description |
---|---|---|---|
glaccountno | Optional | string | GL account number. Required if not using accountlabel . |
accountlabel | Optional | string | AR account label. Required if not using glaccountno . |
offsetglaccountno | Optional | string | Offset GL account number |
amount | Required | currency | Transaction amount |
allocationid | Optional | string | Allocation ID |
memo | Optional | string | Memo |
locationid | Optional | string | LOCATIONID of an active location. Required if company is multi-entity enabled. |
departmentid | Optional | string | Department ID |
key | Optional | string | Key |
totalpaid | Optional | currency | Total paid. Used when nogl on bill is true |
totaldue | Optional | currency | Total due. Used when nogl on bill is true |
customfields | Optional | array of customfield |
Custom fields |
revrectemplate | Optional | string | Rev rec template ID |
defrevaccount | Optional | string | Deferred revenue GL account number |
revrecstartdate | Optional | object | Rev rec start date |
revrecenddate | Optional | object | Rev rec end date |
projectid | Optional | string | Project ID |
taskid | Optional | string | Task ID. Only available when the parent projectid is also specified. |
costtypeid | Optional | string | Cost type ID. Only available when projectid and taskid are specified. (Construction subscription) |
customerid | Optional | string | Customer ID |
vendorid | Optional | string | Vendor ID |
employeeid | Optional | string | Employee ID |
itemid | Optional | string | Item ID |
classid | Optional | string | Class ID |
contractid | Optional | string | Contract ID |
warehouseid | Optional | string | Warehouse ID |
taxentries | Optional | taxentry[1...n] |
Tax entries for the line. Required for VAT enabled transactions. Providing multiple entries is allowed if your tax solution supports it (AU and GB only). For ZA, only one tax entry is allowed. |
revrecstartdate
revrecenddate
Name | Required | Type | Description |
---|---|---|---|
year | Required | string | Year yyyy |
month | Required | string | Month mm |
day | Required | string | Day dd |
taxentry
(AU, GB, ZA only)
Specifies a tax rate (defined in the system) for the invoice line.
Name | Required | Type | Description |
---|---|---|---|
detailid | Required | string | Unique ID of a tax detail with the tax rate to use |
trx_tax | Optional | currency | Transaction tax, which is a manually calculated value to override the calculated value for the tax. The amount of the tax line is automatically included in the amount due (TOTAL_DUE ) for the invoice. |
Update Invoice (Legacy)
Release | Changes |
---|---|
2020 Release 4 | Added taxentries |
2020 Release 2 | Added costtypeid |
2019 Release 4 | Added taskid |
2024 Release 4 | Added that if `exchratetype` used, then `currency` required. |
Note: Currency (amount) values with more than 2 decimal places will be rounded to 2 decimal places to prevent data issues. Best practice is for your application to round long decimal numbers to 2 decimal places before sending them to Intacct.
update_invoice
Parameters
Name | Required | Type | Description |
---|---|---|---|
key | Required | integer | Invoice RECORDNO to update |
customerid | Optional | string | Customer ID |
datecreated | Optional | object | Transaction date |
dateposted | Optional | object | GL posting date |
datedue | Optional | object | Due date. Required if not using termname . |
termname | Optional | string | Payment term. Required if not using datedue . |
action | Optional | string | Action. Use Draft or Submit . (Default: Submit ) |
invoiceno | Optional | string | Invoice number |
ponumber | Optional | string | Reference number |
description | Optional | string | Description |
payto | Optional | object | Bill to contact |
returnto | Optional | object | Ship to contact |
basecurr | Optional | string | Base currency code |
currency | Optional | string | Transaction currency code. Required if exchratetype used. |
exchratedate | Optional | object | Exchange rate date. |
exchratetype | Optional | string | Exchange rate type. If used, then currency is required. Do not use if exchrate is set. (Leave blank to use Intacct Daily Rate .) |
exchrate | Optional | currency | Exchange rate value. Do not use if exchangeratetype is set. |
supdocid | Optional | string | Attachments ID |
customfields | Optional | array of customfield |
Custom fields |
updateinvoiceitems | Required | (updatelineitem | lineitem)[1...n] |
To update an existing line use updatelineitem otherwise to create a new line use lineitem . You can mix types in the array. |
datecreated
dateposted
datedue
Name | Required | Type | Description |
---|---|---|---|
year | Required | string | Year yyyy |
month | Required | string | Month mm |
day | Required | string | Day dd |
payto
returnto
Name | Required | Type | Description |
---|---|---|---|
contactname | Required | string | Ship to contact name |
exchratedate
Name | Required | Type | Description |
---|---|---|---|
year | Required | string | Year yyyy |
month | Required | string | Month mm |
day | Required | string | Day dd |
customfield
Name | Required | Type | Description |
---|---|---|---|
customfieldname | Optional | string | Custom field ID |
customfieldvalue | Optional | varies | Custom field value. For a multi-pick-list custom field, implode multiple field values with #~# . |
updatelineitem
Name | Required | Type | Description |
---|---|---|---|
line_num | Required | integer | Line number to update |
glaccountno | Optional | string | GL account number. Cannot use if using accountlabel . |
accountlabel | Optional | string | AR account label. Cannot use if using glaccountno . |
offsetglaccountno | Optional | string | Offset GL account number |
amount | Optional | currency | Transaction amount |
memo | Optional | string | Memo |
locationid | Optional | string | LOCATIONID of an active location. Required if company is multi-entity enabled. |
departmentid | Optional | string | Department ID |
customfields | Optional | array of customfield |
Custom fields |
revrectemplate | Optional | string | Rev rec template ID |
defrevaccount | Optional | string | Deferred revenue GL account number |
revrecstartdate | Optional | object | Rev rec start date |
revrecenddate | Optional | object | Rev rec end date |
projectid | Optional | string | Project ID |
taskid | Optional | string | Task ID. Only available when the parent projectid is also specified. |
costtypeid | Optional | string | Cost type ID. Only available when projectid and taskid are specified. (Construction subscription) |
customerid | Optional | string | Customer ID |
vendorid | Optional | string | Vendor ID |
employeeid | Optional | string | Employee ID |
itemid | Optional | string | Item ID |
classid | Optional | string | Class ID |
contractid | Optional | string | Contract ID |
warehouseid | Optional | string | Warehouse ID |
taxentries | Optional | taxentry[1...n] |
Tax entries for the line. This a complete replacement of the existing set. Providing multiple entries is allowed if your tax solution supports it (AU and GB only). For ZA, only one tax entry is allowed. |
lineitem
Name | Required | Type | Description |
---|---|---|---|
glaccountno | Optional | string | GL account number. Required if not using accountlabel . |
accountlabel | Optional | string | AR account label. Required if not using glaccountno . |
offsetglaccountno | Optional | string | Offset GL account number |
amount | Required | currency | Transaction amount |
allocationid | Optional | string | Allocation ID |
memo | Optional | string | Memo |
locationid | Optional | string | LOCATIONID of an active location. Required if company is multi-entity enabled. |
departmentid | Optional | string | Department ID |
key | Optional | string | Key |
totalpaid | Optional | currency | Total paid. Used when nogl on bill is true |
totaldue | Optional | currency | Total due. Used when nogl on bill is true |
customfields | Optional | array of customfield |
Custom fields |
revrectemplate | Optional | string | Rev rec template ID |
defrevaccount | Optional | string | Deferred revenue GL account number |
revrecstartdate | Optional | object | Rev rec start date |
revrecenddate | Optional | object | Rev rec end date |
projectid | Optional | string | Project ID |
taskid | Optional | string | Task ID. Only available when the parent projectid is also specified. |
costtypeid | Optional | string | Cost type ID. Only available when projectid and taskid are specified. (Construction subscription) |
customerid | Optional | string | Customer ID |
vendorid | Optional | string | Vendor ID |
employeeid | Optional | string | Employee ID |
itemid | Optional | string | Item ID |
classid | Optional | string | Class ID |
contractid | Optional | string | Contract ID |
warehouseid | Optional | string | Warehouse ID |
taxentries | Optional | taxentry[1...n] |
Tax entries for the line. Providing multiple entries is allowed if your tax solution supports it (AU and GB only). For ZA, only one tax entry is allowed.. |
revrecstartdate
revrecenddate
Name | Required | Type | Description |
---|---|---|---|
year | Required | string | Year yyyy |
month | Required | string | Month mm |
day | Required | string | Day dd |
taxentry
(AU, GB, ZA only)
Specifies a tax rate (defined in the system) for the invoice line.
Name | Required | Type | Description |
---|---|---|---|
detailid | Required | string | Unique ID of a tax detail with the tax rate to use |
trx_tax | Optional | currency | Transaction tax, which is your manually calculated value for the tax. The amount of the tax line is automatically included in the amount due (TOTAL_DUE ) for the invoice. Providing a value here overrides any calculated values. |
Reverse Invoice (Legacy)
reverse_invoice
Parameters
Name | Required | Type | Description |
---|---|---|---|
key | Required | integer | Invoice RECORDNO to reverse |
datereversed | Required | object | Reverse date |
description | Optional | string | Memo |
datereversed
Name | Required | Type | Description |
---|---|---|---|
year | Required | string | Year yyyy |
month | Required | string | Month mm |
day | Required | string | Day dd |
Delete Invoice
delete
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ARINVOICE |
keys | Required | string | Comma-separated list of invoice RECORDNO to delete |
Delete Invoice (Legacy)
delete_invoice
Parameters
Name | Required | Type | Description |
---|---|---|---|
key | Required | string | Invoice RECORDNO to delete |