Parts Invoices
- Parts Invoices can't be edited using this API
- fields are optional unless specified; optional field nodes can be omitted from the JSON.
WebMethod
GJR01J– required
Option
- scan – error scan only
- update – add Parts Invoice(s)
- download – retrieve (unposted) Parts Invoice(s) (no attachments returned)
- remove – cancel/delete (unposted) Parts Invoice(s)
- schema – JSON schema for Parts Invoice update/download
- template – JSON string template (for reference only)
CompanyCode
- required
ARSubledgerCode
- required
preliminary
Option = update
- true (default) – Preliminary Invoice(s) for checking
- false – Actual Invoice(s), Invoice Register & Update
errorsFound
Option=Scan | Update | remove
- returned result
pdfInvoiceRegister
Option=Update, preliminary=false
- returned audit report — base64 encoded pdf
AuditNumber
Option=update, preliminary=false
- returned result
PartsInvoices
| Field | Description |
|---|---|
ReferenceNumber | N/A for new Invoices |
InvoiceDate | preliminary= false; YYYY-MM-DD (default = today) |
CustomerCode | required |
ShipToAddressLine1 | default = SAME |
ShipToAddressLine2 | |
ShipToAddressLine3 | |
PostalZipCode | |
Attention | defaulted from CustomerCode |
ProductMake | |
ProductModel | |
SerialNumber | |
DateOrdered | YYYY-MM-DD (default = today) |
DateShipped | YYYY-MM-DD (default = today) |
ShippedVia | |
CustomerOrderNumber | |
SalesCategoryCode | defaulted from CustomerCode |
Subtotal | read-only |
Tax2Amount | GST/federal tax (read-only) |
SalesTaxAmount | PST/state tax (read-only) |
InvoiceTotal | read-only |
Terms | defaulted from CustomerCode |
PriceLevel | 1-10 (N/A if using PartsMarkupTableCode) |
TerritorySalesRepCode | defaulted from CustomerCode |
PartsMarkupTableCode | N/A if InventoryProfile not set to use WOMarkupTable |
SalesTaxApplicableAmount | read-only |
Warehouse | • defaulted from CustomerCode • N/A if MULTI-Whse is not turned on in SystemParameters>Star Options |
pdfInvoice | read-only; Option=Update — base64 encoded pdf |
LineItems
| Field | Description |
|---|---|
LineNumber | 1-9999 (read-only) |
Type | P|C|O|G • P – Product (default) • C – Comment • O – Other Charges • G – Journal Entry |
QuantityOrdered | Type=P – default = 1 |
QuantityShipped | Type=P – default = QuantityOrdered |
QuantityBackOrdered | Type=P – default = 0 |
GLAccount | Type=O | G – required |
Division | Type=O | G – required |
SubAccount | Type=O | G – required |
Taxable | Type=P | O – boolean (Tax1 / PST / State)• default = false |
Amount | Type=O | G | P (LineTotal)• G – all LineItems must total to 0.00 • P – LineTotal (read-only; QtyShipped x Price) |
PartNumber | Type=P – required |
Cost | Type=P – defaulted from PartNumber |
Price | Type=P – Sell Price; defaulted from PartNumber |
Description | Type=C | O (defaults to GLAccountDescription) |
template
{
"WebMethod": "GJR01J",
"Option": "template",
"CompanyCode": "",
"ARSubledgerCode": "",
"preliminary": true,
"PartsInvoices": [{
"ReferenceNumber": "",
"InvoiceDate": "1900-01-01T00:00:00Z",
"CustomerCode": "",
"ShipToAddressLine1": "",
"ShipToAddressLine2": "",
"ShipToAddressLine3": "",
"PostalZipCode": "",
"Attention": "",
"ProductMake": "",
"ProductModel": "",
"SerialNumber": "",
"DateOrdered": "1900-01-01T00:00:00Z",
"DateShipped": "1900-01-01T00:00:00Z",
"ShippedVia": "",
"CustomerOrderNumber": "",
"SalesCategoryCode": "",
"Terms": "",
"PriceLevel": "",
"TerritorySalesRepCode": "",
"PartsMarkupTableCode": "",
"SalesTaxApplicableAmount": 0.00,
"Warehouse": "",
"LineItems": [{
"Type": "P",
"QuantityOrdered": 0.00,
"QuantityShipped": 0.00,
"QuantityBackOrdered": 0.00,
"PartNumber": "",
"Cost": 0.00,
"Price": 0.00,
"Taxable": false
},
{
"Type": "O",
"GLAccount": "",
"Division": "",
"SubAccount": "",
"Taxable": false,
"Amount": 0.00
},
{
"Type": "G",
"GLAccount": "",
"Division": "",
"SubAccount": "",
"Amount": 0.00
},
{
"Type": "C",
"Description": ""
}]
}]
}examples
Create a preliminary Invoice
preliminarydefaults to true when not specified
{
"WebMethod": "GJR01J",
"Option": "update",
"CompanyCode": "JC",
"ARSubledgerCode": "AR",
"PartsInvoices": [{
"CustomerCode": "101-000",
"LineItems": [{
"Type": "P",
"QuantityOrdered": 100,
"PartNumber": "A12345"
},
{
"Type": "O",
"GLAccount": "10210",
"Division": "0001",
"Amount": 20.00
},
{
"Type": "G",
"GLAccount": "40030",
"Division": "0001",
"Amount": 10.00
},
{
"Type": "G",
"GLAccount": "00300",
"Division": "0001",
"Amount": -10.00
},
{
"Type": "C",
"Description": "My Comments"
}]
}]
}result
{
"WebMethod": "GJR01J",
"Option": "update",
"CompanyCode": "JC",
"ARSubledgerCode": "AR",
"PartsInvoices": [{
"ReferenceNumber": "100498",
"pdfInvoice":"JVBERi0xLjQNCjEgMCBvYmoNCjw8DQ...(base64 encoded pdf)"
}],
"preliminary": true,
"errorsFound":0
}Review prepared Invoice from the previous example
ReferenceNumberis required
{
"WebMethod": "GJR01J",
"Option": "update",
"CompanyCode": "JC",
"ARSubledgerCode": "AR",
"PartsInvoices": [{
"ReferenceNumber": "100498"
}]
}result
{
"WebMethod": "GJR01J",
"Option": "update",
"CompanyCode": "JC",
"ARSubledgerCode": "AR",
"PartsInvoices": [{
"pdfInvoice":"JVBERi0xLjQNCjEgMCBvYmo...(base64 encoded pdf)"
}],
"preliminary": true
}Post the prepared Invoice from the previous example
{
"WebMethod": "GJR01J",
"Option": "update",
"preliminary": false,
"CompanyCode": "JC",
"ARSubledgerCode": "AR",
"PartsInvoices": [{
"ReferenceNumber": "100498"
}]
}result
{
"WebMethod": "GJR01J",
"Option": "update",
"preliminary": false,
"CompanyCode": "JC",
"ARSubledgerCode": "AR",
"PartsInvoices": [{
"ReferenceNumber": "100498",
"pdfInvoice":"JVBERi0xLjQNCjEgMCBvYmo...(base64 encoded pdf)"
}],
"pdfInvoiceRegister":"JVBERi0xLjQNCjEgMCBvYmo...(base64 encoded pdf)",
"AuditNumber":"SJ0012",
"errorsFound":0
}ReferenceNumberis no longer valid after update as the prepared invoice is purged from the batch.
Read Invoice(s)
{"WebMethod":"GJR01J","Option":"download","CompanyCode":"JC","ARSubledgerCode":"AR",
"PartsInvoices":[{"ReferenceNumber":"100498"}]}result
{
"WebMethod": "GJR01J",
"Option": "download",
"CompanyCode": "JC",
"ARSubledgerCode": "AR",
"PartsInvoices": [{
"ReferenceNumber":"100498",
"CustomerCode": "101-000",
"LineItems": [{
"Type": "P",
"QuantityOrdered": 100,
"PartNumber": "A12345"
},
{
"Type": "O",
"GLAccount": "10210",
"Division": "0001",
"Amount": 20.00
},
{
"Type": "G",
"GLAccount": "40030",
"Division": "0001",
"Amount": 10.00
},
{
"Type": "G",
"GLAccount": "00300",
"Division": "0001",
"Amount": -10.00
},
{
"Type": "C",
"Description": "My Comments"
}]
}]
}Cancel preliminary Invoice(s)
{"WebMethod":"GJR01J","Option":"remove","CompanyCode":"JC","ARSubledgerCode":"AR",
"PartsInvoices":[{"ReferenceNumber":"100498"},{"ReferenceNumber":"100499"}]}result
{"WebMethod":"GJR01J","Option":"remove","CompanyCode":"JC",
"ARSubledgerCode":"AR","PartsInvoices":[{"ReferenceNumber":"100498"},
{"ReferenceNumber":"100499"}],"errorsFound":0}Invoice & register in a single step
preliminary=false
{"WebMethod":"GJR01J","Option":"update","preliminary":false,"CompanyCode":"JC",
"ARSubledgerCode":"AR","PartsInvoices":[{"CustomerCode":"101000","LineItems":[
{"Type":"P","QuantityOrdered":100,"PartNumber":"A12345","Price":30.00},{"Type":"O",
"GLAccount":"10210","Division":"0001","Amount":20.00},{"Type":"C","Description":"My Comments"}]}]}result
{
"WebMethod": "GJR01J",
"Option": "update",
"preliminary": false,
"CompanyCode": "JC",
"ARSubledgerCode": "AR",
"PartsInvoices": [{
"pdfInvoice":"JVBERi0xLjQNCjEgMCBvYmo...(base64 encoded pdf)"
}],
"pdfInvoiceRegister":"JVBERi0xLjQNCjEgMCBvYmo...(base64 encoded pdf)",
"AuditNumber":"SJ0012",
"errorsFound":0
}