InvoiceWarranty

The InvoiceWarranty object represents an extended warranty product added to an invoice.

Add an Extended Warranty to an Invoice


POST /invoicing/invoice/warranty/add


This endpoint adds an extended warranty product to an open invoice. Extended warranties can’t be added to EPASS without an existing open 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

Payload

Required Fields

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

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

extWarrantyCode

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 Type Value
SellingPrice integer 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 object. If not provided then no related detail lines will be added.

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

Sample: Adding a Warranty

POST /invoicing/invoice/warranty/add 

{
    "orgModSelPrice": null,
    "userVerified": null,
    "dateVerified": null,
    "timeVerified": null,
    "commissionCode": null,
    "branchCode": null,
    "checkException": null,
    "commission": null,
    "contractNumber": "",
    "endDate": null,
    "extWarrantyCode": "12345",
    "extWarrantyDesc": "2 Appliance Warranty",
    "invoiceCode": "123456",
    "sellingPrice": 95,
    "startDate": null,
    "tax1": null,
    "tax2": null,
    "tax3": null,
    "unitCost": null,
    "warrantyDetailRequests": [],
    "addRelatedLines": {
        "Comment": false
    }
}
 {
    "success": true,
    "warning": false,
    "httpStatusCode": 201,
    "generalMessage": null,
    "exceptionMessage": null,
    "keys": [
        {
            "table": "InvoiceWarranty",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 12345
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceAddress",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 12345
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceAudit",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 123456
                        }
                    ]
                }
            ]
        }
    ],
    "messages": [],
    "warnings": []
}

{
    "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."
    ]
}