API reponses with incorrect category for bank_transaction_explanations

Hi,

Has anyone else found that sometimes the API response with a random category for some bank_transaction_explanations?

I’ve just added a Billing for Legal and Professional Fees but the API somehow think it should be a Trade Creditors instead.

curl --location --request GET 'https://api.sandbox.freeagent.com/v2/bank_transaction_explanations?bank_account=https://api.sandbox.freeagent.com/v2/bank_accounts/5925&from_date=2022-01-01&to_date=2022-12-31' --header 'Authorization: Bearer XXXXXX'
{
    "bank_transaction_explanations": [
        ...,
        {
            "bank_account": "https://api.sandbox.freeagent.com/v2/bank_accounts/5925",
            "category": "https://api.sandbox.freeagent.com/v2/categories/796",
            "dated_on": "2022-03-16",
            "description": "Bill payment against 01123 (Thomson Ltd)",
            "transaction_description": "///£356.00",
            "gross_value": "-356.0",
            "foreign_currency_value": "0.0",
            "transfer_value": "356.0",
            "type": "Bill Payment",
            "is_money_in": false,
            "is_money_out": true,
            "is_money_paid_to_user": false,
            "paid_bill": "https://api.sandbox.freeagent.com/v2/bills/104670",
            "url": "https://api.sandbox.freeagent.com/v2/bank_transaction_explanations/583610",
            "bank_transaction": "https://api.sandbox.freeagent.com/v2/bank_transactions/712085",
            "updated_at": "2022-03-16T17:25:04.000Z",
            "detail": "Legal and Professional Fees ",
            "is_deletable": true,
            "is_locked": false,
            "marked_for_review": false,
            "has_pending_operation": false
        }
    ]
}
curl --location --request GET 'https://api.sandbox.freeagent.com/v2/categories/796'  --header 'Authorization: Bearer XXXX'
{
    "general_categories": {
        "url": "https://api.sandbox.freeagent.com/v2/categories/796",
        "description": "Trade Creditors",
        "nominal_code": "796",
        "tax_reporting_name": "Creditors"
    }
}

Am I missing something here? I can’t find any reason why FreeAgent itself report the correct category but the API have decided to change the category.

Any help is appreciated.

Hi Praveen :wave:

My name is Katie, I’m one of the Support Engineers here at FreeAgent. Thank you very much for your post, hopefully I can help!

The behaviour you have identified here is expected behaviour for bank_transaction_explanations, as bill payments are first and foremost a Trade Creditor (your company is paying money to someone you owe money to). This will be the category for any transaction that is involved in paying bills.

You can still see the name of the category you assigned to your bill under the detail attribute. You can also access this category by looking at the bill_items on the bill in question. Using the paid_bill attribute on the bank_transaction_explanation will give you the end point for that particular bill.

I hope this helps!

Kind regards,
Katie

Hi Katie,

Thanks for getting back to me. I’ve used the detail attribute to match as I keep getting 429 Too Many Requests error when I add more API calls to the mix.

On a side note, if you know how I can get an increase on the API rate limit, please let me know. We can’t even load a week’s worth of data because of it.

Thanks for your help,
Praveen

Hi Praveen,

I’m glad I could help you out with getting the category through for your bills!

Regarding the rate limits, unfortunately there’s no way to increase the rate limit - the limit is the same for all users of the API. In order to bring through all the information you need within the request, you will need to configure your request to handle this error, spreading out your calls so that you don’t go over the limit. We have some information in our documentation about our rate limits, what information is returned to you from the error, and a way to test out your handling of the rate limits. You can find that information here

I hope this helps!
Katie