Using API to attach attachments to bills does not work

Once we have created a bill we want to attach an attachment using the PUT endpoint for bills.

This functionality stopped working yesterday.
We are posting the following body and it doesn’t work:

{
    "bill": 
     { 
            "attachment": 
            { 
                "data":"some binary data", 
                "content_type":"image/jpeg", 
                "file_name": "functional_test_attachment" 
            }  
       }
}

We get the following error:

{
    "errors": {
        "error": {
            "message": "Required parameter missing: bill"
        }
    }
}

In our investigation, the following body does work:

{
    "bill": 
    { 
        "property": "property"
        "attachment": 
        { 
            "data":"some binary data", 
            "content_type":"image/jpeg", 
            "file_name": "functional_test_attachment" 
        } 
    }
}

By adding any property to the body, even ones that don’t actually exist, the API accepts the attachment and we see it in the UI.

1 Like

Hi Nikita, Simon from FreeAgent here. Thank you for bringing this to our attention – this was a regression and we’ve now deployed a fix.

Thank you for addressing, we have confirmed the issue is resolved on our side.