Purchase Orders

This API adds PO's to the system.

  • it's not possible to edit or delete existing line items
  • does not retrieve attached JonasDocuments
  • fields are optional unless specified; optional field nodes can be omitted from the JSON.

WebMethod

  • GJM10J – required

Option

  • scan – error scan only
  • update – Add Purchase Orders
  • download – Get Purchase Orders (data only, does not get attachments)
  • Template – Get upload template

CompanyCode

  • required

APSubledgerCode

  • required

errorsFound

  • returned result

PurchaseOrders

FieldDescription
PurchaseOrderNumberautomatically assigned if blank
SupplierCoderequired
AllocationTypeN | J | W | E | M (defaults from PO profile)
• N – N/A (misc)
• J – Job
• W – W/O
• E – Equip
• M – Multi
AllocationAccountrequired according to the AllocationType
• automatically set to M for AllocationType=M
SubContractNumberapplicable for Job only (optional)
PurchaseOrderDatedefaults to current system date
DateRequireddefaults to current system date
WarehouseCodedefaults from PO profile
POStatusCodedefaults from PO profile
PurchaseOrderTypeS | M (defaults from PO profile)
• S – Single Release (Regular P.O.)
• M – Multiple Rel/Blanket (Blanket P.O. - Qty`s are released & charged)
ShipToAddressLine1
ShipToAddressLine2
ShipToAddressLine3
ShipToPostalZipCode
ContactNamedefaults from Supplier
• if filled in must match Main Contact or be on the Extra Contacts list
Reference
OrderedBydefaults to current User
Termsdefaults to Payment Terms from the SupplierCode
ProvinceStateCodedefaults to the Prov/State from the CompanyCode
SalesTaxExemptTax1 / PST / StateTax
• defaults based on A/P Subledger Profile setting
N – No (not applied)
Y – Yes (applied)
I – Included
FederalTaxApplicableTax2 / GST / FederalTax
N – No (not applied) – default for Canadian CompanyCode
Y – Yes (applied) – default for US CompanyCode
FreightAmount
PrintPurchaseOrderY – output PO to pdf and archive to JonasDocuments (default)
N – no pdf, and no archive
TotalValuePOread-only
BilledToDateread-only
OriginIdreference field for 3rd party integrations (internal use)
Spare1
Spare2
Spare3
Spare4
Spare5
Spare6
Spare7
Spare8
Spare9
Spare10
pdfDocumentPrintPurchaseOrder=Y (read-only)
• base64 encoded pdf

attachments

attach documents to the PO—to be saved in JonasDocuments (Digio)

FieldDescription
namefilename
contentbase64 encoded file

LineItems

FieldDescription
TypeL|I|C
• L – Non Inventory Line (default)
• I – Inventory Item
• C – Comment Line
ItemNumberautomatically assigned (read-only)
Quantity
PartNumberType=I – required
DescriptionType=L | I | C
• I – defaults to Inventory description
UnitPriceType=L | I
• I – defaults to Inventory price
UnitOfMeasureType=L | I
Tax1Type=L | I (Tax1 / PST / StateTax)
• defaults to SalesTaxExempt value in the header
N – No (not applied)
Y – Yes (applied)
I – Included
Tax2Type=L | I (Tax2 / GST / FederalTax)
• defaults to FederalTaxApplicable value in the header
N – No (not applied)
Y – Yes (applied)
ExtendedAmountread-only; Type=L | I
AllocationType(header)AllocationType = J | W | E
• automatically assigned from header (read-only)

(header)AllocationType = M – G | J | W | E (required)
• G – G/L
• J – Job
• W – W/O
• E – E/Q
Allocation1AllocationType = G | J | W | E (required)
• G – GLAccount
• J – JobNumber
• W – WorkOrderNumber
• E – EquipmentNumber
Allocation2AllocationType = G | J (required)
• G – GLDepartmentCode
• J – CostItem
Allocation3AllocationType = G | J | W | E (required)
• G – SubAccount (if applicable)
• J | W | E – CostType
POStatusCode
Discount• only applicable according to the PO Profile (optional)
DateRequired• only applicable according to the PO Profile (optional)
Reference
WarehouseCodeType=I

template

{
        "WebMethod": "GJM10J",
        "Option": "scan",
        "CompanyCode": "",
        "APSubledgerCode": "",
        "PurchaseOrders": [{
                "PurchaseOrderNumber": "",
                "SupplierCode": "",
                "AllocationAccount": "",
                "SubContractNumber": "",
                "PurchaseOrderDate": "1900-01-01T00:00:00Z",
                "DateRequired": "1900-01-01T00:00:00Z",
                "ShipToAddressLine1": "",
                "ShipToAddressLine2": "",
                "ShipToAddressLine3": "",
                "ShipToPostalZipCode": "",
                "Terms": "",
                "OrderedBy": "",
                "SalesTaxExempt": "N",
                "FederalTaxApplicable": "N",
                "PrintPurchaseOrder": "Y",
                "PurchaseOrderType": "S",
                "AllocationType": "J",
                "Reference": "",
                "ProvinceStateCode": "",
                "FreightAmount": 0,
                "ContactName": "",
                "OriginId": "",
                "Spare1": "",
                "Spare2": "",
                "Spare3": "",
                "Spare4": "",
                "Spare5": "",
                "Spare6": "",
                "Spare7": "",
                "Spare8": "",
                "Spare9": "",
                "Spare10": "",
                "attachments":[{
                        "name":"readme.txt",
                        "content":"RklMRSBBVFRBQ0hNRU5UICMx"
                }],
                "LineItems": [{
                        "Type": "L",
                        "Quantity": 0,
                        "PartNumber": "",
                        "Description": "",
                        "UnitPrice": 0,
                        "UnitOfMeasure": "",
                        "Tax1": "N",
                        "Tax2": "N",
                        "AllocationType": "J",
                        "Allocation1": "",
                        "Allocation2": "",
                        "Allocation3": "",
                        "POStatusCode": "",
                        "Discount": "",
                        "DateRequired": "1900-01-01T00:00:00Z",
                        "Reference": "",
                        "WarehouseCode": ""
                }]
        }]
}

example

{
           "WebMethod": "GJM10J",
           "Option": "scan",
           "CompanyCode": "01",
           "APSubledgerCode": "AP",
           "PurchaseOrders": [{
                   "PurchaseOrderNumber": "000001",
                   "SupplierCode": "ABC",
                   "AllocationType": "W",
                   "AllocationAccount": "MYWO",
                   "PrintPurchaseOrder": "Y",
                   "PurchaseOrderType": "S",
                   "attachments":[{
                           "name":"readme.txt",
                           "content":"RklMRSBBVFRBQ0hNRU5UICMx"
                   }],
                   "LineItems": [{
                           "Type": "L",
                           "Quantity": 10,
                           "PartNumber": "123456",
                           "AllocationType": "W",
                           "Allocation1": "MYWO",
                           "Allocation3": "MAT"
                   }]
           }]
}

result with error

{
        "WebMethod": "GJM10J",
        "Option": "scan",
        "CompanyCode": "01",
        "APSubledgerCode": "AP",
        "errorsFound": 1,
        "errors": ["Allocation3"]
}

successful result

{
        "WebMethod": "GJM10J",
        "Option": "update",
        "CompanyCode": "01",
        "APSubledgerCode": "AP",
        "PurchaseOrders": [{
                "PurchaseOrderNumber": "000001",
                "pdfDocument":"JVBERi0xLjQNCjEgMCBvYmoNC...(base64 encoded pdf)"
        }],
        "errorsFound":0
}

Add new PO

{
         "WebMethod": "GJM10J",
         "Option": "update",
         "CompanyCode": "01",
         "APSubledgerCode": "AP",
         "PurchaseOrders": [{
                 "SupplierCode": "ABC",
                 "AllocationType": "M",
                 "PrintPurchaseOrder": "Y",
                 "PurchaseOrderType": "S",
                 "LineItems": [{
                         "Type": "L",
                         "Quantity": 10,
                         "PartNumber": "123456",
                         "AllocationType": "W",
                         "Allocation1": "MYWO",
                         "Allocation3": "MAT"
                 },
                 {
                         "Type": "L",
                         "Quantity": 5,
                         "PartNumber": "7890",
                         "AllocationType": "J",
                         "Allocation1": "MYJOB",
                         "Allocation2": "03000",
                         "Allocation3": "MAT"
                 }]
         }]
}

successful result with assigned PO# and Item#'s

{
         "WebMethod": "GJM10J",
         "Option": "update",
         "CompanyCode": "01",
         "APSubledgerCode": "AP",
         "PurchaseOrders": [{
                 "PurchaseOrderNumber": "000001",
                 "pdfDocument":"JVBERi0xLjQNCjEgMCBvYmoNC...(base64 encoded pdf)",
                 "LineItems": [{
                         "Type": "L",
                         "ItemNumber": "0001",
                         "Quantity": 10,
                         "PartNumber": "123456",
                         "AllocationType": "W",
                         "Allocation1": "MYWO",
                         "Allocation3": "MAT"
                 },
                 {
                         "Type": "L",
                         "ItemNumber": "0002",
                         "Quantity": 5,
                         "PartNumber": "7890",
                         "AllocationType": "J",
                         "Allocation1": "MYJOB",
                         "Allocation2": "03000",
                         "Allocation3": "MAT"
                 }]

         }],
         "errorsFound":0
}

Add additional PO Line Item(s)

{
         "WebMethod": "GJM10J",
         "Option": "update",
         "CompanyCode": "01",
         "APSubledgerCode": "AP",
         "PurchaseOrders": [{
                 "PurchaseOrderNumber": "000001",
                 "PrintPurchaseOrder": "N",
                 "LineItems": [{
                         "Type": "L",
                         "Quantity": 15,
                         "PartNumber": "76543",
                         "AllocationType": "W",
                         "Allocation1": "000001",
                         "Allocation3": "MAT"
                 }]
         }]
}

successful result with assigned Item#

{
        "WebMethod": "GJM10J",
        "Option": "update",
        "CompanyCode": "01",
        "APSubledgerCode": "AP",
        "PurchaseOrders": [{
                "PurchaseOrderNumber": "000001",
                "LineItems": [{
                        "Type": "L",
                        "ItemNumber": "0003",
                        "Quantity": 15,
                        "PartNumber": "76543",
                        "AllocationType": "W",
                        "Allocation1": "000001",
                        "Allocation3": "MAT"
                }]
        }],
        "errorsFound":0
}
  • The examples are simplified to show the relevant data where the actual result would include some of the read-only fields.
  • Please note that the result only returns the added line items with their assigned ItemNumber and doesn't return other existing line items.