Posting journals with capital_asset_type

Hi - We are trying to use the FreeAgent APIs to post journals into FreeAgent, we are struggling slightly with the accounts that contain sub-codes. We are struggling to create entries for accounts that require them.

For example code 601-1 requires we sent a jounral with the capital_asset_type property pointing to the URL of the relevant asset type.

Whilst the trial balances display the relevant infomation to know which sub-account ties to which asset type:
{“category”: "://api.freeagent.com/v2/categories/601",

“nominal_code”: “601-565697”,

“display_nominal_code”: “601-1”,

“name”: “Bank Account: Business Current Account”,

“total”: “75290.84”,

“bank_account”: "://api.freeagent.com/v2/capital_asset_types/565697"}

Hitting the categories end point does not:

{
“url”: ://api.freeagent.com/v2/categories/601-1,
“description”: “Some description”,
“nominal_code”: “601-1”,
“tax_reporting_name”: “Reporting name”
}
NB - i had to remove part of the URLs as there was a restriction on me posting the URLs

At the moment we can only tell which categories required an additional identifier (capital_asset_types) by finding it in the documentation so we are keeping our own list of relevant categories. Where any changes are made to the sub-accounts we wouldn’t have a way to detect programmatically that it requires a capital asset type identify.

Is there anything that we are missing that would allow us to pick up the accounts along with the relevant sub-accounts (capital_asset_types) so that when we are posting journals we can identify the available sub-accounts and allow for these to be specified in journal postings.

Hi Siobhan,

Welcome to our API Forum! :wave: My name is Katie, I’m one of the engineers here at FreeAgent.

We have a couple of endpoints which may help you out here:

  • List all categories has an option you can pass in (sub_accounts=true) which will provide you will all of the categories that include sub accounts.
  • List all capital assets can be used to return all the available capital asset types.

You might need to do a bit of mapping between these two end points, but these should be able to get you the information you require as described above.

I hope this helps!

Kind regards,
Katie

Hi Katie,

If we use the list all categories end point that you suggest, we get a list of all the account codes including the sub-account, an example of one is:

{
“url”: https://api.freeagent.com/v2/categories/601-4,
“description”: “Other Capital Asset Brought Forward”,
“nominal_code”: “601-4”,
“tax_reporting_name”: “Fixed assets brought forward”
},

So if our users decide they would like to post a journal to this account, we need to establish the related capital asset reference so that we can include this in the journal posting. Using the List all capital assets API you suggest, gives us the available capital assets:

{
“capital_asset_types”: [
{
“url”: “https://api.freeagent.com/v2/capital_asset_types/1446369”,
“name”: “Computer Equipment”,
“system_default”: true,
“created_at”: “2019-11-28T12:02:08.000Z”,

        "updated_at": "2019-11-28T12:02:08.000Z"
    },
    {
        "url": "https://api.freeagent.com/v2/capital_asset_types/1446496",
        "name": "Fixtures and Fittings",
        "system_default": true,
        "created_at": "2019-11-28T12:02:09.000Z",
        "updated_at": "2019-11-28T12:02:09.000Z"
    },
    {
        "url": "https://api.freeagent.com/v2/capital_asset_types/1446623",
        "name": "Motor Vehicles",
        "system_default": true,
        "created_at": "2019-11-28T12:02:09.000Z",
        "updated_at": "2019-11-28T12:02:09.000Z"
    },
    {
        "url": "https://api.freeagent.com/v2/capital_asset_types/1446750",
        "name": "Other Capital Asset",
        "system_default": true,
        "created_at": "2019-11-28T12:02:09.000Z",
        "updated_at": "2019-11-28T12:02:09.000Z"
    }
]

}

but I can’t see how we identify which capital asset we require based on the code that the user will have selected to post to (in this case 601-4)?

Thank you
Siobhan

Hi Siobhan,

Thanks for explaining what you’re aiming to achieve a little further for me.

I don’t think it’s possible to identify which capital assets are required for a category at the moment using our API. I will raise this as a feature request, so that the relevant team can look into it and potentially implement this functionality.

Thanks again,
Katie