Bad Request (Error 400: OutOfBalanceError) - Cannot complete an out of balance sale. Non-cash payments are greater than the total. [Account.Sale: Update]

361 views
Skip to first unread message

Aaron Affleck

unread,
Jul 24, 2015, 5:13:41 PM7/24/15
to Lightspeed Retail API Developers
I am getting the error above when trying to create/update a sale.

This is the Sale Summary

LightSpeed Order Summary:
LightSpeed Sale ID: 35108
LightSpeed Payment ID: 27096 (1)
calcTotal: 175.00
calcSubtotal: 175.00
calcTaxable: 0.00
calcNonTaxable: 175.00
calcTax1: 0.00
calcPayments: 197.75
Balance: 175.00
Is Complete?: No

As you will see the price fields are out of sync and I think my tax settings may be incorrect. Could someone direct me to what needs to be changed in the XML?

Thanks, Aaron

and this is my XML

LightSpeed Sale Object:
object(stdClass)#5061 (42) {
  ["saleID"]=>
  string(5) "35108"
  ["timeStamp"]=>
  string(25) "2015-07-24T18:02:14+00:00"
  ["discountPercent"]=>
  string(1) "0"
  ["completed"]=>
  string(5) "false"
  ["archived"]=>
  string(5) "false"
  ["voided"]=>
  string(5) "false"
  ["enablePromotions"]=>
  string(5) "false"
  ["isTaxInclusive"]=>
  string(5) "false"
  ["referenceNumber"]=>
  string(6) "385400"
  ["referenceNumberSource"]=>
  string(11) "WooCommerce"
  ["tax1Rate"]=>
  string(4) "0.13"
  ["tax2Rate"]=>
  string(4) "0.08"
  ["change"]=>
  string(1) "0"
  ["receiptPreference"]=>
  string(7) "printed"
  ["displayableSubtotal"]=>
  string(3) "175"
  ["ticketNumber"]=>
  string(12) "220000035108"
  ["calcDiscount"]=>
  string(1) "0"
  ["calcTotal"]=>
  string(3) "175"
  ["calcSubtotal"]=>
  string(3) "175"
  ["calcTaxable"]=>
  string(1) "0"
  ["calcNonTaxable"]=>
  string(3) "175"
  ["calcAvgCost"]=>
  string(4) "87.5"
  ["calcFIFOCost"]=>
  string(4) "87.5"
  ["calcTax1"]=>
  string(1) "0"
  ["calcTax2"]=>
  string(1) "0"
  ["calcPayments"]=>
  string(6) "197.75"
  ["total"]=>
  string(3) "175"
  ["totalDue"]=>
  string(3) "175"
  ["balance"]=>
  string(3) "175"
  ["customerID"]=>
  string(5) "11219"
  ["discountID"]=>
  string(1) "0"
  ["employeeID"]=>
  string(1) "1"
  ["quoteID"]=>
  string(1) "0"
  ["registerID"]=>
  string(1) "4"
  ["shipToID"]=>
  string(1) "0"
  ["shopID"]=>
  string(1) "1"
  ["taxCategoryID"]=>
  string(1) "1"
  ["Customer"]=>
  object(stdClass)#5060 (16) {
    ["customerID"]=>
    string(5) "11219"
    ["firstName"]=>
    string(5) "Aaron"
    ["lastName"]=>
    string(7) "Affleck"
    ["archived"]=>
    string(5) "false"
    ["title"]=>
    string(0) ""
    ["company"]=>
    string(0) ""
    ["createTime"]=>
    string(25) "2015-04-24T14:11:25+00:00"
    ["timeStamp"]=>
    string(25) "2015-04-30T17:46:22+00:00"
    ["contactID"]=>
    string(5) "11897"
    ["creditAccountID"]=>
    string(1) "0"
    ["customerTypeID"]=>
    string(1) "8"
    ["discountID"]=>
    string(1) "0"
    ["employeeID"]=>
    string(1) "0"
    ["noteID"]=>
    string(1) "0"
    ["taxCategoryID"]=>
    string(1) "0"
    ["Contact"]=>
    object(stdClass)#4302 (10) {
      ["contactID"]=>
      string(5) "11897"
      ["custom"]=>
      string(0) ""
      ["noEmail"]=>
      string(5) "false"
      ["noPhone"]=>
      string(5) "false"
      ["noMail"]=>
      string(5) "false"
      ["timeStamp"]=>
      string(25) "2015-04-30T17:46:22+00:00"
      ["Addresses"]=>
      object(stdClass)#4483 (1) {
        ["ContactAddress"]=>
        object(stdClass)#4482 (5) {
          ["address1"]=>
          string(17) "5-205 Second ST S"
          ["city"]=>
          string(6) "Kenora"
          ["state"]=>
          string(2) "ON"
          ["zip"]=>
          string(7) "P9N 1G1"
          ["country"]=>
          string(2) "CA"
        }
      }
      ["Phones"]=>
      object(stdClass)#4479 (1) {
        ["ContactPhone"]=>
        object(stdClass)#5089 (2) {
          ["number"]=>
          string(10) "8074075426"
          ["useType"]=>
          string(6) "Mobile"
        }
      }
      ["Emails"]=>
      object(stdClass)#5079 (1) {
        ["ContactEmail"]=>
        object(stdClass)#5076 (2) {
          ["address"]=>
          string(18) "aa...@inteleck.com"
          ["useType"]=>
          string(7) "Primary"
        }
      }
      ["Websites"]=>
      string(0) ""
    }
  }
  ["TaxCategory"]=>
  object(stdClass)#5075 (8) {
    ["taxCategoryID"]=>
    string(1) "1"
    ["isTaxInclusive"]=>
    string(5) "false"
    ["tax1Name"]=>
    string(3) "HST"
    ["tax2Name"]=>
    string(0) ""
    ["tax1Rate"]=>
    string(4) "0.13"
    ["tax2Rate"]=>
    string(4) "0.08"
    ["timeStamp"]=>
    string(25) "2014-08-25T15:56:28+00:00"
    ["TaxCategoryClasses"]=>
    object(stdClass)#5074 (1) {
      ["TaxCategoryClass"]=>
      array(3) {
        [0]=>
        object(stdClass)#5073 (6) {
          ["taxCategoryClassID"]=>
          string(2) "34"
          ["tax1Rate"]=>
          string(4) "0.13"
          ["tax2Rate"]=>
          string(1) "0"
          ["timeStamp"]=>
          string(25) "2014-08-25T15:56:12+00:00"
          ["taxCategoryID"]=>
          string(1) "1"
          ["taxClassID"]=>
          string(2) "18"
        }
        [1]=>
        object(stdClass)#5080 (6) {
          ["taxCategoryClassID"]=>
          string(2) "38"
          ["tax1Rate"]=>
          string(4) "0.05"
          ["tax2Rate"]=>
          string(1) "0"
          ["timeStamp"]=>
          string(25) "2014-08-25T15:55:53+00:00"
          ["taxCategoryID"]=>
          string(1) "1"
          ["taxClassID"]=>
          string(2) "17"
        }
        [2]=>
        object(stdClass)#5078 (6) {
          ["taxCategoryClassID"]=>
          string(2) "40"
          ["tax1Rate"]=>
          string(4) "0.05"
          ["tax2Rate"]=>
          string(1) "0"
          ["timeStamp"]=>
          string(25) "2014-08-25T15:56:21+00:00"
          ["taxCategoryID"]=>
          string(1) "1"
          ["taxClassID"]=>
          string(2) "17"
        }
      }
    }
  }
  ["SaleLines"]=>
  object(stdClass)#5077 (1) {
    ["SaleLine"]=>
    array(2) {
      [0]=>
      object(stdClass)#4476 (35) {
        ["saleLineID"]=>
        string(5) "43052"
        ["createTime"]=>
        string(25) "2015-07-24T17:59:33+00:00"
        ["timeStamp"]=>
        string(25) "2015-07-24T17:59:33+00:00"
        ["unitQuantity"]=>
        string(1) "1"
        ["unitPrice"]=>
        string(3) "175"
        ["normalUnitPrice"]=>
        string(1) "0"
        ["discountAmount"]=>
        string(1) "0"
        ["discountPercent"]=>
        string(1) "0"
        ["avgCost"]=>
        string(4) "87.5"
        ["fifoCost"]=>
        string(4) "87.5"
        ["tax"]=>
        string(5) "false"
        ["tax1Rate"]=>
        string(4) "0.13"
        ["tax2Rate"]=>
        string(4) "0.08"
        ["isLayaway"]=>
        string(5) "false"
        ["isWorkorder"]=>
        string(5) "false"
        ["isSpecialOrder"]=>
        string(5) "false"
        ["displayableSubtotal"]=>
        string(3) "175"
        ["displayableUnitPrice"]=>
        string(3) "175"
        ["calcLineDiscount"]=>
        string(1) "0"
        ["calcTransactionDiscount"]=>
        string(1) "0"
        ["calcTotal"]=>
        string(3) "175"
        ["calcSubtotal"]=>
        string(3) "175"
        ["calcTax1"]=>
        string(1) "0"
        ["calcTax2"]=>
        string(1) "0"
        ["taxClassID"]=>
        string(2) "18"
        ["customerID"]=>
        string(5) "11219"
        ["discountID"]=>
        string(1) "0"
        ["employeeID"]=>
        string(1) "1"
        ["itemID"]=>
        string(5) "11997"
        ["noteID"]=>
        string(1) "0"
        ["parentSaleLineID"]=>
        string(1) "0"
        ["shopID"]=>
        string(1) "1"
        ["saleID"]=>
        string(5) "35108"
        ["TaxClass"]=>
        object(stdClass)#4471 (3) {
          ["taxClassID"]=>
          string(2) "18"
          ["name"]=>
          string(4) "Item"
          ["timeStamp"]=>
          string(25) "2013-10-31T22:31:18+00:00"
        }
        ["Item"]=>
        object(stdClass)#4475 (27) {
          ["itemID"]=>
          string(5) "11997"
          ["systemSku"]=>
          string(12) "210000012629"
          ["defaultCost"]=>
          string(4) "87.5"
          ["avgCost"]=>
          string(4) "87.5"
          ["discountable"]=>
          string(4) "true"
          ["tax"]=>
          string(4) "true"
          ["archived"]=>
          string(5) "false"
          ["itemType"]=>
          string(7) "default"
          ["description"]=>
          string(33) "Chainlink matte black w/fire irid"
          ["modelYear"]=>
          string(1) "0"
          ["upc"]=>
          string(0) ""
          ["ean"]=>
          string(0) ""
          ["customSku"]=>
          string(0) ""
          ["manufacturerSku"]=>
          string(9) "oo9247-03"
          ["createTime"]=>
          string(25) "1970-01-01T06:00:00+00:00"
          ["timeStamp"]=>
          string(25) "2015-07-07T00:26:05+00:00"
          ["categoryID"]=>
          string(3) "264"
          ["taxClassID"]=>
          string(2) "18"
          ["departmentID"]=>
          string(1) "0"
          ["itemMatrixID"]=>
          string(1) "0"
          ["itemAttributesID"]=>
          string(1) "0"
          ["manufacturerID"]=>
          string(2) "34"
          ["noteID"]=>
          string(5) "12599"
          ["seasonID"]=>
          string(1) "0"
          ["defaultVendorID"]=>
          string(2) "78"
          ["itemECommerceID"]=>
          string(3) "432"
          ["Prices"]=>
          object(stdClass)#4472 (1) {
            ["ItemPrice"]=>
            array(2) {
              [0]=>
              object(stdClass)#4473 (2) {
                ["amount"]=>
                string(3) "175"
                ["useType"]=>
                string(7) "Default"
              }
              [1]=>
              object(stdClass)#5100 (2) {
                ["amount"]=>
                string(3) "175"
                ["useType"]=>
                string(4) "MSRP"
              }
            }
          }
        }
      }
      [1]=>
      object(stdClass)#5101 (34) {
        ["saleLineID"]=>
        string(5) "43054"
        ["createTime"]=>
        string(25) "2015-07-24T17:59:34+00:00"
        ["timeStamp"]=>
        string(25) "2015-07-24T17:59:34+00:00"
        ["unitQuantity"]=>
        string(1) "1"
        ["unitPrice"]=>
        string(1) "0"
        ["normalUnitPrice"]=>
        string(1) "0"
        ["discountAmount"]=>
        string(1) "0"
        ["discountPercent"]=>
        string(1) "0"
        ["avgCost"]=>
        string(1) "0"
        ["fifoCost"]=>
        string(1) "0"
        ["tax"]=>
        string(5) "false"
        ["tax1Rate"]=>
        string(4) "0.13"
        ["tax2Rate"]=>
        string(4) "0.08"
        ["isLayaway"]=>
        string(5) "false"
        ["isWorkorder"]=>
        string(5) "false"
        ["isSpecialOrder"]=>
        string(5) "false"
        ["displayableSubtotal"]=>
        string(1) "0"
        ["displayableUnitPrice"]=>
        string(1) "0"
        ["calcLineDiscount"]=>
        string(1) "0"
        ["calcTransactionDiscount"]=>
        string(1) "0"
        ["calcTotal"]=>
        string(1) "0"
        ["calcSubtotal"]=>
        string(1) "0"
        ["calcTax1"]=>
        string(1) "0"
        ["calcTax2"]=>
        string(1) "0"
        ["taxClassID"]=>
        string(1) "0"
        ["customerID"]=>
        string(5) "11219"
        ["discountID"]=>
        string(1) "0"
        ["employeeID"]=>
        string(1) "1"
        ["itemID"]=>
        string(5) "13966"
        ["noteID"]=>
        string(1) "0"
        ["parentSaleLineID"]=>
        string(1) "0"
        ["shopID"]=>
        string(1) "1"
        ["saleID"]=>
        string(5) "35108"
        ["Item"]=>
        object(stdClass)#5102 (27) {
          ["itemID"]=>
          string(5) "13966"
          ["systemSku"]=>
          string(12) "210000014664"
          ["defaultCost"]=>
          string(1) "0"
          ["avgCost"]=>
          string(1) "0"
          ["discountable"]=>
          string(4) "true"
          ["tax"]=>
          string(4) "true"
          ["archived"]=>
          string(5) "false"
          ["itemType"]=>
          string(13) "non_inventory"
          ["description"]=>
          string(20) "Shipping to Customer"
          ["modelYear"]=>
          string(1) "0"
          ["upc"]=>
          string(0) ""
          ["ean"]=>
          string(0) ""
          ["customSku"]=>
          string(0) ""
          ["manufacturerSku"]=>
          string(0) ""
          ["createTime"]=>
          string(25) "2015-04-13T16:55:58+00:00"
          ["timeStamp"]=>
          string(25) "2015-07-07T00:26:05+00:00"
          ["categoryID"]=>
          string(1) "0"
          ["taxClassID"]=>
          string(2) "18"
          ["departmentID"]=>
          string(1) "0"
          ["itemMatrixID"]=>
          string(1) "0"
          ["itemAttributesID"]=>
          string(1) "0"
          ["manufacturerID"]=>
          string(1) "0"
          ["noteID"]=>
          string(5) "16338"
          ["seasonID"]=>
          string(1) "0"
          ["defaultVendorID"]=>
          string(1) "0"
          ["itemECommerceID"]=>
          string(1) "0"
          ["Prices"]=>
          object(stdClass)#5103 (1) {
            ["ItemPrice"]=>
            array(2) {
              [0]=>
              object(stdClass)#5104 (2) {
                ["amount"]=>
                string(1) "0"
                ["useType"]=>
                string(7) "Default"
              }
              [1]=>
              object(stdClass)#5105 (2) {
                ["amount"]=>
                string(1) "0"
                ["useType"]=>
                string(4) "MSRP"
              }
            }
          }
        }
      }
    }
  }
  ["SalePayments"]=>
  object(stdClass)#5106 (1) {
    ["SalePayment"]=>
    object(stdClass)#5107 (12) {
      ["salePaymentID"]=>
      string(5) "27096"
      ["amount"]=>
      string(6) "197.75"
      ["createTime"]=>
      string(25) "2015-07-24T18:00:08+00:00"
      ["archived"]=>
      string(4) "true"
      ["saleID"]=>
      string(5) "35108"
      ["paymentTypeID"]=>
      string(2) "15"
      ["ccChargeID"]=>
      string(1) "8"
      ["registerID"]=>
      string(1) "4"
      ["employeeID"]=>
      string(1) "1"
      ["creditAccountID"]=>
      string(1) "0"
      ["PaymentType"]=>
      object(stdClass)#5108 (7) {
        ["paymentTypeID"]=>
        string(2) "15"
        ["name"]=>
        string(6) "PayPal"
        ["requireCustomer"]=>
        string(5) "false"
        ["archived"]=>
        string(5) "false"
        ["internalReserved"]=>
        string(5) "false"
        ["type"]=>
        string(12) "user defined"
        ["refundAsPaymentTypeID"]=>
        string(1) "0"
      }
      ["CCCharge"]=>
      object(stdClass)#5109 (16) {
        ["ccChargeID"]=>
        string(1) "8"
        ["gatewayTransID"]=>
        string(0) ""
        ["xnum"]=>
        string(0) ""
        ["voided"]=>
        string(5) "false"
        ["refunded"]=>
        string(1) "0"
        ["amount"]=>
        string(6) "197.75"
        ["exp"]=>
        string(0) ""
        ["authOnly"]=>
        string(5) "false"
        ["authCode"]=>
        string(0) ""
        ["cardType"]=>
        string(0) ""
        ["entryMethod"]=>
        string(0) ""
        ["cardholderName"]=>
        string(0) ""
        ["isDebit"]=>
        string(5) "false"
        ["timeStamp"]=>
        string(25) "2015-07-24T18:00:08+00:00"
        ["declined"]=>
        string(5) "false"
        ["saleID"]=>
        string(5) "35108"
      }
    }
  }
  ["taxTotal"]=>
  string(1) "0"
}

Dan Schales

unread,
Jul 24, 2015, 5:15:56 PM7/24/15
to merchantos-a...@googlegroups.com, aa...@inteleck.com, aa...@inteleck.com
Hi Aaron,

Is this Sale supposed to have tax applied? It looks like the Payment may have been calculated on the Sale amount with tax, but the actual SaleLine doesn't have tax on it. I would suggest either updating the amounts in the SalePayment to $175, or setting Tax to true on the SaleLine so that the item is charged tax and see if that brings the totals inline. Which solution you go with depends on if tax was supposed to be charged or not, so clarify that and then move from there.

-Dan

Nam Tran Huu

unread,
Jul 27, 2015, 9:35:43 AM7/27/15
to Lightspeed Retail API Developers, aa...@inteleck.com, dan.s...@lightspeedretail.com
I had same issues. Setting Tax to true does not help. 
Reply all
Reply to author
Forward
0 new messages