Job Invoices
This API records Upload A/R Job Invoices in the system.
WebMethod
GJRU22J– required
Option
- scan – error scan only
- update – Upload equipment usage
- Template – Get upload template
CompanyCode
- Required
ARSubledgerCode
- required
DateOfRecord
- defaults to system date
errorsFound
- read-only
recordsProcessed
- read-only
pdfReport
- Boolean (default = false)
pdfReportOut
- base64 encoded pdf (read-only)
Invoices
| Field | Description |
|---|---|
InvoiceNumber | Required and should be unique to customer (ARD) |
RecordType | Header record indicator; fixed value "H" (not defined in the source reference — confirm with development) |
InvoiceDate | defaults to system date |
JobNumber | required |
CustomerCode | required |
Tax1Extra | State/Provincial Tax Y | N (Default=N) |
Reference1 | Job Reference (optional) |
Reference2 | Customer Reference (optional) |
SalesCategoryCode | required |
TerrSalesRepCode | Required if not there will be created |
LineItems
| Field | Description |
|---|---|
LineType | I | C (required) • I – Invoice Line • C – Comment Line |
Description | • I – 27 chars • C – 73 chars |
Qty | number (99999.99) |
UnitPrice | number |
Tax2 | Federal Tax Y | N (Default=N) |
Distribution
| Field | Description |
|---|---|
AllocationType | (detail)AllocationType = J | G (required)• J – Job • G – G/L |
Allocation1 | AllocationType = J | G (required)• J – JobNumber • G – GLAccount |
Allocation2 | AllocationType = J | G (required)• J – CostItem • G – GLDepartmentCode |
Allocation3 | AllocationType = J | G (required)• J – CostType • G – SubAccount (if applicable) |
Reference | 40 chars |
Units | units/hours must be numeric |
Amount | Must be numeric |
template
{
"WebMethod": "GJRU22J",
"Option": "Template",
"CompanyCode": "",
"ARSubledgerCode": "",
"DateOfRecord": "1970-01-01T00:00:00Z",
"pdfReport": false,
"Invoices": [{
"InvoiceNumber": "",
"RecordType": "H",
"InvoiceDate": "1970-01-01T00:00:00Z",
"JobNumber": "",
"CustomerCode": "",
"Tax1Extra": "N",
"Reference1": "",
"Reference2": "",
"SalesCategoryCode": "",
"TerrSalesRepCode": "",
"LineItems": [{
"LineType": "I",
"Description": "",
"Qty": 0.0,
"UnitPrice": 0.0,
"Tax2": "N"
}],
"Distribution": [{
"AllocationType": "J",
"Allocation1": "",
"Allocation2": "",
"Allocation3": "",
"Reference": "",
"Units": 0.0,
"Amount": 0.0
}]
}]
}example
JSON with error
{
"WebMethod": "GJRU22J",
"Option": "Scan",
"pdfReport": false,
"CompanyCode": "AS",
"ARSubledgerCode": "A/R",
"DateOfRecord": "2021-08-30T00:00:00Z",
"Invoices": [{
"InvoiceNumber": "121212",
"InvoiceDate": "2021-08-31T00:00:00Z",
"JobNumber": "000102",
"CustomerCode": "ABCOSU",
"Tax1Extra": "N",
"Reference1": "",
"Reference2": "",
"SalesCategoryCode": "MISC",
"TerrSalesRepCode": "HSE",
"LineItems": [{
"LineType": "I",
"Description": "Test API Invoice",
"Qty": 20,
"UnitPrice": 4.5,
"Tax2": "Y"
},
{
"LineType": "C",
"Description": "Test API Comment"
}],
"Distribution": [{
"AllocationType": "J",
"Allocation1": "000002",
"Allocation2": "001000",
"Allocation3": "MAT",
"Reference": "Test Description",
"Units": 20,
"Amount": 190
}]
}]
}successful result
{
"errorsFound": 0,
"pdfReport": false,
"WebMethod": "GJRU22J",
"Option": "scan",
"CompanyCode": "AS",
"ARSubledgerCode": "A/R",
"DateOfRecord": "2021-08-30T00:00:00Z",
"recordsProcessed": 1
}result with errors
{
"errorsFound": 3,
"pdfReport": true,
"WebMethod": "GJRU22J",
"Option": "scan",
"CompanyCode": "AS",
"ARSubledgerCode": "A/R",
"DateOfRecord": "2021-08-30T00:00:00Z",
"errors": ["Customer Code ABCOSU is not on file",
"Job Number is missing 00002",
"231891 totals do not agree, Inv=90 Dis=190"],
"recordsProcessed": 1
}