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
| Field | Description |
|---|---|
PurchaseOrderNumber | automatically assigned if blank |
SupplierCode | required |
AllocationType | N | J | W | E | M (defaults from PO profile) • N – N/A (misc) • J – Job • W – W/O • E – Equip • M – Multi |
AllocationAccount | required according to the AllocationType • automatically set to M for AllocationType=M |
SubContractNumber | applicable for Job only (optional) |
PurchaseOrderDate | defaults to current system date |
DateRequired | defaults to current system date |
WarehouseCode | defaults from PO profile |
POStatusCode | defaults from PO profile |
PurchaseOrderType | S | 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 | |
ContactName | defaults from Supplier • if filled in must match Main Contact or be on the Extra Contacts list |
Reference | |
OrderedBy | defaults to current User |
Terms | defaults to Payment Terms from the SupplierCode |
ProvinceStateCode | defaults to the Prov/State from the CompanyCode |
SalesTaxExempt | Tax1 / PST / StateTax • defaults based on A/P Subledger Profile setting N – No (not applied) Y – Yes (applied) I – Included |
FederalTaxApplicable | Tax2 / GST / FederalTax N – No (not applied) – default for Canadian CompanyCode Y – Yes (applied) – default for US CompanyCode |
FreightAmount | |
PrintPurchaseOrder | Y – output PO to pdf and archive to JonasDocuments (default) N – no pdf, and no archive |
TotalValuePO | read-only |
BilledToDate | read-only |
OriginId | reference field for 3rd party integrations (internal use) |
Spare1 | |
Spare2 | |
Spare3 | |
Spare4 | |
Spare5 | |
Spare6 | |
Spare7 | |
Spare8 | |
Spare9 | |
Spare10 | |
pdfDocument | PrintPurchaseOrder=Y (read-only)• base64 encoded pdf |
attachments
attach documents to the PO—to be saved in JonasDocuments (Digio)
| Field | Description |
|---|---|
name | filename |
content | base64 encoded file |
LineItems
| Field | Description |
|---|---|
Type | L|I|C • L – Non Inventory Line (default) • I – Inventory Item • C – Comment Line |
ItemNumber | automatically assigned (read-only) |
Quantity | |
PartNumber | Type=I – required |
Description | Type=L | I | C• I – defaults to Inventory description |
UnitPrice | Type=L | I• I – defaults to Inventory price |
UnitOfMeasure | Type=L | I |
Tax1 | Type=L | I (Tax1 / PST / StateTax)• defaults to SalesTaxExempt value in the headerN – No (not applied) Y – Yes (applied) I – Included |
Tax2 | Type=L | I (Tax2 / GST / FederalTax)• defaults to FederalTaxApplicable value in the headerN – No (not applied) Y – Yes (applied) |
ExtendedAmount | read-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 |
Allocation1 | AllocationType = G | J | W | E (required)• G – GLAccount • J – JobNumber • W – WorkOrderNumber • E – EquipmentNumber |
Allocation2 | AllocationType = G | J (required)• G – GLDepartmentCode • J – CostItem |
Allocation3 | AllocationType = 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 | |
WarehouseCode | Type=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
ItemNumberand doesn't return other existing line items.