AP Invoice Batch

This API creates/appends AP Invoice batches in the system.

  • This upload only adds invoices to a batch, it does not post any transactions
  • It's not possible to edit or delete existing invoices
  • Fieldnames are case-sensitive
  • Fields are optional unless specified otherwise; optional fields to be included if applicable

User security: (one of the following) Accounts Payable > Processing > Setup/Edit A/P Batches System Administration > Jonas Template Uploads > Accounts Payable > Upload A/P Batch

WebMethod

  • GJZJ4J – required

Option

  • scan – error scan only
  • update – create/append an AP Batch
  • Template – Get upload template

CompanyCode

  • required

APSubledgerCode

  • required

errorsFound

  • result (read-only)

AP_BatchInvoiceHeader_tbl

FieldDescription
BatchNumber• add invoices to a specific batch #; batch is created if it doesn't exist
• leave blank to automatically create next batch available
o Batch# will be returned
CreatedDateDateOfRecord
• defaults to current system date
• Required if no BatchNumber is specified
RevisedByLastUserID;
• normally leave blank

AP_APBatchInvoiceRecord_tbl

FieldDescription
SupplierCoderequired
InvoiceNumber10 chars max (required)
SupplierInvoice30 chars max (optional)
InvoiceDate• defaults to CreatedDate from Header
• Must be in the same period as the DateOfRecord (unless overrided in the A/P profile setup)
DateDuedefaults to InvoiceDate

PurchaseOrderNumber

FieldDescription
ReferenceNumber• Reference/Job# field
• Must be a valid Job# if specifying SubContractNumber
SubContractNumber• only applicable if a Job# is filled in ReferenceNumber (optional)
PurchaseAmount
SalesTaxAmount
DiscountEarned
HoldbackAmount
FederalTax
FreightAmount
AmountToPaynormally omit this for the system to calculate
PurchaseCategoryCodedepends on A/P Profile setup
TermsCode
CCSupplierPayment Account (optional)
CCTransactionNumberPayment Account memo
CCInvoiceDueDatePayment Account Due Date
CCInvoicePurchaseCategoryPayment Account Purchase Category; depends on A/P Profile setting
OriginIDinternal use only (leave blank), included here for completeness only
AP_StickyNotesHeader_tbl (optional)
FieldDescription
ActionDateoptional
NotesUp to 3000 chars
InvoiceAttachment (optional) attach scanned invoice to the Invoice—to be saved in JonasDocuments
FieldDescription
namefilename
contentbase64 encoded file (up to 10MB)
AP_GLDistributionRecord_tbl (required)
FieldDescription
DistributionTypeRequired
G/L | J/C | W/O | E/Q
CompanyCode3Required
Distribution/Allocation Company Code
GLJobNumberWOEquipmentRequired
Distribution/Allocation #1 (according to DistributionType)
• G/L – AccountNumber
• J/C – JobNumber
• W/O – WorkOrderNumber
• E/Q – Equipment code
DepartmentDivisionCostItemCompanyRequired
Distribution/Allocation #2 (according to DistributionType)
• G/L – Department/Division
• J/C – CostItem
• W/O – CostType*
• E/Q – CostType*
SubAccountCostTypeRequired*
Distribution/Allocation #3 (according to DistributionType)
• G/L – SubAccount
• J/C – CostType
• W/O – N/A
• E/Q – ComponentCode (*optional; depends on E/Q Profile)
Reference
Description
AmountRequired
Units
TempSpaces– Required for PO Invoices
internal P.O. LineNumber reference (not ItemNumber)

template

{
    "WebMethod":"GJZJ4J",
    "Option":"template",
    "CompanyCode":"",
    "APSubledgerCode":"",
    "AP_BatchInvoiceHeader_tbl":[{
         "BatchNumber":"",
         "CreatedDate":"1970-01-01T00:00:00Z",
         "RevisedByLast":"",
         "AP_APBatchInvoiceRecord_tbl":[{
              "SupplierCode":"",
              "InvoiceNumber":"",
              "SupplierInvoice":"",
              "InvoiceDate":"1970-01-01T00:00:00Z",
              "DateDue":"1970-01-01T00:00:00Z",
              "PurchaseOrderNumber":"",
              "ReferenceNumber":"",
              "SubContractNumber":"",
              "PurchaseAmount":0,
              "SalesTaxAmount":0,
              "DiscountEarned":0,
              "HoldbackAmount":0,
              "FederalTax":0,
              "FreightAmount":0,
              "AmountToPay":0,
              "PurchaseCategoryCode":"",
              "TermsCode":"",
              "CCSupplier":"",
              "CCTransactionNumber":"",
              "CCInvoiceDueDate":"1970-01-01T00:00:00Z",
              "CCInvoicePurchaseCategory":"",
              "OriginID":"",
              "AP_StickyNotesHeader_tbl": {
                    "ActionDate": "1970-01-01T00:00:00Z",
                    "Notes": ""
              },
              "InvoiceAttachment":{
                    "name":"",
                    "content":""
              },
              "AP_GLDistributionRecord_tbl":[{
                    "DistributionType":"G/L",
                    "CompanyCode3":"",
                    "GLJobNumberWOEquipment":"",
                    "DepartmentDivisionCostItemCompany":"",
                    "SubAccountCostType":"",
                    "Reference":"",
                    "Description":"",
                    "Amount":0,
                    "Units":0,
                    "TempSpaces":""
                 }]
           }]
      }]
}

example

{
    "WebMethod":"GJZJ4J",
    "Option":"update",
    "CompanyCode":"ZX",
    "APSubledgerCode":"AP    ",
    "AP_BatchInvoiceHeader_tbl":[
      {
        "BatchNumber":"00019",
        "AP_APBatchInvoiceRecord_tbl":[
          {
            "SupplierCode":"9806",
            "InvoiceNumber":"CON24661B",
            "InvoiceDate":"2017-08-11T00:00:00Z",
            "PurchaseOrderNumber":"096809",
            "DateDue":"2017-09-07T00:00:00Z",
            "PurchaseAmount":75.00,
            "PurchaseCategoryCode":"PURCH",
            "TermsCode":"",
            "InvoiceAttachment":{
               "name":"InvoiceCON24661.pdf",
               "content":"JVBERi0xLjQNCjEgMCBvYmoNCjw8DQov...(base64 encoded file)"
            },
            "AP_GLDistributionRecord_tbl":[
               {
                 "CompanyCode3":"ZX",
                 "GLJobNumberWOEquipment":"3157C",
                 "DepartmentDivisionCostItemCompany":"000110",
                 "SubAccountCostType":"T",
                 "Reference":"Rick",
                 "Description":"9806 9.4.17 Report",
                 "Amount":75.00,
                 "DistributionType":"J/C",
                 "Units":1.00,
                 "TempSpaces":"01"
               }
            ]
          }
        ]
      }
    ]
}