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

FieldDescription
InvoiceNumberRequired and should be unique to customer (ARD)
RecordTypeHeader record indicator; fixed value "H" (not defined in the source reference — confirm with development)
InvoiceDatedefaults to system date
JobNumberrequired
CustomerCoderequired
Tax1ExtraState/Provincial Tax
Y | N (Default=N)
Reference1Job Reference (optional)
Reference2Customer Reference (optional)
SalesCategoryCoderequired
TerrSalesRepCodeRequired if not there will be created

LineItems

FieldDescription
LineTypeI | C (required)
• I – Invoice Line
• C – Comment Line
Description• I – 27 chars
• C – 73 chars
Qtynumber (99999.99)
UnitPricenumber
Tax2Federal Tax
Y | N (Default=N)

Distribution

FieldDescription
AllocationType(detail)AllocationType = J | G (required)
• J – Job
• G – G/L
Allocation1AllocationType = J | G (required)
• J – JobNumber
• G – GLAccount
Allocation2AllocationType = J | G (required)
• J – CostItem
• G – GLDepartmentCode
Allocation3AllocationType = J | G (required)
• J – CostType
• G – SubAccount (if applicable)
Reference40 chars
Unitsunits/hours must be numeric
AmountMust 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
}