# Marking bill as 'Paid' via API

**URL:** <https://api-discuss.freeagent.com/t/marking-bill-as-paid-via-api/2837>\
**Category:** Documentation\
**Created:** [5 April 2022 14:55 UTC](https://api-discuss.freeagent.com/t/marking-bill-as-paid-via-api/2837 "2022-04-05T14:55:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OM\_TIL](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/o/c6cbf5/32.png) [@OM\_TIL](https://api-discuss.freeagent.com/u/OM_TIL)\
**Post date:** [5 April 2022 14:55 UTC](https://api-discuss.freeagent.com/t/marking-bill-as-paid-via-api/2837/1 "2022-04-05T14:55:49Z")

</div>

Dear FreeAgent support,

Is it possible to mark a bill as paid via the api? I am looking to change the status to ‘Paid’ and also add a ‘paid\_on’ date. However, when I send the put request with the necessary json, these attributes do not seem to be editable. This is the json body I am sending over the API:

{  
“bill”: {  
“status”:“Paid”,  
“paid\_on”:“2022-04-05”,  
“paid\_value”:“1.0”,  
“bill\_items”: [  
{  
“url”:“[https://api.freeagent.com/v2/bill\_items/18543214](https://api.freeagent.com/v2/bill_items/18543214)”  
}  
]  
}  
}

Best wishes,

Ollie

---

<div class="post-metadata">

**Author:** ![Dominic\_FreeAgent](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/d/9d8465/32.png) [@Dominic\_FreeAgent](https://api-discuss.freeagent.com/u/Dominic_FreeAgent)\
**Post date:** [5 April 2022 15:14 UTC](https://api-discuss.freeagent.com/t/marking-bill-as-paid-via-api/2837/2 "2022-04-05T15:14:04Z")

</div>

Hi Ollie,

A bill needs a corresponding bank payment to be marked as paid, so normally you would need to link a transaction in the company’s bank accounts to the bill. It can’t be marked as paid without a payment recorded to balance it.

The usual way this happens is that [bank transactions](https://dev.freeagent.com/docs/bank_transactions) are imported into the [bank account](https://dev.freeagent.com/docs/bank_accounts) by the user [setting up an Open Banking feed](https://support.freeagent.com/hc/en-gb/articles/360006470520-How-to-enable-an-Open-Banking-bank-feed) in FreeAgent to import transactions from the bank. These can then be _explained_ by the user either [through the web interface](https://support.freeagent.com/hc/en-gb/articles/115001222804-Pay-a-single-bill) or using the API, which links and “pays” the bill.

Assuming the user has set up a bank feed and there’s a transaction for the bill payment, then as an API integrator, you can [create bank transaction explanations](https://dev.freeagent.com/docs/bank_transaction_explanations#create-a-bank-transaction-explanation) via the API using the `paid_bill` attribute set to the URL of the bill. This will explain and link the transaction to the bill, causing it to be marked as paid if the payment equals the bill value. The paid on date will also be filled in from the linked transaction.

Hope that helps.

Dominic

---

<div class="post-metadata">

**Author:** ![OM\_TIL](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/o/c6cbf5/32.png) [@OM\_TIL](https://api-discuss.freeagent.com/u/OM_TIL)\
**Post date:** [5 April 2022 15:54 UTC](https://api-discuss.freeagent.com/t/marking-bill-as-paid-via-api/2837/3 "2022-04-05T15:54:05Z")

</div>

Ok great thanks, that’s very helpful. I was thinking these steps were only necessary for invoices but clearly not!
