Bill Payments (beta)
Bill Payments are a record of the payments made on a Bill.
Access Requirements
Access | Requires Authorization |
Scopes | user:bill_payments:read |
Field Descriptions
underlined fields are required on creation
Field New Descriptions
Field | Type | Description |
---|---|---|
id | integer | uniquely identifies the payment associated with the business. |
amount | object | subfields: amount and code |
– amount | string | amount paid to the bill |
– code | string | three-letter currency code |
billid | integer | id of the bill to create the payment for |
matched_with_expense | boolean | internal use. If the Bill has been reconciled with a bank-imported expense. |
paid_date | date | date the payment was made, YYYY-MM-DD format |
payment_type | string | “Check”, “Credit”, “Cash”, etc. |
note | string | notes on payment |
vis_state | integer | 0 for active, 1 for deleted, 2 for archived |
Add Payment to Bill
curl -L -X POST 'https://api.freshbooks.com/accounting/account/<accountId>/bill_payments/bill_payments' \ -H 'Authorization: Bearer <insert-bearer-token>' \ -H 'Content-Type: application/json' \ --data-raw '{ "bill_payment": { "billid": "1626", "amount": { "amount": "4000.00", "code": "USD" }, "payment_type": "Check", "paid_date": "2021-06-16", "note": "Test Payment via API" } }' #Response:
{ "response": { "result": { "bill_payment": { "amount": { "amount": "4000.00", "code": "USD" }, "billid": 1626, "id": 1490, "matched_with_expense": false, "note": "Test Payment via API", "paid_date": "2021-06-16", "payment_type": "Check", "vis_state": 0 } } } }
Edit Payment to Bill
curl -L -X PUT 'https://api.freshbooks.com/accounting/account/<accountId>/bill_payments/bill_payments/<billPaymentId>' \ -H 'Authorization: Bearer <insert-bearer-token>' \ -H 'Content-Type: application/json' \ --data-raw '{ "bill_payment": { "billid": "1626", "amount": { "amount": "23000", "code": "USD" }, "payment_type": "Cash", "paid_date": "2020-10-09", "note": "" } }' #Response:
{ "response": { "result": { "bill_payment": { "amount": { "amount": "23000.00", "code": "USD" }, "billid": 1626, "id": 1490, "matched_with_expense": false, "note": "", "paid_date": "2021-06-16", "payment_type": "Cash", "vis_state": 0 } } } }
List Bill Payments
curl -L -X GET 'https://api.freshbooks.com/accounting/account/<accountId>/bill_payments/bill_payments' \ -H 'Authorization: Bearer <insert-bearer-token>'
#Response:
{ "response": { "result": { "bill_payments": [ { "amount": { "amount": "23000.00", "code": "USD" }, "billid": 1626, "id": 1490, "matched_with_expense": false, "note": "", "paid_date": "2021-06-16", "payment_type": "Cash", "vis_state": 0 } ] } } }
Get A Bill Payment
curl -L -X GET 'https://api.freshbooks.com/accounting/account/<accountId>/bill_payments/bill_payments/<billPaymentId>' \ -H 'Authorization: Bearer <insert-bearer-token>'
#Response:
{ "response": { "result": { "bill_payment": { "amount": { "amount": "23000.00", "code": "USD" }, "billid": 1626, "id": 1490, "matched_with_expense": false, "note": "", "paid_date": "2021-06-16", "payment_type": "Cash", "vis_state": 0 } } } }
Delete A Bill Payment
curl -L -X PUT 'https://api.freshbooks.com/accounting/account/<accountId>/bill_payments/bill_payments/<billPaymentId>' \
-H 'Authorization: Bearer <insert-bearer-token>' \ -H 'Content-Type: application/json' \ --data-raw '{ "bill_payment
": { "vis_state": 1 } }'
Add Payment to Bill
Request: POST
https://api.freshbooks.com/accounting/account/<accountid>/bill_payments/bill_payments/<billid>
url = "https://api.freshbooks.com/accounting/account/<accountid>/bill_payments/bill_payments/<billid>"
headers = {'Authorization': 'Bearer <bearer token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
payload = {
"bill_payment":{
"billid":1141,
"amount":{
"amount":"100",
"code":"EUR"
},
"payment_type":"Check",
"paid_date":"2021-01-30",
"note":""
}
}
res = requests.post(url, data=json.dumps(payload), headers=headers)
Response:
{
"response":{
"result":{
"bill_payment":{
"amount":{
"amount":"100.00",
"code":"EUR"
},
"billid":1141,
"id":901,
"matched_with_expense":false,
"note":"",
"paid_date":"2021-01-30",
"payment_type":"Check",
"vis_state":0
}
}
}
}
Edit Payment to Bill
Request: PUT
https://api.freshbooks.com/accounting/account/<accountid>/bill_payments/bill_payments/<billpaymentid>
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_payment":{
"billid":1141,
"amount":{
"amount":"0",
"code":"EUR"
},
"payment_type":"Check",
"paid_date":"2021-01-30",
"note":"",
}
res = requests.put(url, data=json.dumps(payload), headers=headers)
Response:
{
"response":{
"result":{
"bill_payment":{
"amount":{
"amount":"0.00",
"code":"EUR"
},
"billid":1141,
"id":907,
"matched_with_expense":false,
"note":"",
"paid_date":"2021-01-30",
"payment_type":"Check",
"vis_state":0
}
}
}
}