Jump to content

Odd error message when trying to create a ledger_account


 Share

Recommended Posts

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...