Sales Invoice Payments Not Being Recognized When Using FrappeClient APIs (Python)

While it took me two days to get sorted out, I got the Sales Invoice API to work (if you are struggling with this, dowload the frappe-client library, swap out StringIO for io and save yourself some headache).

I’m submitting payment invoices successfully, but the payment information is not being recognized. Can anyone either:

  1. Recommend a modification to the JSON below, or
  2. Point me to the source code so I can see the logic for validating payment entries upon submission of Sales Invoices.

JSON Is here:

{"doctype":"Sales Invoice", 
 "company":"AnyCompany USA",
"selling_price_list":"Standard Selling",
"debit_to":"Debtors - DFL",
"customer":"BroomHilda Co",

[{"doctype":"Sales Invoice Item",
"income_account":"Sales - DFL",
"cost_center":"Main - DFL",
"warehouse":"Finished Goods - DFL"}],

"account":"Cash - DFL",

Any guidance is much appreciated.

Mostly it is because you did not set “is_pos” to 1