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

FieldDescription
ReferenceNumberN/A for new Invoices
InvoiceDatepreliminary= false; YYYY-MM-DD (default = today)
CustomerCoderequired
ShipToAddressLine1default = SAME
ShipToAddressLine2
ShipToAddressLine3
PostalZipCode
Attentiondefaulted from CustomerCode
ProductMake
ProductModel
SerialNumber
DateOrderedYYYY-MM-DD (default = today)
DateShippedYYYY-MM-DD (default = today)
ShippedVia
CustomerOrderNumber
SalesCategoryCodedefaulted from CustomerCode
Subtotalread-only
Tax2AmountGST/federal tax (read-only)
SalesTaxAmountPST/state tax (read-only)
InvoiceTotalread-only
Termsdefaulted from CustomerCode
PriceLevel1-10 (N/A if using PartsMarkupTableCode)
TerritorySalesRepCodedefaulted from CustomerCode
PartsMarkupTableCodeN/A if InventoryProfile not set to use WOMarkupTable
SalesTaxApplicableAmountread-only
Warehouse• defaulted from CustomerCode
• N/A if MULTI-Whse is not turned on in SystemParameters>Star Options
pdfInvoiceread-only; Option=Update — base64 encoded pdf

LineItems

FieldDescription
LineNumber1-9999 (read-only)
TypeP|C|O|G
• P – Product (default)
• C – Comment
• O – Other Charges
• G – Journal Entry
QuantityOrderedType=P – default = 1
QuantityShippedType=P – default = QuantityOrdered
QuantityBackOrderedType=P – default = 0
GLAccountType=O | G – required
DivisionType=O | G – required
SubAccountType=O | G – required
TaxableType=P | O – boolean (Tax1 / PST / State)
• default = false
AmountType=O | G | P (LineTotal)
• G – all LineItems must total to 0.00
• P – LineTotal (read-only; QtyShipped x Price)
PartNumberType=P – required
CostType=P – defaulted from PartNumber
PriceType=P – Sell Price; defaulted from PartNumber
DescriptionType=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

  • preliminary defaults 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

  • ReferenceNumber is 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
}
  • ReferenceNumber is 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
}

Error examples