This question has been flagged
4 Replies
2668 Views

I am trying to create an invoice using API. When I try to send the quantity with order items, the API issues an error saying

"Cannot create an unbalanced journal entry. Ids : [291] Difference Debit-Credit : [36]"

I tried sending manual values for "Debit" and "Credit" as well.

Not sure which setting I am missing or what I am doing wrong. I am using PHP API to create the invoices.

Avatar
Discard
Author

@Paresh Wagh,

Thanks for your suggestion. I tried with values of debit and credit value. but it still shows the same error.

When without quantity. invoice line uses the quantity 1 by default.

Author Best Answer

@Presh Wagh,
Thanks For your response.
Actually the main issue is that. when I am trying to add move.line in the move(Invoice) with the quantity. then it throws the error "Cannot create an unbalanced journal entry. Ids : [291] Difference Debit-Credit : [36]".
If I don't pass the quantity then it creates the move with the move.line for the order. 


Avatar
Discard

The error means that your debit and credit amounts are not equal. The reason it does not raise an error without the quantity is because both amounts will be 0 if the quantity is zero. As mentioned earlier, check the default Account Receivable account for the Customer used on that Order. You may also want to check whether the Accounts Payable account has been configured on the Product/Product Category.

Best Answer

Check whether the Account Receivable account has been defined in Accounting Entries for the customer by going to Accounting(or Invoicing) > Customers > Customers and going to the Accounting tab.

Avatar
Discard