Matt Bradley Posted April 6, 2022 Share Posted April 6, 2022 When I send the the following to create a ledger account: { ledger_account_type_id: 'expenses' , included_in_chart: true , name: 'Example' , display_name: 'Example' , nominal_code: '20001' } or { ledger_account_type_id: 'other_purchases' , included_in_chart: true , name: 'Example' , display_name: 'Example' , nominal_code: '20001' } The API give the following error: "Couldn't find record." Whereas, if I send: { ledger_account_type_id: 'sales' , included_in_chart: true , name: 'Example' , display_name: 'Example' , nominal_code: '20001' } This creates a new ledger account. Obviously, the problem is with the ledger_account_type_id, but the error is rather cryptic. Any suggestions welcome! Link to comment Share on other sites More sharing options...
Steel, Mark Posted April 7, 2022 Share Posted April 7, 2022 Hi Matt, thank you for your question. Thanks for bringing this to our attention, it looks as if the error message detail should be stating that ledger_account_type_id is invalid. This value needs to be a valid ledger_account_type_id. The below is a response from the ledger_account_types API. You can see SALES is a valid id but other_purchases is not. Try using DIRECT_EXPENSES in lieu of other_purchases. { "$total": 13, "$page": 1, "$next": null, "$back": null, "$itemsPerPage": 20, "$items": [ { "id": "SALES", "displayed_as": "Sales", "$path": "/ledger_account_types/SALES" }, { "id": "OTHER_INCOME", "displayed_as": "Other Income", "$path": "/ledger_account_types/OTHER_INCOME" }, { "id": "DIRECT_EXPENSES", "displayed_as": "Direct Expenses", "$path": "/ledger_account_types/DIRECT_EXPENSES" }, { "id": "OVERHEADS", "displayed_as": "Overheads", "$path": "/ledger_account_types/OVERHEADS" }, { "id": "DEPRECIATION", "displayed_as": "Depreciation", "$path": "/ledger_account_types/DEPRECIATION" }, { "id": "CURRENT_ASSETS", "displayed_as": "Current Assets", "$path": "/ledger_account_types/CURRENT_ASSETS" }, { "id": "FIXED_ASSETS", "displayed_as": "Fixed Assets", "$path": "/ledger_account_types/FIXED_ASSETS" }, { "id": "FUTURE_ASSETS", "displayed_as": "Future Assets", "$path": "/ledger_account_types/FUTURE_ASSETS" }, { "id": "BANK", "displayed_as": "Bank", "$path": "/ledger_account_types/BANK" }, { "id": "CURRENT_LIABILITY", "displayed_as": "Current Liability", "$path": "/ledger_account_types/CURRENT_LIABILITY" }, { "id": "FUTURE_LIABILITY", "displayed_as": "Future Liability", "$path": "/ledger_account_types/FUTURE_LIABILITY" }, { "id": "EQUITY", "displayed_as": "Equity", "$path": "/ledger_account_types/EQUITY" }, { "id": "LINE_OF_CREDIT", "displayed_as": "Credit Card / Loan", "$path": "/ledger_account_types/LINE_OF_CREDIT" } ] } Thanks Mark Link to comment Share on other sites More sharing options...
Vidyut Greens Posted September 15, 2022 Share Posted September 15, 2022 Loan id is invalid, you may need to replace other_purchases with DIRECT_EXPENSES Link to comment Share on other sites More sharing options...
Steel, Mark Posted September 15, 2022 Share Posted September 15, 2022 Hi Vidyut, Are you asking if DIRECT_EXPENSES is a valid replacement for a Loan account? A loan is generally a CURRENT_LIABILITY on the balance sheet. You can create a bank_account with its type id set to loan which may be a better option?bank_account_types { "id": "CHECKING", "displayed_as": "Current", "$path": "/bank_account_types/CHECKING" }, { "id": "SAVINGS", "displayed_as": "Savings", "$path": "/bank_account_types/SAVINGS" }, { "id": "CREDIT_CARD", "displayed_as": "Credit Card", "$path": "/bank_account_types/CREDIT_CARD" }, { "id": "CASH_IN_HAND", "displayed_as": "Cash in Hand", "$path": "/bank_account_types/CASH_IN_HAND" }, { "id": "LOAN", "displayed_as": "Loan", "$path": "/bank_account_types/LOAN" }, { "id": "OTHER", "displayed_as": "Other", "$path": "/bank_account_types/OTHER" } Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now