Out of Balance Error

krutagnapurohitkrutagnapurohit Member Posts: 8

This is my POST Sale Request:

{

    "employeeID": 1,

    "registerID": 1,

    "shopID": 1,

    "completeTime": "2021-03-29T16:24:00.8771193Z",

    "customerID": 0,

    "completed": true,

    "referenceNumber": "1617033777486",

    "referenceNumberSource": "",

    "SaleLines": {

        "SaleLine": [

            {

                "itemID": 10,

                "unitQuantity": 1,

                "unitPrice": 4.69

            },

            {

                "itemID": 4,

                "unitQuantity": 4,

                "unitPrice": 3.00

            }

        ]

    },

    "SalePayments": {

        "SalePayment": [

            {

                "amount": 16.69,

                "paymentTypeID": "1"

            }

        ]

    }

}


And this is the response I get:


{

    "httpCode": "400",

    "httpMessage": "Bad Request",

    "message": "Cannot complete an out of balance sale. Payments are insufficient.",

    "errorClass": "OutOfBalanceError",

    "saleID": "49",

    "balance": "0.83"

}


I have opened a register. Added funds. But still it gives me this error.


Also, if the sale is failing, it creates a "in progress" sale on the website. So, if I have made 10 requests, it creates 10 in progress sale on the Sale History page.


Tags:

1 comment

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 991 moderator

    Hi @krutagnapurohit,

    Thank you for contacting us.

    Like the error message is saying "OutOfBalanceError" this means that the amount of the SalePayment you gave in is less than the total amount of the products.

    "SalePayment": [
    
                {
    
                    "amount": 16.69, 
    
                    "paymentTypeID": "1"
    
                }
    
            ]
    

    Your response is saying:

     "balance": "0.83"
    

    If you do 16.69 + 0.83 = 17.52 which is also the total what I see in the UI.

    I guess you forgot to calculate the tax.

    I hope this helps.

Sign In or Register to comment.