Sales import error: Cannot complete an out of balance sale. Payments are insufficient.

184 views
Skip to first unread message

Stefan

unread,
Jul 10, 2014, 9:53:56 AM7/10/14
to merchantos-a...@googlegroups.com
Hi,

Unfortunately my sales import isn't working anymore. I only added a customerID in the code. Before it was working.
Could anyone please help me? Any insights would be appreciated.

Thank you so much,
Stefan


Here is my code:

2014-07-10T13:06:05+00:00 ALERT (1): Export Order::output
2014-07-10T13:06:05+00:00 ALERT (1): <?xml version="1.0"?>
<Sale><completed>true</completed><customerID>9409</customerID><employeeID>2</employeeID><registerID>1</registerID><shopID>1</shopID><taxCategoryID>0</taxCategoryID><ShipTo><shipped>false</shipped><timeStamp>2014-07-10 13:04:16</timeStamp><firstName>Stefan</firstName><lastName>Belter</lastName><company></company><Contact><noEmail>true</noEmail><noPhone>true</noPhone><noMail>true</noMail><Addresses><ContactAddress><address1>Broadway</address1><address2></address2><city>NYC</city><state>NJ</state><zip>07030</zip><country>United States</country></ContactAddress></Addresses><Phones><ContactPhone><number>123456789</number></ContactPhone></Phones><Emails><ContactEmail><address>ste...@gmail.com</address></ContactEmail></Emails></Contact></ShipTo><SaleLines><SaleLine><unitPrice>99.9900</unitPrice><unitQuantity>1.0000</unitQuantity><itemID>13248</itemID></SaleLine></SaleLines><SalePayments><SalePayment><amount>99.99</amount><paymentTypeID>1</paymentTypeID></SalePayment></SalePayments></Sale>

2014-07-10T13:06:06+00:00 ALERT (1): SimpleXMLElement Object
(
    [httpCode] => 400
    [httpMessage] => Bad Request
    [message] => Cannot complete an out of balance sale. Payments are insufficient. (/web/cloud/includes/business/component/Sale.class.php on line 895)
    [backtrace] => #0 /web/cloud/includes/business/process/Sale/Base.class.php(550): business_component_Sale->processPayments(Object(bs_transaction), Array, Array, Array, Array, Array, 0, 0, 99.99, 1, 2, Array)
#1 /web/cloud/includes/business/process/Sale/Create.class.php(142): business_process_Sale_Base->_completeSale(Object(data_model_Sale))
#2 [internal function]: business_process_Sale_Create->process(Object(data_model_Sale), Array)
#3 /web/cloud/includes/business/Process.class.php(32): call_user_func_array(Array, Array)
#4 /web/cloud/includes/controller/control/Account/Sale.class.php(248): business_Process::action('Sale', 'Create', Object(data_model_Sale), Array)
#5 /web/cloud/includes/controller/DataCrudControl.class.php(132): controller_control_Account_Sale->_processCreate(Object(data_model_Sale), Array)
#6 /web/cloud/includes/controller/control/Account/Sale.class.php(181): controller_DataCrudControl->create(Object(SimpleXMLElement), Array)
#7 /web/cloud/includes/controller/Master.class.php(303): controller_control_Account_Sale->create(Object(SimpleXMLElement), Array)
#8 /web/cloud/includes/controller/Master.class.php(52): controller_Master::_callCRUDControl(Object(controller_control_Account_Sale), 'create', NULL, Object(RestRequest))
#9 /web/cloud/includes/api/entry_point.php(117): controller_Master::dispatch(Object(RestRequest), Object(Badge))
#10 /web/cloud/www/API/index.php(3): include('/web/cloud/incl...')
#11 {main}
    [errorClass] => OutOfBalanceError
    [balance] => 8.87
    [saleID] => 35377
)

marshall...@lightspeedretail.com

unread,
Jul 10, 2014, 11:56:59 AM7/10/14
to merchantos-a...@googlegroups.com
Stefan,

Please check and make sure your PaymentTypeID is correct.  I just ran your XML on my end changing the customerID, employeeID, and itemID to match mine and it went through no problem.  It appears as though there isn't a paymentTypeID of 1 or the Item 13248 has Tax on it and that's why you are getting a balance of 8.87 after applying the Payment of $99.00.  Let me know the outcome please.

Thanks,
Marshall


On Thursday, July 10, 2014 9:53:56 AM UTC-4, Stefan wrote:
Hi,

Unfortunately my sales import isn't working anymore. I only added a customerID in the code. Before it was working.
Could anyone please help me? Any insights would be appreciated.

Thank you so much,
Stefan


Here is my code:

2014-07-10T13:06:05+00:00 ALERT (1): Export Order::output
2014-07-10T13:06:05+00:00 ALERT (1): <?xml version="1.0"?>
<Sale><completed>true</completed><customerID>9409</customerID><employeeID>2</employeeID><registerID>1</registerID><shopID>1</shopID><taxCategoryID>0</taxCategoryID><ShipTo><shipped>false</shipped><timeStamp>2014-07-10 13:04:16</timeStamp><firstName>Stefan</firstName><lastName>Belter</lastName><company></company><Contact><noEmail>true</noEmail><noPhone>true</noPhone><noMail>true</noMail><Addresses><ContactAddress><address1>Broadway</address1><address2></address2><city>NYC</city><state>NJ</state><zip>07030</zip><country>United States</country></ContactAddress></Addresses><Phones><ContactPhone><number>123456789</number></ContactPhone></Phones><Emails><ContactEmail><address>stefan@gmail.com</address></ContactEmail></Emails></Contact></ShipTo><SaleLines><SaleLine><unitPrice>99.9900</unitPrice><unitQuantity>1.0000</unitQuantity><itemID>13248</itemID></SaleLine></SaleLines><SalePayments><SalePayment><amount>99.99</amount><paymentTypeID>1</paymentTypeID></SalePayment></SalePayments></Sale>

Stefan

unread,
Jul 11, 2014, 6:11:38 AM7/11/14
to merchantos-a...@googlegroups.com
Hi Marshall,

Thank you so much for your fast reply and help. I tested your advice and figured out that the IDs/SKUs in Magento and Lightspeed don't match (anymore). I assume that is causing the issue because Lightspeed doesn't know which product was sold - or in my case the price/product is different. Product ID 13248 in Magento is a different product (and another price) in Lightspeed.

So I need to fix that.

Thanks.

Best
Stefan


On Thursday, July 10, 2014 3:53:56 PM UTC+2, Stefan wrote:
Hi,

Unfortunately my sales import isn't working anymore. I only added a customerID in the code. Before it was working.
Could anyone please help me? Any insights would be appreciated.

Thank you so much,
Stefan


Here is my code:

2014-07-10T13:06:05+00:00 ALERT (1): Export Order::output
2014-07-10T13:06:05+00:00 ALERT (1): <?xml version="1.0"?>
<Sale><completed>true</completed><customerID>9409</customerID><employeeID>2</employeeID><registerID>1</registerID><shopID>1</shopID><taxCategoryID>0</taxCategoryID><ShipTo><shipped>false</shipped><timeStamp>2014-07-10 13:04:16</timeStamp><firstName>Stefan</firstName><lastName>Belter</lastName><company></company><Contact><noEmail>true</noEmail><noPhone>true</noPhone><noMail>true</noMail><Addresses><ContactAddress><address1>Broadway</address1><address2></address2><city>NYC</city><state>NJ</state><zip>07030</zip><country>United States</country></ContactAddress></Addresses><Phones><ContactPhone><number>123456789</number></ContactPhone></Phones><Emails><ContactEmail><address>stefan@gmail.com</address></ContactEmail></Emails></Contact></ShipTo><SaleLines><SaleLine><unitPrice>99.9900</unitPrice><unitQuantity>1.0000</unitQuantity><itemID>13248</itemID></SaleLine></SaleLines><SalePayments><SalePayment><amount>99.99</amount><paymentTypeID>1</paymentTypeID></SalePayment></SalePayments></Sale>
Reply all
Reply to author
Forward
0 new messages