AP Overview
Overview
Accounts Payable (AP) is the money a Business owes its vendors for things it has bought but not yet paid for. In Asset, you record it by creating a Bill for a Vendor. Asset keeps the books as the Bill is paid, credited or cancelled.
| Object | What it is |
|---|---|
| Vendor | Someone the Business buys from. Every Bill belongs to one. |
| Bill | An amount the Business owes a Vendor, made up of one or more lines. |
| Payment | A bank Transaction, or Vendor Credit, applied to a Bill. |
| Vendor Credit | Money a Vendor owes back to the Business. It can be applied to future Bills. |
This is the mirror image of Accounts Receivable, where the Business is the one being paid.
Bills in a currency other than the Business' home currency are covered in a separate guide.
Vendors
Create a Vendor before you record a Bill from them, using Create a new vendor.
| Request Parameter | Description |
|---|---|
| name | Required. The Vendor's name. |
| external_id | Optional. Your own identifier for the Vendor. |
| contact_name | Optional. |
| Optional. | |
| phone_number | Optional. |
You can retrieve, list, update and delete Vendors with the other Vendor endpoints.
Create a Bill
Call Create Bills. The body is a list of up to 100 Bills.
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/bills \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[
{
"business_id": "biz_GA6EG2qFxA97NZHtxeLPUy",
"number": "BILL-001",
"description": "Office supplies, January",
"issued_at": "2025-01-15T00:00:00Z",
"due_at": "2025-02-15T00:00:00Z",
"vendor_id": "ven_WQMDNUHpBThYSNh4AprDBo",
"lines": [
{
"description": "Paper and toner",
"amount": 240.00,
"ledger_id": "ldg_ErisumsAc7qgmbTctM7zKK"
},
{
"description": "Shipping",
"amount": 18.50
}
]
}
]'| Request Parameter | Description |
|---|---|
| business_id | Required. The Business the Bill belongs to. |
| number | Required. Must be unique within the Business. |
| description | Required. Shown on the Bill's Journal Entry. |
| issued_at, due_at | Required. due_at can't be earlier than issued_at. |
| vendor_id | Required. The Vendor the Bill is from. |
| lines | Required. Each line has a description, an amount and an optional ledger_id. |
| external_id | Optional. Your own identifier. Must be unique within the Business. |
| tags | Optional. Tags to put on the Bill. |
Send the X-User-ID header to record who created the Bill.
Each Bill is created on its own. The response has a data list with the Bills that were created and an errors list with the ones that weren't, for example because the number is already in use. One failure doesn't stop the others.
What Asset books. Asset records the expense as soon as the Bill is created, dated issued_at:
- Debit the Ledger on each line, which is normally an expense Ledger.
- Credit Accounts Payable for the total.
A line with no ledger_id is booked to Uncategorized Outflow and put in the review queue, and Asset then tries to categorize it in the background. A line with a negative amount, such as a discount, is credited to its Ledger and reduces the payable. Send a ledger_id on each line to skip the review. See Chart of Accounts.
You can also have Asset create Bills from uploaded documents. See Bills from documents.
Bill statuses
| Status | Meaning |
|---|---|
| open | Created and not fully paid. This includes Bills that are partly paid. |
| paid | Payments or credit have covered the full amount. |
| voided | Cancelled. It no longer affects the books. |
Asset sets paid for you when the payments add up to the Bill amount. The only status you set yourself is voided.
Pay a Bill
Each payment is applied to a Bill, shown in its payments list. A Bill can be paid in several parts.
Automatic matching
When a payment leaves a bank account, Asset looks for a Bill it settles. A Bill is matched when all of these are true:
- It is open and was issued on or before the payment date.
- Its total equals the payment amount exactly.
- Its number, or its Vendor's name, appears in the Transaction description.
Asset doesn't match a payment that is only part of a Bill, or one that covers several Bills. Apply those yourself.
Apply a payment yourself
Use Apply Transaction to a Bill when Asset didn't match a payment, or matched it to the wrong Bill.
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/bill-payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"bill_id": "bil_Lq5AyApd4pdL1VvakpY5aJ",
"transaction_id": "txn_oiL7THC5RDi2PVUbVyyoJ"
}'- Whole Transaction: without
payment_amount, Asset applies as much of the Transaction as is still free, up to what the Bill has left. - Part of it: send
payment_amountto apply less. This lets you split one payment across several Bills. - Too much: a
payment_amountabove the Bill's unpaid balance returns a 409. - Closed Bills: you can't apply a payment to a paid or voided Bill, or apply the same Transaction to the same Bill twice. Either returns a 409.
Once the payments add up to the Bill amount, its status becomes paid.
Pay with Vendor Credit
To settle a Bill from a Vendor's credit instead of a bank Transaction, leave out transaction_id and send the payment_amount. Asset draws on the Vendor's available credit, the oldest first. The amount can't be more than the credit available or the Bill's unpaid balance.
Undo a payment
Call Remove Bill Payment with the payment's ID. The Bill's paid amount goes down, and a bank Transaction goes back to being unmatched. Credit that was used is returned to the Vendor.
Vendor Credits
A Vendor Credit is money a Vendor owes the Business, for example for returned goods or an overcharge. Create one with Create one or more Vendor Credits.
| Request Parameter | Description |
|---|---|
| vendor_id | Required. |
| number | Required. Must be unique within the Business. |
| amount | Required. Must be greater than zero. |
| memo | Optional. A note about the credit. |
| issued_at | Optional. Defaults to now. |
| ledger_id | Optional. The Ledger the credit is booked against, for example the expense account of the purchase being returned. Defaults to Purchase Returns & Allowances. |
| is_cash_backed | Optional. Set it when the credit stands for cash already paid to the Vendor. |
Apply the credit to a Bill as described in Pay with Vendor Credit. You can void a Vendor Credit with Void a Vendor Credit, but only while none of it has been applied to a Bill.
Edit, void or delete a Bill
Edit. Update a Bill can change the number, description, issued_at and due_at, add or remove lines with line_changes, and change the tags. When the lines change, Asset recalculates the total and rebuilds the Journal Entries of the Bill and its payments. A voided Bill can't be edited.
{
"line_changes": {
"create_lines": [{ "description": "Delivery fee", "amount": 25.0 }],
"delete_lines": ["bln_GkBo16N66u2teKfFuFMMwf"]
}
}Void. To cancel a Bill entered by mistake, call Update a Bill with "status": "voided". The Bill stays on record, and its Journal Entry is zeroed. A Bill with payments can't be voided, so remove the payments first. A voided Bill can't be reopened.
Delete. Delete a Bill removes it completely, with its lines, Journal Entries and payments. Its payment Transactions go back to being unmatched, and any credit used is returned.
Bills from documents
Your customer can upload a Bill instead of typing it in. Call Upload Documents for a Business with document_type set to bill.
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/document \
--header 'Authorization: Bearer <token>' \
--form 'files=@vendor-invoice.pdf' \
--form 'document_type=bill'If you leave out document_type, Asset works out the type from the file. A bill or invoice received from a vendor is recognized as a Bill.
Asset reads the document and does the following:
- Finds or creates the Vendor. It looks for an existing Vendor with the same name, allowing for small differences such as "ACME Corp" and "Acme Corporation". If there is none, it creates one.
- Creates the Bill. It uses the number on the document, the document's date as
issued_at, and its due date asdue_at. If the document has no due date, Asset uses 30 days after the issue date. Each line item becomes a Bill line. If the document holds several Bills, each one is created separately. - Picks Ledgers for the lines. Asset proposes ledger assignments from the business's Chart of Accounts. Lines it cannot confidently place, and tax lines, are initially left without a ledger and pass through the usual categorization workflow.
The result, including what each status means, is in Bill Documents. For the Invoices a Business sends to its customers, see Invoice Documents.
See what's owed
- Aged Payables Report: the open balance owed to each Vendor, grouped by how late it is. Only Bills that are already due are included.
- List all Bills: filter by
status,numbers,due_at_startanddue_at_end.
Scopes
| Task | Scope |
|---|---|
| Create, update and delete Vendors | vendor:create, vendor:update, vendor:delete |
| List or retrieve Vendors | vendor:read |
| Create Bills, apply a payment to a Bill | bill:create |
| List or retrieve Bills | bill:read |
| Update or void a Bill | bill:update |
| Delete a Bill, remove a payment | bill:delete |
| Create a Vendor Credit | vendor_credit:create |
| List or retrieve Vendor Credits | vendor_credit:read |
| Void a Vendor Credit | vendor_credit:update |
Questions? Reach out via our Contact form.