Fetch bill
curl --request GET \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/bills/{billId} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
"business_id": "188eb399-f171-4849-861c-5c02d91f800b",
"external_id": "vendor-bill-123",
"status": "PARTIALLY_PAID",
"terms": "NET_30",
"received_at": "2024-06-01T10:11:57.184157Z",
"due_at": "2024-07-01T10:11:57.184158Z",
"paid_at": null,
"voided_at": null,
"reference_number": "VB-123",
"vendor": {
"id": "a4c38874-8c01-4986-b8d0-4f159a52dd39",
"external_id": "vendor-1",
"company_name": "Acme Supplies Inc.",
"email": "billing@acmesupplies.com",
"office_phone": "555-123-4567",
"address_string": "123 Vendor St, Supply City, CA 90210",
"notes": "Primary office supplies vendor",
"status": "ACTIVE"
},
"line_items": [
{
"id": "733de30f-db72-4d52-98c5-fe070d4433f7",
"external_id": "bill-line-item-1",
"bill_id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
"account_identifier": {
"type": "AccountId",
"id": "80b708b5-7b27-456c-9fb1-b8b918241908"
},
"ledger_account": {
"id": "80b708b5-7b27-456c-9fb1-b8b918241908",
"name": "Office Supplies",
"stable_name": "OFFICE_SUPPLIES",
"normality": "DEBIT",
"account_type": {
"value": "EXPENSE",
"display_name": "Expenses"
},
"account_subtype": {
"value": "OPERATING_EXPENSES",
"display_name": "Operating Expenses"
}
},
"description": "Monthly office supplies",
"product_name": "Paper reams",
"unit_price": 1500,
"quantity": "10.00",
"subtotal": 15000,
"discount_amount": 1000,
"sales_taxes_total": 1120,
"sales_taxes": [
{
"tax_account": {
"type": "Tax_Name",
"name": "CA_SALES_TAX"
},
"tax_ledger_account": {
"id": "c4007474-f604-4d57-9690-b7f40f7a1cee",
"name": "Sales tax: CA",
"stable_name": "SALES_TAXES:CA",
"normality": "DEBIT",
"account_type": {
"value": "EXPENSE",
"display_name": "Expenses"
},
"account_subtype": {
"value": "SALES_TAXES",
"display_name": "Sales Taxes"
}
},
"amount": 1120
}
],
"total_amount": 15120,
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "operations",
"dimension_display_name": "Department",
"value_display_name": "Operations",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
]
}
],
"subtotal": 15000,
"additional_sales_taxes": [],
"additional_sales_taxes_total": 0,
"total_amount": 15120,
"outstanding_balance": 5120,
"memo": "Memo for the office supplies purchase",
"payment_allocations": [
{
"id": "8901abcd-ef23-4567-8901-abcd12345678",
"bill_id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
"payment_id": "590ed436-c2bd-4e39-8047-f913a852f99c",
"amount": 10000,
"payment": {
"id": "590ed436-c2bd-4e39-8047-f913a852f99c",
"external_id": "bill-payment-1",
"paid_at": "2024-06-15T00:00:00Z",
"method": "ACH",
"amount": 10000,
"processor": "BANK_TRANSFER",
"imported_at": "2024-06-15T18:11:57.339076Z",
"allocations": [
{
"id": "8901abcd-ef23-4567-8901-abcd12345678",
"bill_id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
"payment_id": "590ed436-c2bd-4e39-8047-f913a852f99c",
"amount": 10000,
"transaction_tags": []
}
],
"transaction_tags": [],
"memo": "First partial payment",
"metadata": {},
"reference_number": "PAY-1001"
},
"transaction_tags": [],
"memo": "Allocated to June office supplies bill",
"metadata": {},
"reference_number": "ALLOC-1001"
}
],
"vendor_credits": [],
"imported_at": "2024-06-01T10:11:57.184157Z",
"updated_at": "2024-06-15T18:11:57.339076Z",
"transaction_tags": [],
"metadata": {}
}
}Expenses
Fetch expense
Returns the bill associated with the provided bill id. A bill represents an invoice or purchase order a business has received from a vendor for goods or services, and is used to track purchases and accounts payable in Layer.
GET
/
v1
/
businesses
/
{businessId}
/
bills
/
{billId}
Fetch bill
curl --request GET \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/bills/{billId} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
"business_id": "188eb399-f171-4849-861c-5c02d91f800b",
"external_id": "vendor-bill-123",
"status": "PARTIALLY_PAID",
"terms": "NET_30",
"received_at": "2024-06-01T10:11:57.184157Z",
"due_at": "2024-07-01T10:11:57.184158Z",
"paid_at": null,
"voided_at": null,
"reference_number": "VB-123",
"vendor": {
"id": "a4c38874-8c01-4986-b8d0-4f159a52dd39",
"external_id": "vendor-1",
"company_name": "Acme Supplies Inc.",
"email": "billing@acmesupplies.com",
"office_phone": "555-123-4567",
"address_string": "123 Vendor St, Supply City, CA 90210",
"notes": "Primary office supplies vendor",
"status": "ACTIVE"
},
"line_items": [
{
"id": "733de30f-db72-4d52-98c5-fe070d4433f7",
"external_id": "bill-line-item-1",
"bill_id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
"account_identifier": {
"type": "AccountId",
"id": "80b708b5-7b27-456c-9fb1-b8b918241908"
},
"ledger_account": {
"id": "80b708b5-7b27-456c-9fb1-b8b918241908",
"name": "Office Supplies",
"stable_name": "OFFICE_SUPPLIES",
"normality": "DEBIT",
"account_type": {
"value": "EXPENSE",
"display_name": "Expenses"
},
"account_subtype": {
"value": "OPERATING_EXPENSES",
"display_name": "Operating Expenses"
}
},
"description": "Monthly office supplies",
"product_name": "Paper reams",
"unit_price": 1500,
"quantity": "10.00",
"subtotal": 15000,
"discount_amount": 1000,
"sales_taxes_total": 1120,
"sales_taxes": [
{
"tax_account": {
"type": "Tax_Name",
"name": "CA_SALES_TAX"
},
"tax_ledger_account": {
"id": "c4007474-f604-4d57-9690-b7f40f7a1cee",
"name": "Sales tax: CA",
"stable_name": "SALES_TAXES:CA",
"normality": "DEBIT",
"account_type": {
"value": "EXPENSE",
"display_name": "Expenses"
},
"account_subtype": {
"value": "SALES_TAXES",
"display_name": "Sales Taxes"
}
},
"amount": 1120
}
],
"total_amount": 15120,
"transaction_tags": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"key": "department",
"value": "operations",
"dimension_display_name": "Department",
"value_display_name": "Operations",
"dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"created_at": "2024-02-27T02:16:40.389772Z",
"updated_at": "2024-02-27T02:16:40.389772Z",
"deleted_at": null,
"archived_at": null
}
]
}
],
"subtotal": 15000,
"additional_sales_taxes": [],
"additional_sales_taxes_total": 0,
"total_amount": 15120,
"outstanding_balance": 5120,
"memo": "Memo for the office supplies purchase",
"payment_allocations": [
{
"id": "8901abcd-ef23-4567-8901-abcd12345678",
"bill_id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
"payment_id": "590ed436-c2bd-4e39-8047-f913a852f99c",
"amount": 10000,
"payment": {
"id": "590ed436-c2bd-4e39-8047-f913a852f99c",
"external_id": "bill-payment-1",
"paid_at": "2024-06-15T00:00:00Z",
"method": "ACH",
"amount": 10000,
"processor": "BANK_TRANSFER",
"imported_at": "2024-06-15T18:11:57.339076Z",
"allocations": [
{
"id": "8901abcd-ef23-4567-8901-abcd12345678",
"bill_id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
"payment_id": "590ed436-c2bd-4e39-8047-f913a852f99c",
"amount": 10000,
"transaction_tags": []
}
],
"transaction_tags": [],
"memo": "First partial payment",
"metadata": {},
"reference_number": "PAY-1001"
},
"transaction_tags": [],
"memo": "Allocated to June office supplies bill",
"metadata": {},
"reference_number": "ALLOC-1001"
}
],
"vendor_credits": [],
"imported_at": "2024-06-01T10:11:57.184157Z",
"updated_at": "2024-06-15T18:11:57.339076Z",
"transaction_tags": [],
"metadata": {}
}
}An expense is a type of bill. To fetch one expense, use Fetch bill with the expense
The response is a bill with
id returned by Create expense:
GET /v1/businesses/{business_id}/bills/{bill_id}
is_expense: true.
See the Expense object for more on expenses vs. standard bills.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The UUID of the business to fetch the bill for.
The UUID of the bill to fetch.
Response
200 - application/json
Success.
Show child attributes
Show child attributes
āI