InvoiceWarranty

The InvoiceWarranty object contains the attributes of an extended warranty product.

Add an Extended Warranty to an Invoice

POST /v1/invoicing/invoice/warranty/add

This endpoint adds an extended warranty product to an existing invoice. Extended warranties can’t be added to ePASS without an existing invoice to add them to.

Invoice Conditions

The following Invoice conditions must be satisfied in order to add any InvoiceWarranty record.

Condition Value
Invoice Status Invoice Status must be “Open” or “Committed”.
Branch Code 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”.
Invoice JobStatus Any Job Status cascading that is configured in ePASS will be enforced through the API.
Bill To Customer BillToCustomer must be allowed to charge if the invoice is not estimate and the payment type is AR.
Credit Limits will be enforced in the following situation:
- The invoice is not an estimate
- Credit Limit is enabled for the Customer
- The Invoice Payment Type is AR
- Require Credit Approval is disabled
- Either the Job Status is dispatchable or Dispatching is disabled completely

Required Fields

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

Field Value
InvoiceCode Must be a valid Invoice Code.
Qty If not provide, default to 1.
WarrantyCode Must be a valid Code that is not Obsolete.
UserCreated Must be a valid User Code that is not Obsolete. If not provided it will use the Login User.

WarrantyCode

If a valid ExtWarrrantyCode is provided then the following values will be defaulted from the ExtWarranty. You can override any of the values that would come from the ExtWarranty simply by providing your own value.

Key Value
ExtWarrantyDesc ExtWarranty-> Description
GLRevenue ExtWarranty-> GLRevenue
GLCostCr ExtWarranty-> GLCostCr
GLCostDb ExtWarranty-> GLCostDb
Tax1 ExtWarranty-> Tax1
Tax2 ExtWarrantyisc -> Tax2
Tax3 ExtWarranty-> Tax3
Commission ExtWarranty-> Commission
UnitCost ExtWarranty-> Cost
StartDate Use the schedule date or the finish date of the invoice whichever is later, and if both are empty, use today’s date.
EndDate StartDate + ExtWarrantyisc -> NoOfMonths

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
SellingPrice If the ExtWarranty option “Do Not Allow Price Reduction” is True and the BillTo customer has a valid project code, then the SellingPrice cannot be less than the project price.
If the ExtWarranty option “Do Not Allow Price Change” is True and the BillTo customer has a valid project code, then the SellingPrice must be the project price.
If the ExtWarranty option “Do Not Allow Price Reduction” is True, then the SellingPrice cannot be less than the list price.
If the ExtWarranty option “Do Not Allow Price Change” is True, then the SellingPrice must be the list price.

addRelatedLines

The adding of related detail lines can be controlled using the “addRelatedLines” section. If not provided then no related detail lines will be added.

Key Value Description
Comment Boolean Determines if related Comment lines are added

Sample: Add a Warranty

 {
    "orgModSelPrice": null,
    "userVerified": null,
    "dateVerified": null,
    "timeVerified": null,
    "commissionCode": null,
    "branchCode": null,
    "checkException": null,
    "commission": null,
    "contractNumber": "",
    "endDate": null,
    "extWarrantyCode": "1AB107",
    "extWarrantyDesc": "2 PIECE 5 YEAR EXT WTY UNDER 3K",
    "invoiceCode": "2925",
    "sellingPrice": 91,
    "startDate": null,
    "tax1": null,
    "tax2": null,
    "tax3": null,
    "unitCost": null,
    "warrantyDetailRequests": [],
    "addRelatedLines": {
        "Comment": false
    }
}
 {
    "success": true,
    "message": null,
    "lastException": null,
    "recordId": 122602,
    "code": null,
    "httpStatusCode": 201,
    "messageDetails": []
}

{
    "success": false,
    "message": "One or more of the fields has an invalid or missing value.",
    "lastException": null,
    "recordId": 0,
    "code": null,
    "httpStatusCode": 422,
    "messageDetails": [
        "WarrantyCode does not exist."
    ]
}