Get Single Bill
curl -L -X GET 'https://api.freshbooks.com/accounting/account/<accountId>/bills/bills/<billId>' \
-H 'Authorization: Bearer <insert-bearer-token>'
{
"response":{
"result":{
"bill":{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"attachment":null,
"bill_number":"BN101",
"bill_payments":[
],
"created_at":"2021-01-28 15:06:32",
"currency_code":"EUR",
"due_date":"2021-02-27",
"due_offset_days":30,
"id":1141,
"issue_date":"2021-01-28",
"language":"en",
"lines":[
{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"category":{
"category":"Equipment",
"categoryid":3696445,
"created_at":"2020-12-01 08:16:47",
"id":3696445,
"is_cogs":false,
"is_editable":false,
"parentid":3696439,
"updated_at":"2020-12-01 08:16:47",
"vis_state":0
},
"description":"Raw material",
"id":2621,
"list_index":1,
"quantity":"15",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"unit_cost":{
"amount":"100.00",
"code":"EUR"
}
}
],
"outstanding":{
"amount":"1500.00",
"code":"EUR"
},
"overall_category":"Equipment",
"overall_description":"Raw material",
"paid":{
"amount":"0.00",
"code":"EUR"
},
"status":"unpaid",
"tax_amount":{
"amount":"0.00",
"code":"EUR"
},
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"updated_at":"2021-01-28 15:06:53",
"vis_state":0
}
}
}
}
Get Bills
curl -L -X GET 'https://api.freshbooks.com/accounting/account/<accountId>/bills/bills/' \
-H 'Authorization: Bearer <insert-bearer-token>'
{
"response":{
"result":{
"bills":[
{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"attachment":null,
"bill_number":"BN101",
"bill_payments":[
],
"created_at":"2021-01-28 15:06:32",
"currency_code":"EUR",
"due_date":"2021-02-27",
"due_offset_days":30,
"id":1141,
"issue_date":"2021-01-28",
"language":"en",
"lines":[
{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"category":{
"category":"Equipment",
"categoryid":3696445,
"created_at":"2020-12-01 08:16:47",
"id":3696445,
"is_cogs":false,
"is_editable":false,
"parentid":3696439,
"updated_at":"2020-12-01 08:16:47",
"vis_state":0
},
"description":"Raw material",
"id":2621,
"list_index":1,
"quantity":"15",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"unit_cost":{
"amount":"100.00",
"code":"EUR"
}
}
],
"outstanding":{
"amount":"1500.00",
"code":"EUR"
},
"overall_category":"Equipment",
"overall_description":"Raw material",
"paid":{
"amount":"0.00",
"code":"EUR"
},
"status":"unpaid",
"tax_amount":{
"amount":"0.00",
"code":"EUR"
},
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"updated_at":"2021-01-28 15:06:53",
"vis_state":0
}
],
"page":1,
"pages":4,
"per_page":1,
"total":4
}
}
}
Create a Bill
curl -L -X POST 'https://api.freshbooks.com/accounting/account/<accountId>/bills/bills' \
-H 'Authorization: Bearer <insert-bearer-token>' \
-H 'Content-Type: application/json' \
--data-raw '{
"bill": {
"vendorid": "1562",
"bill_number": null,
"issue_date": "2021-06-16",
"due_offset_days": 30,
"currency_code": "USD",
"language": "en",
"lines": [
{
"tax_percent1": 6,
"tax_percent2": null,
"unit_cost": {
"amount": "600",
"code": "USD"
},
"description": "Volkoren Brood",
"tax_name1": "GST1",
"quantity": 40,
"tax_name2": null,
"compounded_tax": false,
"categoryid": "3696397"
}
],
"attachment": null
}
}'
{
"response":{
"result":{
"bill":{
"amount":{
"amount":"375.00",
"code":"USD"
},
"attachment":null,
"bill_number":null,
"bill_payments":[
],
"created_at":"2020-10-09 15:28:49",
"currency_code":"USD",
"due_date":"2020-11-17",
"due_offset_days":39,
"id":7,
"issue_date":"2020-10-09",
"language":"en",
"lines":[
{
"amount":{
"amount":"125.00",
"code":"USD"
},
"category":{
"category":"Office Expenses & Postage",
"categoryid":65773,
"created_at":"2016-11-17 14:22:35",
"id":65773,
"is_cogs":false,
"is_editable":false,
"parentid":null,
"updated_at":"2016-11-17 14:22:35",
"vis_state":0
},
"description":"Malm Side Table",
"id":13,
"list_index":1,
"quantity":"1",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"125.00",
"code":"USD"
},
"unit_cost":{
"amount":"125.00",
"code":"USD"
}
},
{
"amount":{
"amount":"250.00",
"code":"USD"
},
"category":{
"category":"Office Expenses & Postage",
"categoryid":65773,
"created_at":"2016-11-17 14:22:35",
"id":65773,
"is_cogs":false,
"is_editable":false,
"parentid":null,
"updated_at":"2016-11-17 14:22:35",
"vis_state":0
},
"description":"Malm Book Shelf",
"id":15,
"list_index":2,
"quantity":"1",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"250.00",
"code":"USD"
},
"unit_cost":{
"amount":"250.00",
"code":"USD"
}
}
],
"outstanding":{
"amount":"375.00",
"code":"USD"
},
"overall_category":"Office Expenses & Postage",
"overall_description":"Malm Side Table",
"paid":{
"amount":"0.00",
"code":"USD"
},
"status":"unpaid",
"tax_amount":{
"amount":"0.00",
"code":"USD"
},
"total_amount":{
"amount":"375.00",
"code":"USD"
},
"updated_at":"2020-10-09 15:28:49",
"vis_state":0
}
}
}
}
Delete Bill
curl -L -X PUT 'https://api.freshbooks.com/accounting/account/<accountId>/bills/bills/<billId>' \
-H 'Authorization: Bearer <insert-bearer-token>' \
-H 'Content-Type: application/json' \
--data-raw '{
"bill": {
"vis_state": 1
}
}'
{
"response": {
"result": {
"bill": {
"amount": {
"amount": "1500.00",
"code": "EUR"
},
"attachment": null,
"bill_number": "BN101",
"bill_payments": [],
"created_at": "2021-01-28 15:06:32",
"currency_code": "EUR",
"due_date": "2021-02-27",
"due_offset_days": 30,
"id": 1141,
"issue_date": "2021-01-28",
"language": "en",
"lines": [
{
"amount": {
"amount": "1500.00",
"code": "EUR"
},
"category": {
"category": "Equipment",
"categoryid": 3696445,
"created_at": "2020-12-01 08:16:47",
"id": 3696445,
"is_cogs": false,
"is_editable": false,
"parentid": 3696439,
"updated_at": "2020-12-01 08:16:47",
"vis_state": 0
},
"description": "Raw material",
"id": 2621,
"list_index": 1,
"quantity": "15",
"tax_amount1": null,
"tax_amount2": null,
"tax_authorityid1": null,
"tax_authorityid2": null,
"tax_name1": null,
"tax_name2": null,
"tax_percent1": null,
"tax_percent2": null,
"total_amount": {
"amount": "1500.00",
"code": "EUR"
},
"unit_cost": {
"amount": "100.00",
"code": "EUR"
}
}
],
"outstanding": {
"amount": "1500.00",
"code": "EUR"
},
"overall_category": "Equipment",
"overall_description": "Raw material",
"paid": {
"amount": "0.00",
"code": "EUR"
},
"status": "overdue",
"tax_amount": {
"amount": "0.00",
"code": "EUR"
},
"total_amount": {
"amount": "1500.00",
"code": "EUR"
},
"updated_at": "2021-06-16 10:33:38",
"vis_state": 1
}
}
}
}
Archive Bill
curl -L -X PUT 'https://api.freshbooks.com/accounting/account/<accountId>/bills/bills/<billId>' \
-H 'Authorization: Bearer <insert-bearer-token>' \
-H 'Content-Type: application/json' \
--data-raw '{
"bill": {
"vis_state": 2
}
}'
{
"response": {
"result": {
"bill": {
"amount": {
"amount": "1500.00",
"code": "EUR"
},
"attachment": null,
"bill_number": "BN101",
"bill_payments": [],
"created_at": "2021-01-28 15:06:32",
"currency_code": "EUR",
"due_date": "2021-02-27",
"due_offset_days": 30,
"id": 1141,
"issue_date": "2021-01-28",
"language": "en",
"lines": [
{
"amount": {
"amount": "1500.00",
"code": "EUR"
},
"category": {
"category": "Equipment",
"categoryid": 3696445,
"created_at": "2020-12-01 08:16:47",
"id": 3696445,
"is_cogs": false,
"is_editable": false,
"parentid": 3696439,
"updated_at": "2020-12-01 08:16:47",
"vis_state": 0
},
"description": "Raw material",
"id": 2621,
"list_index": 1,
"quantity": "15",
"tax_amount1": null,
"tax_amount2": null,
"tax_authorityid1": null,
"tax_authorityid2": null,
"tax_name1": null,
"tax_name2": null,
"tax_percent1": null,
"tax_percent2": null,
"total_amount": {
"amount": "1500.00",
"code": "EUR"
},
"unit_cost": {
"amount": "100.00",
"code": "EUR"
}
}
],
"outstanding": {
"amount": "1500.00",
"code": "EUR"
},
"overall_category": "Equipment",
"overall_description": "Raw material",
"paid": {
"amount": "0.00",
"code": "EUR"
},
"status": "overdue",
"tax_amount": {
"amount": "0.00",
"code": "EUR"
},
"total_amount": {
"amount": "1500.00",
"code": "EUR"
},
"updated_at": "2021-06-16 10:33:38",
"vis_state": 1
}
}
}
}
Get Bills
Request: GET "https://api.freshbooks.com/accounting/account/<accountid>/bills/bills"
url = "https://api.freshbooks.com/accounting/account/<accountid>/expenses/expenses/<id>"
headers = {'Authorization': 'Bearer <bearer token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
res = requests.get(url, data=None, headers=headers)
jsonData = res.json()
Response:
{
"response":{
"result":{
"bills":[
{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"attachment":null,
"bill_number":"BN101",
"bill_payments":[
],
"created_at":"2021-01-28 15:06:32",
"currency_code":"EUR",
"due_date":"2021-02-27",
"due_offset_days":30,
"id":1141,
"issue_date":"2021-01-28",
"language":"en",
"lines":[
{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"category":{
"category":"Equipment",
"categoryid":3696445,
"created_at":"2020-12-01 08:16:47",
"id":3696445,
"is_cogs":false,
"is_editable":false,
"parentid":3696439,
"updated_at":"2020-12-01 08:16:47",
"vis_state":0
},
"description":"Raw material",
"id":2621,
"list_index":1,
"quantity":"15",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"unit_cost":{
"amount":"100.00",
"code":"EUR"
}
}
],
"outstanding":{
"amount":"1500.00",
"code":"EUR"
},
"overall_category":"Equipment",
"overall_description":"Raw material",
"paid":{
"amount":"0.00",
"code":"EUR"
},
"status":"unpaid",
"tax_amount":{
"amount":"0.00",
"code":"EUR"
},
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"updated_at":"2021-01-28 15:06:53",
"vis_state":0
}
],
"page":1,
"pages":4,
"per_page":1,
"total":4
}
}
}
Add Bill from Vendor
Request: POST
"https://api.freshbooks.com/accounting/account/<accountid>/bills/bills"
url = "https://api.freshbooks.com/accounting/account/<accountid>/bills/bills"
headers = {'Authorization': 'Bearer <bearer token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
payload = {
"bill":{
"vendorid":"5",
"previous_vendor_id":null,
"bill_number":null,
"issue_date":"2020-10-09",
"due_offset_days":39,
"currency_code":"USD",
"language":"en",
"lines":[
{
"tax_percent1":null,
"tax_percent2":null,
"unit_cost":{
"amount":"125",
"code":"USD"
},
"description":"Malm Side Table",
"tax_name1":null,
"quantity":1,
"tax_name2":null,
"compounded_tax":false,
"categoryid":"65773"
},
{
"tax_percent1":null,
"tax_percent2":null,
"unit_cost":{
"amount":"250",
"code":"USD"
},
"description":"Malm Book Shelf",
"tax_name1":null,
"quantity":1,
"tax_name2":null,
"compounded_tax":false,
"categoryid":"65773"
}
],
"attachment":null
}
}
res = requests.post(url, data=json.dumps(payload), headers=headers)
Response:
{
"response":{
"result":{
"bill":{
"amount":{
"amount":"375.00",
"code":"USD"
},
"attachment":null,
"bill_number":null,
"bill_payments":[
],
"created_at":"2020-10-09 15:28:49",
"currency_code":"USD",
"due_date":"2020-11-17",
"due_offset_days":39,
"id":7,
"issue_date":"2020-10-09",
"language":"en",
"lines":[
{
"amount":{
"amount":"125.00",
"code":"USD"
},
"category":{
"category":"Office Expenses & Postage",
"categoryid":65773,
"created_at":"2016-11-17 14:22:35",
"id":65773,
"is_cogs":false,
"is_editable":false,
"parentid":null,
"updated_at":"2016-11-17 14:22:35",
"vis_state":0
},
"description":"Malm Side Table",
"id":13,
"list_index":1,
"quantity":"1",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"125.00",
"code":"USD"
},
"unit_cost":{
"amount":"125.00",
"code":"USD"
}
},
{
"amount":{
"amount":"250.00",
"code":"USD"
},
"category":{
"category":"Office Expenses & Postage",
"categoryid":65773,
"created_at":"2016-11-17 14:22:35",
"id":65773,
"is_cogs":false,
"is_editable":false,
"parentid":null,
"updated_at":"2016-11-17 14:22:35",
"vis_state":0
},
"description":"Malm Book Shelf",
"id":15,
"list_index":2,
"quantity":"1",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"250.00",
"code":"USD"
},
"unit_cost":{
"amount":"250.00",
"code":"USD"
}
}
],
"outstanding":{
"amount":"375.00",
"code":"USD"
},
"overall_category":"Office Expenses & Postage",
"overall_description":"Malm Side Table",
"paid":{
"amount":"0.00",
"code":"USD"
},
"status":"unpaid",
"tax_amount":{
"amount":"0.00",
"code":"USD"
},
"total_amount":{
"amount":"375.00",
"code":"USD"
},
"updated_at":"2020-10-09 15:28:49",
"vis_state":0
}
}
}
}
Delete Bill
Request: PUT
"https://api.freshbooks.com/accounting/account/<accountid>/bills/bills/<billid>"
url = "https://api.freshbooks.com/accounting/account/<accountid>/expenses/expenses/<id>"
headers = {'Authorization': 'Bearer <bearer token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
payload = {
"bill":{
"vis_state":1
}
}
res = requests.put(url, data=json.dumps(payload), headers=headers)
Response:
{
"response":{
"result":{
"bill":{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"attachment":null,
"bill_number":"BN101",
"bill_payments":[
],
"created_at":"2021-01-28 15:06:32",
"currency_code":"EUR",
"due_date":"2021-02-27",
"due_offset_days":30,
"id":1141,
"issue_date":"2021-01-28",
"language":"en",
"lines":[
{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"category":{
"category":"Equipment",
"categoryid":3696445,
"created_at":"2020-12-01 08:16:47",
"id":3696445,
"is_cogs":false,
"is_editable":false,
"parentid":3696439,
"updated_at":"2020-12-01 08:16:47",
"vis_state":0
},
"description":"Raw material",
"id":2621,
"list_index":1,
"quantity":"15",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"unit_cost":{
"amount":"100.00",
"code":"EUR"
}
}
],
"outstanding":{
"amount":"1500.00",
"code":"EUR"
},
"overall_category":"Equipment",
"overall_description":"Raw material",
"paid":{
"amount":"0.00",
"code":"EUR"
},
"status":"unpaid",
"tax_amount":{
"amount":"0.00",
"code":"EUR"
},
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"updated_at":"2021-02-02 19:09:08",
"vis_state":1
}
}
}
}
Archive Bill
Request: PUT
"https://api.freshbooks.com/accounting/account/<accountid>/bills/bills/<billid>"
url = "https://api.freshbooks.com/accounting/account/<accountid>/expenses/expenses/<id>"
headers = {'Authorization': 'Bearer <bearer token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
payload = {
"bill":{
"vis_state":2
}
}
res = requests.put(url, data=json.dumps(payload), headers=headers)
Response:
{
"response":{
"result":{
"bill":{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"attachment":null,
"bill_number":"BN101",
"bill_payments":[
],
"created_at":"2021-01-28 15:06:32",
"currency_code":"EUR",
"due_date":"2021-02-27",
"due_offset_days":30,
"id":1141,
"issue_date":"2021-01-28",
"language":"en",
"lines":[
{
"amount":{
"amount":"1500.00",
"code":"EUR"
},
"category":{
"category":"Equipment",
"categoryid":3696445,
"created_at":"2020-12-01 08:16:47",
"id":3696445,
"is_cogs":false,
"is_editable":false,
"parentid":3696439,
"updated_at":"2020-12-01 08:16:47",
"vis_state":0
},
"description":"Raw material",
"id":2621,
"list_index":1,
"quantity":"15",
"tax_amount1":null,
"tax_amount2":null,
"tax_authorityid1":null,
"tax_authorityid2":null,
"tax_name1":null,
"tax_name2":null,
"tax_percent1":null,
"tax_percent2":null,
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"unit_cost":{
"amount":"100.00",
"code":"EUR"
}
}
],
"outstanding":{
"amount":"1500.00",
"code":"EUR"
},
"overall_category":"Equipment",
"overall_description":"Raw material",
"paid":{
"amount":"0.00",
"code":"EUR"
},
"status":"unpaid",
"tax_amount":{
"amount":"0.00",
"code":"EUR"
},
"total_amount":{
"amount":"1500.00",
"code":"EUR"
},
"updated_at":"2021-02-02 19:09:08",
"vis_state":2
}
}
}
}