InvoiceNote

POST /invoicing/invoice/add

The following list provides you with the absolute minimum fields required to add an invoice, as well as other potentially required fields. For a full listing of fields available please refer to the Postman collections or Swagger documentation.

Required Fields

The following fields are the absolute minimum fields that should be required to create an invoice.

Field Value
BillToCode Required
Must be a valid Customer Code.
“Do Not Service” must not be True for the customer.
If Financed is True the customer must be a Finance Company.
If the Payment option “AR” is true, then the BillTo Customer must allow charge.
BranchCode Required
Must be a valid Branch Code.
If not provided it will use the branch supplied during the login process, and if that is empty it uses the constant value “DEFAULT”.
If a valid Invoice Type is provided and the Invoice Type option “Always Use This Branch” is True then the Branch from the Invoice Type will be used.
Code Required If not provided it will generated a Code using either the Invoice Type number or system numbering series.
InvTypeCode Required
Must be a valid Invoice Type Code that is not Obsolete.
PaymentTypeCode Required
Must be a valid Payment Type Code that is not Obsolete.
SoldToCode Required
Must be a valid Customer Code. “Do Not Service” must not be True for the customer.
Tax2Code Required
Must be a valid Tax Code.
If not provided the Tax Code from the Bill To Customer will be used.
Note: Tax2Perentage should be provided as well. If not provided then the Tax Percentage from the Tax Code (either the provided code or from the Customer) will be used.
UserCreated Required
Must be a valid User Code that is not Obsolete.
If not provided it will use the Login User.

Potentially Required Fields

These fields may be required depending on your ePASS configuration, or there is unique behavior that needs to be mentioned.

Field Value
Department This is a required field.
If provided then it must be a valid Department for the Invoice Type that was provided.
If not provided then the Default Department from the Invoice Type will be used (as long as the Invoice Type “Default Department from Terminal” is not checked).
Otherwise it will be set to “ALL”.
JobStatusCode If the Invoice Type option “JobStatusRequired” is True, then the “JobStatusCode” field must have a valid value.
Must be allowed for the provided Department.
Dispatchable Job Statuses are currently not allowed, as Routing is not yet supported.
MapZoneCode If the Invoice Type option “MapZoneRequired” is True, then the “MapZoneCode” field must have a valid value.
Must be allowed for the provided Department.
DispatchUnits If a value is not provided and Dispatching is turned on for the Invoice Type, this value will default from Dispatching Variables - Default Call Units.
Note: “Accumulate Points For Call Units” is not supported/calculated at this time.
ScheduleDate and PickUpDate If the Invoice Type option “LinkTaxesToDeliveryPickup” is True then either ScheduleDate or PickupDate will be required (you are not allowed to provide both dates).
If the Invoice Type option “ScheduleOrPickupRequired” is True then either ScheduleDate or PickupDate will be required.
If the Invoice Type option “SchedAndPickupDtAllowed” is True then you will be allowed to provide both a ScheduleDate and a PickupDate (unless “LinkTaxesToDeliveryPickup is also True), otherwise you are only allowed to provide one of these dates.
Salesperson1Code If the Invoice Type option “RequireSalesperson” is True then it is required.
Must be a valid Salesperson Code that is not Obsolete.
Must be allowed for the provided Department.
SvcFollowUpDate If a value is not provide and if the Invoice Type option “Enable Follow Up date” is True then this will be set to Today + the “Default Follow Up Days” from the Invoice Type.
Priorities If the Invoice Type option “RequirePriorities” is True, then the “Priorities” field must have at least one valid value.
Reference If the Invoice Type option “RequireReference” is True, then the “Reference” field must have a valid value.
SaleReferralCode If the Invoice Type option “SaleReferralRequired” is True, then the “SaleReferralCode” field must have a valid value.
Qualifications If the Invoice Type option “RequireQualifications” is True, then the “Qualifications” field must have at least one valid value.
SvcBrandCode If the Invoice Type option “RequireServiceBrand” is True, then the “SvcBrandCode” field must have a valid value.
SvcProduct If the Invoice Type option “RequireServiceProduct” is True, then the “SvcProduct” field must have a valid value.
SvcModel If the Invoice Type option “RequireServiceModel” is True, then the “SvcModel” field must have a valid value.
SvcSerial If the Invoice Type option “RequireServiceSerial” is True, then the “SvcSerial” field must have a valid value.
SvcDealerCode If the Invoice Type option “RequireServiceDealer” is True, then the “SvcDealerCode” field must have a valid value.
SvcComplainDesc If the Invoice Type option “RequireServiceComplaint” is True, then the “SvcComplaintDesc” field must have a value
Table1 If the Invoice Type option “Table1Mandatory” is True, then the “Table1” field must have at least one valid value.
Table2 If the Invoice Type option “Table2Mandatory” is True, then the “Table2” field must have at least one valid value.
ShipViaCode If the Invoice Type option “RequireShipVia” is True, then the “ShipViaCode” field must have a valid value.
TripChargeCode If the Invoice Type option “RequireTripCharge” is True, then the “TripChargeCode” field must have a valid value.
RequestedDate If the Invoice Type options “RequestedDateRequired” is True and “NotShowRequestedDate” is False, then the “RequestedDate” field must have a valid value.
SvcDatePurchased If the Invoice Type option “RequireServicePurchaseDate” is True then “SvcDatePurchased” is required.
SoldToAddress1 If the Invoice Type option “UseTTRTax” is True AND “PickUpDate” is empty, then “SoldToAddress1” is required.
SoldToCity If the Invoice Type option “UseTTRTax” is True AND “PickUpDate” is empty, then “SoldToCity” is required.
SoldToState If the Invoice Type option “UseTTRTax” is True AND “PickUpDate” is empty, then “SoldToState” is required.
SoldToZipCode If the Invoice Type option “UseTTRTax” is True AND “PickUpDate” is empty, then “SoldToZipCode” is required.
SoldToDirections If the VarAR option “RequireDirections” is True, then “SoldToDirections” is required.
SoldToEmail If the VarAR option “RequireEmail” is True or the Invoice Type option “RequireEmailDuringAddInvoice” is True, then “SoldToEmail” is required.
SvcSpecAuthNumber If SvcBrandCode has RequiresSpecialAuth set to True, “SvcSpecAuthNumber” is required.
Field1 If the Invoice Variables option “Field1Mandatory” is True, then “Field1” is required.
Field2 If the Invoice Variables option “Field2Mandatory” is True, then “Field2” is required.
Field3 If the Invoice Variables option “Field3Mandatory” is True, then “Field3” is required.
Field4 If the Invoice Variables option “Field4Mandatory” is True, then “Field4” is required.
Field5 If the Invoice Variables option “Field5Mandatory” is True, then “Field5” is required.

Sold to Customer

If a valid SoldToCode is provided then the following values will be defaulted from the Customer. You can override any of the values that would come from the Customer simply by providing your own value, or a “blank” value if you do not want to use the Customer.

Key Value
updateSoldToCustomerOnFile If you would like to update the Customer record with the provided Sold To values then you can specify True for this value.
SoldToAddress1 Customer -> Address1
SoldToAddress2 Customer -> Address2
SoldToBusinessPhone Customer -> BusinessPhone
SoldToBusinessPhoneTextEnabled Customer -> BusinessPhoneTextEnabled
SoldToCity Customer -> City
SoldToDeclineEmail Customer -> DeclineEmail
SoldToDirections Customer -> Directions
SoldToEmail Customer -> Email
SoldToFax Customer -> Fax
SoldToFaxTextEnabled Customer -> FaxTextEnabled
SoldToFirstName Customer -> FirstName
SoldToLastName Customer -> LastName
SoldToLatitude Customer -> Latitude
SoldToLongitude Customer -> Longitude
SoldToPhone1 Customer -> Phone1
SoldToPhone1TextEnabled Customer -> Phone1TextEnabled
SoldToPhone2 Customer -> Phone2
SoldToPhone2TextEnabled Customer -> Phone2TextEnabled
SoldToPreferredContact Customer -> PreferredContact
SoldToState Customer -> State
SoldToSuite Customer -> Suite
SoldToZipCode Customer -> ZipCode
PONumber Customer -> PONumber ** Unless Customer PO Number has expired

BillToCustomer

If a valid BillToCode is provided then the following values will be defaulted from the Customer. You can override any of the values that would come from the Customer simply by providing your own value, or a “blank” value if you do not want to use the Customer.

Key Value
updateBillToCustomerOnFile If you would like to update the Customer record with the provided Bill To values then you can specify True for this value.
BillToAddress1 Customer -> Address1
BillToAddress2 Customer -> Address2
BillToBusinessPhone Customer -> BusinessPhone
BillToBusinessPhoneTextEnabled Customer -> BusinessPhoneTextEnabled
BillToCity Customer -> City
BillToEmail Customer -> Email
BillToFax Customer -> Fax
BillToFaxTextEnabled Customer -> FaxTextEnabled
BillToFirstName Customer -> FirstName
BillToLastName Customer -> LastName
BillToPhone1 Customer -> Phone1
BillToPhone1TextEnabled Customer -> Phone1TextEnabled
BillToPhone2 Customer -> Phone2
BillToPhone2TextEnabled Customer -> Phone2TextEnabled
BillToPreferredContact Customer -> PreferredContact
BillToState Customer -> State
BillToSuite Customer -> Suite
BillToZipCode Customer -> ZipCode
ItemListPriceCode Customer -> ItemListPriceCode
SerialListPriceCode Customer -> SerialListPriceCode
OtherListPriceCode Customer -> OtherListPriceCode
LaborRate Customer -> LaborRate

Sample: Add an Invoice



POST /v1/invoicing/invoice/add

{
    "soldToCityCode": null,
    "billToSuite": null,
    "soldToSuite": null,
    "svcContract": null,
    "shipMethod": null,
    "dispatchUnits": null,
    "printMethod": null,
    "tripChargeCode": null,
    "tripChargeAmount": null,
    "carrierCode": null,
    "shipViaCode": "7 Suns Delivery",
    "soldToLatitude": null,
    "soldToLongitude": null,
    "soldToBusinessPhone": null,
    "soldToFax": null,
    "billToBusinessPhone": null,
    "billToFax": null,
    "soldToPhone1TextEnabled": null,
    "soldToPhone2TextEnabled": null,
    "soldToBusinessPhoneTextEnabled": null,
    "soldToFaxTextEnabled": null,
    "billToPhone1TextEnabled": null,
    "billToPhone2TextEnabled": null,
    "billToBusinessPhoneTextEnabled": null,
    "billToFaxTextEnabled": null,
    "svcEquipmentNumber": null,
    "soldToPreferredContact": null,
    "billToPreferredContact": null,
    "department": null,
    "creditStatusCode": null,
    "requestedDate": null,
    "svcCSRInvoice": null,
    "svcSoldList": null,
    "svcSoldSTDCost": null,
    "svcFollowUpDate": null,
    "svcScheduleDate": null,
    "soldToDeclineEmail": null,
    "minDepositPercent": null,
    "unitModifier": null,
    "pickUpBranchCode": null,
    "podiumOptOut": null,
    "billToAddress1": null,
    "billToAddress2": null,
    "billToCity": null,
    "billToCode": "96865",
    "billToEmail": null,
    "billToFirstName": null,
    "billToLastName": null,
    "billToPhone1": null,
    "billToPhone2": null,
    "billToState": null,
    "billToZipCode": null,
    "branchCode": "055",
    "code": null,
    "dispatchRequestedRouteCode": null,
    "dispatchSpecRequest": null,
    "dispatchTime": null,
    "dispatchTimeAM": null,
    "field1": null,
    "field2": null,
    "field3": null,
    "field4": null,
    "field5": null,
    "invTypeCode": "RE",
    "itemListPriceCode": null,
    "jobLocation": null,
    "jobNumber": null,
    "jobStatusCode": "UNCONFIRMED",
    "laborRate": null,
    "mapReference": null,
    "mapZoneCode": "ON",
    "otherListPriceCode": null,
    "poNumber": null,
    "paymentTypeCode": null,
    "pickUpDate": null,
    "reference": null,
    "saleReferralCode": "Onlin",
    "salesperson1Code": "99999",
    "salesperson2Code": null,
    "salesperson2Percentage": null,
    "scheduleDate": "2021-11-10",
    "serialListPriceCode": null,
    "soldToAddress1": null,
    "soldToAddress2": null,
    "soldToCity": null,
    "soldToCode": "96865",
    "soldToDirections": null,
    "soldToEmail": null,
    "soldToFirstName": null,
    "soldToLastName": null,
    "soldToPhone1": null,
    "soldToPhone2": null,
    "soldToState": null,
    "soldToZipCode": null,
    "svcAgreementExpDate": null,
    "svcAgreementNumber": null,
    "svcBrandCode": null,
    "svcCenter": null,
    "svcCenterNumber": null,
    "svcComplaintCode": null,
    "svcComplaintDesc": null,
    "svcDatePurchased": null,
    "svcDealerCode": null,
    "svcDealerDesc": null,
    "svcDistributorNumber": null,
    "svcInWarranty": null,
    "svcMfgCodeEiaNumber": null,
    "svcMicroLeak": null,
    "svcMiles": null,
    "svcMilesRate": null,
    "svcMilesTotal": null,
    "svcModel": null,
    "svcMotorNewNumber": null,
    "svcMotorOldNumber": null,
    "svcPerformedCode": null,
    "svcPerformedDesc": null,
    "svcProduct": null,
    "svcProductCode": null,
    "svcRepairCatMinorMajor": null,
    "svcRepairCategory": null,
    "svcRepairCode": null,
    "svcRunNumber": null,
    "svcSerial": null,
    "svcSpecAuthNumber": null,
    "svcStockMerchandise": null,
    "svcTimeCompleted1": null,
    "svcTimeCompleted2": null,
    "svcTimeOnJob1": null,
    "svcTimeOnJob2": null,
    "svcTimeStarted1": null,
    "svcTimeStarted2": null,
    "tax2Code": "ONH",
    "tax2Exempt": null,
    "tax3Exempt": null,
    "userCreated": "03030",
    "warrantyField1": null,
    "warrantyField2": null,
    "warrantyField3": null,
    "warrantyField4": null,
    "warrantyField5": null,
    "updateSoldToCustomerOnFile": false,
    "updateBillToCustomerOnFile": false,
    "priorities": ["PM","LC","3MAN"],
    "qualifications": ["CV"],
    "inFulfillment": true,
    "relatedInvoiceCodes": [
        {
            "relatedInvoiceCode": "S03247332",
            "relation": "LINKED"
        }
    ]
} 

  


{
    "success": true,
    "warning": false,
    "httpStatusCode": 201,
    "generalMessage": null,
    "exceptionMessage": null,
    "keys": [
        {
            "table": "Invoice",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 694334
                        }
                    ]
                },
                {
                    "key": "PrimaryKey",
                    "fields": [
                        {
                            "fieldName": "Code",
                            "fieldValue": "           S03460687"
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceRelations",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 577009
                        }
                    ]
                }
            ]
        }
    ],
    "messages": [],
    "warnings": []
}

  


{
    "success": false,
    "warning": false,
    "httpStatusCode": 422,
    "generalMessage": "One or more of the fields has an invalid or missing value.",
    "exceptionMessage": null,
    "keys": [],
    "messages": [
        {
            "code": "INV-010041",
            "message": "SoldToCode is required."
        }
    ],
    "warnings": []
}