Weborder

The Weborder endpoint can be used to send product orders collected from an online shopping cart to EPASS.

The Weborder endpoint requires some initial setup within EPASS before it can be used. See the EPASS Setup instructions for more details.

Add a Web Order


POST /external/weborder


This endpoint adds a web order to the EPASS Web Order Queue. Once the order is in the queue, it needs to be reviewed and processed within EPASS.

Payload

Required Fields

The following fields are the absolute minimum that are required to add a web order.

Field Type Description
webOrderID string This must be a unique ID that has not been used for a previous web order.
orderDate string Format: YYYY-MM-DD
The order date.
firstName string The first name of the person placing the order.
lastName string The last name of the person placing the order.
email string The email of the person placing the order.
billToFirstName string The buyer’s first name. (See Note)
billToLastName string The buyer’s last name. (See Note)
billToCompanyName string The buyer’s company name (if applicable. See Note.)
billToAddress1 string The buyer’s street address.
bilToCity string The buyer’s city.
billToCountry string The buyer’s country.
billToEmail string The buyer’s email.
billToPhone1 string The buyer’s primary phone number.
billToState string The buyer’s state or province.
billToZip string The buyer’s zip or postal code.
shipToFirstName string The recipient’s first name. (See Note)
shipToLastName string The recipient’s last name. (See Note)
shipToCompany string The recipient’s company name (if applicable. See Note.)
shipToAddress1 string The recipient’s street address.
shipToCity string The recipient’s city.
shipToCountry string The recipient’s country.
shipToEmail string The recipient’s email.
shipToPhone1 string The recipient’s primary email.
shipToState string The recipient’s state or province.
shipToZip string The recipient’s zip or postal code.

Web Order Details

These arrays are used to add products, payments, and charges to the web order, such as models, installations, and miscellaneous charges. Each one is optional and not required, however, the fields within each array are required.

Installs [ ]

Adds an installation to the web order.

Field Type Description
installCode string The installation code.
installDesc string The description of the installation.
qty integer The number of installations added to the web order.
price integer The installation price.

Example

...
"Installs": [
        {
            "installCode": "DISHINSTALL",
            "InstallDesc": "Full dishwasher installation.",
            "qty": 1,
            "price": 99.95
        }

Miscs [ ]

Adds a miscellaneous charge to the web order.

Field Type Description
miscNumber string The miscellaneous charge code.
miscDesc string The description of the miscellaneous charge.
qty integer The number of miscellaneous charges added to the web order.
price integer The amount of the miscellaneous charge.

Example

...
"Miscs": [
        {
            "miscNumber": "1138",
            "miscDesc": "Removal fee",
            "qty": 1,
            "price": 19.95
        },

Models [ ]

Adds a model to the web order.

Field Type Description
modelNumber string The model ID code.
modelDesc string The model’s description.
qtyPurchased integer The number of models purchased and added to the web order.
qtyShipped integer The number of models that need to be shipped.
qtyCancelled integer The number of models cancelled that need to be removed from the order.
price integer The model’s individual selling price.

Example

...
"Models": [
        {
            "modelNumber": "1138",
            "modelDesc": "Stainless Steel Dishwasher",
            "qtyPurchased": 2,
            "qtyShipped": 2,
            "qtyCancelled": 0,
            "price": 649.99
        },

Payments [ ]

Adds a payment to the web order.

Field Type Description
paymentMethod string The payment method. “Cash,” “MasterCard,” and “check” are examples of payment methods.
note string The payment note.
amount integer The payment amount.

Example

  "Payments": [
        {
            "paymentMethod": "VISA",
            "note": "Auth# 1234567",
            "amount": 12.03
        },

Wtys [ ]

Adds a warranty product to the order.

Field Type Description
wtyCode string The warranty ID code.
wtyDesc string The warranty’s description.
months integer The warranty term.
price integer The price of the warranty product.

Example

 "Wtys": [
        {
            "wtyCode": "Wty Code1",
            "wtyDesc": "Wty Desc1",

            "months": 8,
            "price": 11.22
        },

Sample: Adding a Web Order


POST /external/weborder
{
    "webOrderId": "9000",
    "orderDate": "2022-07-15",
    "shippingMethod": null,
    "carrierCode": "EVA",
    "trackingNumber": "14456",
    "shippingETA":  "2022-08-15",
    "subTotal": 550.00,
    "taxAmount": 35.00,
    "shippingAmount": 25.00,
    "discountAmount": 100.00,
    "grandTotal": 500.00,
    "orderComment": "AS-IS sale",
    "lastName": "Connor",
    "firstName": "John",
    "email": "jconnor@sky.net",
    "shipToLastName": "Reese",
    "shipToFirstName": "Kyle",
    "shipToEmail": "KReese@gmail.com",
    "shipToAddress1": "123 Main Street",
    "shipToAddress2": "Unit 4",
    "shipToCity": "Los Angeles",
    "shipToState": "CA",
    "shipToZip": "98004",
    "shipToCountry": "USA",
    "shipToPhone1": "213-555-5555",
    "shipToCompanyName": null,
    "billToFirstName": "John",
    "billToLastName": "Connor",
    "billToAddress1": "456 Future Blvd.",
    "billToAddress2": "Unit 1",
    "billToCity": "Los Angeles",
    "billToState": "CA",
    "billToZip": "98004",
    "billToCountry": "USA",
    "billToPhone1": "323-555-1212",
    "billToPhone2": null,
    "billToFax": null,
    "billToEmail": "jconnor@sky.net",
    "billToCompanyName": "Resistance One", 
    "cancelReason": null,
    "deliveryPickup":  "2024-06-15",
    "requestedDate":  "2024-06-15",
    "tax2Code": null,
    "tax3Code": null,
    "branchCode": null,

   	"Installs": [
   	    {
   	        "installCode": "451",
   	        "InstallDesc": "Dishwasher install",
   	        "qty": 1,
   	        "price": 25.00
   	    }],
   	"Miscs": [
   	    {
   	        "miscNumber": "ECO Fee",
   	        "miscDesc": "CA Eco Fee",
   	        "qty": 1,
   	        "price": 15.00
   	    }],
   	"Payments": [
   	    {
   	        "paymentMethod": "VISA",
   	        "note": "Auth #55551234",
   	        "amount": 540.00
   	    }],
   	"Models": [
   	    {
   	        "modelNumber": "T-800",
   	        "modelDesc": "Stainless Steel Dishwasher Unit",
   	        "qtyPurchased": 1,
   	        "qtyShipped": 1,
   	        "qtyCancelled": 0,
   	        "price": 550.00
   	    }],
   	"Wtys": [
   	    {
   	        "wtyCode": "EXTENDED 1YR",
   	        "wtyDesc": "1 Year Extended Warranty. Full replacement.",
   	        "months": 24,
   	        "price": 10.00
   	    }
   	]

}


{
    "success": true,
    "warning": false,
    "httpStatusCode": 201,
    "generalMessage": null,
    "exceptionMessage": null,
    "keys": [
        {
            "table": "WebOrder",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 9457
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceWebOrderInstall",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 63
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceWebOrderMisc",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 17329
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceWebOrderModel",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 11161
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceWebOrderPayment",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 9486
                        }
                    ]
                }
            ]
        },
        {
            "table": "InvoiceWebOrderWty",
            "keys": [
                {
                    "key": "ID",
                    "fields": [
                        {
                            "fieldName": "ID",
                            "fieldValue": 407
                        }
                    ]
                }
            ]
        }
    ],
    "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": "WebOrder-00029",
            "message": "Web Order ID already exists in the system."
        }
    ],
    "warnings": []
}

Search for a Web Order


POST /external/weborder/search


This endpoint searches and returns a web order. You can search for a web order by any of it’s attributes.


POST /external/weborder/search
{
    "query": {
        "fieldName": "WebOrderID",
        "eval": "EQUAL",
        "value": "9001"
    }
}

POST /external/weborder/search
{
    "paging": {
        "pageSize": 5,
        "pageStartId": 0
    },
    "query": {
            "fieldName": "DateRequested",
                "eval": "between",
                "start": "10/10/2020",
                "end":"10/10/2022"
    }, 
    "subquery":[
        {
            "logic": "and",
            "query": {
                "fieldName": "CITY",
                "eval": "IN",
                "valueList": ["vancouver","calgary","burnaby"]
            },
            "subquery":[
            {
                "logic": "or",
                "query": {
                    "fieldName": "Zip",
                    "eval": "equal",
                    "value": "123"
                } 
            }
            ]
        },
        {
            "logic": "or",
            "query": {
                "fieldName": "DatePurchased",
                "eval": "between",
                "start": "10/10/2020",
                "end":"10/10/2021"
            },
            "subquery":[
            {
                "logic": "and",
                "query": {
                    "fieldName": "LastName",
                    "eval": "like",
                    "value": "A"
                } 
            }
            ]
        },
        {
            "logic": "and",
            "query": {
                "fieldName": "email",
                "eval": "equal",
                "value": "test@test.com"
            }
        },
        {
            "logic": "or",
            "query": {
                "fieldName": "phone1",
                "eval": "equal",
                "value": "60411111111"
            }
        }
    ],
    "tables": {
        "ServiceRequest": [
            "ID",
            "Code",
            "FirstName",
            "LastName",
            "city",
            "email",
            "phone1" 
        ] 

    },
    "extendedInfo": {
        "Brand": [
            "ID",
            "Code",
            "Description"
        ],
          "Dealer": [
            "ID",
            "Code",
            "Description"
        ],
          "Product": [
            "ID",
            "Code",
            "Description"
        ]
    }
}

EPASS Setup Instructions

Before using the Weborder endpoint, you’ll need to perform two setup steps in EPASS: create a misceallaneous charge code and activate security options for the User or Group that will view and process web orders.

Create a Miscellaneous Charge Code

Data that is passed to EPASS through the Weborder endpoint isn’t validated. This allows flexibility when using the Weborder endpoint as your storefront can sell product that you may not regularly keep in stock or have a record for in EPASS. EPASS processes web orders with these unique products by assigning them a miscellaneous charge code during order processing. This code must be created in EPASS before web orders can be processed.

To Create the Miscellaneous Charge Code

  1. In EPASS, go to Tools > System Maintenance.

  2. In the Tables tab, select Miscellaneous, and then click Open.

  3. Click Add.

  4. Do the following:

    • Enter XXX in the Code field.
    • Enter a Description (for example, ‘Invalid Codes’)
    • Select an account from the G/L Revenue dropdown.
    • Select the Do Not Finish checkbox.
  5. Click OK, and then exit the Miscellaneous Charge window.

Now when web orders are processed, any models or items that don’t have a record entry in EPASS are assigned the XXX miscellaneous charge.

Enable EPASS Security Options

EPASS Users and Groups require three security options to view, process, and cancel web orders.

To Enable Web Order Security Options:

  1. In EPASS, go to Tools > System Maintenance.

  2. In the Tables tab, select User Security, and then click Open.

  3. Select a User or Group, and then click Security.

  4. In the Keyword search, enter Web Order.

  5. Select the required Web Order security options, and then click OK.

  6. Exit the User Security window.