/categories endpoint doesn't list all categories

Hello,

I’ve noticed that when I use the categories API (https://api.freeagent.com/v2/categories?sub_accounts=true), it doesn’t return all categories available in the account. Specifically, the 900 range of Liabilities categories.

Below is a list of categories I get when I use the API request and a screenshot of the Liabilities section with 900 range that doesn’t appear on the response.

Request: GET https://api.sandbox.freeagent.com/v2/categories?sub_accounts=true

001 - Sales
285 - Accommodation and Meals
292 - Accountancy Fees
288 - Advertising and Promotion
363 - Bank/Finance Charges
359 - Books and Journals
335 - Business Entertaining
360 - Charitable Donations
278 - Childcare Vouchers
270 - Computer Hardware
269 - Computer Software
293 - Consultancy Fees
372 - Corporation Tax Penalty
294 - Formation Costs
364 - Insurance
362 - Interest Payable
273 - Internet & Telephone
291 - Leasing Payments
290 - Legal and Professional Fees
249 - Mileage
274 - Mobile Phone
283 - Motor Expenses
250 - Office Costs
271 - Office Equipment
272 - Other Computer Costs
373 - PAYE/NI Penalty
351 - Pension (Annuity)
350 - Pension (Personal/Stakeholder)
358 - Postage
276 - Printing
390 - Realized Currency Exchange Gain/Loss
251 - Rent
289 - Staff Entertaining
282 - Staff Training
277 - Stationery
361 - Subscriptions
280 - Sundries
365 - Travel
391 - Unrealized Currency Exchange Gain/Loss
366 - Use Of Home
371 - VAT Penalty
268 - Web Hosting
102 - Commission Paid
101 - Cost of Sales
104 - Equipment Hire
103 - Materials
150 - Subcontractor Costs
051 - Interest Received
055 - Flat Rate Scheme Surplus
056 - Refund of Other Tax Received
057 - PAYE/NI Online Filing Incentive Claimed
058 - Grant Income
401 - Salaries
402 - Employer NICs
403 - Staff Pensions
404 - Net Salary Expense
405 - PAYE/NI Expense
407 - Directors' Salaries
408 - Directors' Employer NICs
409 - Directors' Staff Pensions
450 - Bad Debts Written Off
460 - Depreciation Charge
461 - Loss/Gain on Disposal of Capital Asset
502 - Corporation Tax Expense
503 - Deferred Corporation Tax Expense
599 - Error
601-1 - Computer Equipment Brought Forward
601-2 - Fixtures and Fittings Brought Forward
601-3 - Motor Vehicles Brought Forward
601-4 - Other Capital Asset Brought Forward
602-1 - Computer Equipment Purchase
602-2 - Fixtures and Fittings Purchase
602-3 - Motor Vehicle Purchase
602-4 - Other Capital Asset Purchase
604-1 - Computer Equipment Disposal
604-2 - Fixtures and Fittings Disposal
604-3 - Motor Vehicles Disposal
604-4 - Other Capital Asset Disposal
605-1 - Computer Equipment Depreciation Brought Forward
605-2 - Fixtures and Fittings Depreciation Brought Forward
605-3 - Motor Vehicles Depreciation Brought Forward
605-4 - Other Capital Asset Depreciation Brought Forward
606-1 - Computer Equipment Depreciation In Year
606-2 - Fixtures and Fittings Depreciation In Year
606-3 - Motor Vehicles Depreciation In Year
606-4 - Other Capital Asset Depreciation
607-1 - Depreciation on Disposal of Computer Equipment
607-2 - Depreciation on Disposal of Fixtures and Fittings
607-3 - Depreciation on Disposal of Motor Vehicles
607-4 - Depreciation on Disposal of Other Capital Asset
610 - Stock Adjustment
620 - Prepayments
630 - Investments Brought Forward
631 - Investments Additions
632 - Investments Revaluations
633 - Investments Disposals
650 - Provisions of Liabilities
660 - Accruals
670 - Share Premium
681 - Trade Debtors
682 - Other Debtors
750-1 - Bank Account: Business Current Account
760 - Unpresented Items
761 - Bank Transfers in Progress
796 - Trade Creditors
797 - Other Creditors
798 - HP Liabilities < 1 Year
799 - HP Liabilities > 1 Year
813 - Pension Creditor
814 - PAYE/NI
815 - Other Payroll Deductions
817 - VAT
818 - VAT Reclaimed
819 - VAT Charged
820 - Corporation Tax
823 - Deferred VAT
824 - VAT Mini One Stop Shop
825 - Deferred Corporation Tax
900-1 - Smart User Payment: Praveen Premaratne
901-1 - Capital Account: Praveen Premaratne
902-1 - Salary and Bonuses: Praveen Premaratne
904-1 - Benefit in Kind: Praveen Premaratne
905-1 - Expense Account: Praveen Premaratne
907-1 - Director Loan Account: Praveen Premaratne
908-1 - Dividend: Praveen Premaratne
910-1 - Unpaid Shares: Praveen Premaratne
968 - Profit and Loss
998 - Contra Account
999 - Suspense Account

Does anyone know how I can get those categories? I’d like to avoid having to maintain a database of categories since users can create custom once and mine would likely to become out of date almost instantly.

Many thanks
Prav

Also, the bizzrre thing is I can’t find any of these categories in the Accounting Categories either. Looks like only shows on the API reponses not the web site.

Hello Praveen,

Thanks for reaching out to us.

To clarify you’re question, you are able to see a longer list of the responses via the API (the first image above), than you are in the web app (second image above). The missing areas are the sub-accounts of the 900 range in liabilities. Is that correct?

If so, I believe that this is because you may be looking in the wrong place in the web app. The screenshot above (image two), is the ‘Accounting Categories’ area of settings which is for managing the categories in FreeAgent.

If you’d like to see a list of all the categories in your account (known as the chart of accounts), by navigating to: Accounting > Reports > Trial Balance > Chart of Accounts CSV. Alternatively, the Show Transactions report displays all the categories with numerical values, sorted by account year if needed.

Please let me know if that helps you here.

Cheers

Stu McEwan
CS:API Product Manager

Hi Stu,

Thanks for getting back to me.

Not exactly, we’ve got a reporting app within our organisation and when I first wrote it; I used /v2/categories API to get all categories followed by calling the /v2/bank_transactions API to get all transactions and later sort the transactions into categories by their category URL.

However, for example, when pay expenses claim they are categorised on the transaction under 905 - Expense Account which doesn’t appear in the list of categories I get from the /v2/categories.

While I was investigating this, I came across the “Accounting Categories” which list the once I need (the 900 range) and wondered if I need to use some other API to get those categories listed under the “Liabilities” section.

I’m wondering if there’s a way for me to get these missing categories through the API?

Ps: thanks for the explanation on those sub-categories, they were showing up in the Show Transactions.

Thanks,
Prav

Hello Prav,

Thanks for your speedy response.

You’re correct in that when a bank transaction is assigned to a specific user, such as dividends or director’s loan account, we show, for example: v2/categories/905, rather than v2/categories/905-1. We recently added an addition to return sub_codes for expenses, and for the trial balance, but not for individual bank transactions.

This is something that we’ll look to add shortly. I’ll update you hear when we’ve done so.

Regards,
Stu McEwan
CS:API Product Manager

1 Like

Hi Stu,

Thanks for the reply and for looking up what caused the confusion.

Please do let me know if you guys make progress with this, in the meantime I’ll put a workaround to pull categories of the transactions instead

Thanks for the help again,
Prav