Manage bills with the API
In Payabli, bills represent a bill from a vendor that a paypoint is expected to pay. Use managed payables with Payabli to turn those payouts to vendors into an income stream.
Learn how to use our OCR engine to scrape documents and create bills: Use the OCR Engine
Basic bill workflow
- When you get an invoice from a vendor or supplier, add it to Payabli as a bill via the API, File Exchange, or the web.
- Update or delete bills, and then queue them for approval.
- After bills are approved, make payout requests, and you can pay one or many bills.
Via an enablement process, your vendors are contacted to help decide on a payment method. The goal is that they choose to receive payments through virtual cards for ease, speed, and security of payment.
Considerations
Keep these points in mind when working with bills:
- You don’t have to use Payabli’s bill engine to make a payout. When making a payout request, set the query parameter
doNotCreateBillstotrue. - Payabli strongly recommends including bill images with your bills. Including bill images can make payouts faster, more accurate, and prevent problems.
- You can pay more than one bill with one payout request. If several active bills added, queued, and ready to be paid, you can make a payout request to pay all active bills. Remittance information for that single payout request will include the details for all of the paid bills.
- Bill approval isn’t required. If a bill status is Active (
1) or Approved (20) it can be sent for payout. If a bill status is Sent to Approval (2) you can’t send it for payout. For the full numeric mapping, see Bill statuses. - You can use the OCR engine to capture data from uploaded bill images.
Create a bill
To create a single bill, send a POST request to /api/Bill/single/{entry}.
For complete information, see the API reference.
This example adds a bill to the entrypoint with ID 8cfec329267. The bill is for a vendor with the vendorNumber VEN-123. The bill number is ABC-123, and the request includes an uploaded bill image, and optional fields like comments. The status is 1 (Active), so the bill is payout-eligible. See Bill statuses for the other values.
A successful response returns the bill ID in the responseData field.
If your workflow requires bill approval, you can send the bill to approval with the API. For more information, see Send a bill to approval.
If an approver’s email doesn’t yet belong to a Payabli user, include the autocreateUser=true query parameter so the request creates the user. Without it, the call returns a 400 error with the message Empty approvals.
After your bill is approved you can make a payout request to pay the bill. For more information, see Make a payout request.
Attach a bill image
Payabli recommends attaching a bill image to every bill — it makes payouts faster and more accurate. Add images with the attachments array when you create the bill.
Each attachment is a file object with a filename, an ftype (pdf, doc, docx, jpg, jpeg, png, gif, or txt), and the file itself, provided one of two ways:
- Base64-encoded content in
fContent. - A public URL in
furlthat Payabli fetches the file from. When you setfurl, Payabli ignoresfContent.
Payabli stores the file with the bill either way. The maximum upload size is 30 MB.
See Add bill for the full API reference.
Apply a credit to a bill
If a vendor offers a credit against a bill, record it with the bill’s discount field when you create the bill. When you pay the bill, the payout pays the net amount after the credit, and the credit flows through to your reconciliation data.
Set the bill amounts like this:
discountis the credit applied to the bill.netAmountis the bill total minus thediscount. This is the amount you actually pay.
discount plus netAmount equals the original bill total. For example, a $100.00 bill with a $25.00 credit has a netAmount of 75.00 and a discount of 25.00:
To record a credit memo number, use the comments field.
Import bills
You can import a list of bills into Payabli using the API. This is useful if you have many bills to add at once, or if you want to automate the process. Before you get started, download the example CSV file and open it with the editor of your choice. Use it as an example to help you build your import file.
To create a bill, send a POST request to the /api/Import/billsForm/{entrypoint} endpoint, with an attached CSV file.
This example imports billImport.csv for the entrypoint e56ce00572.
A successful request returns a JSON response with the number of added and rejected records, and any errors. The imported data is now available for use, and you can confirm by checking the Payabli Portal.
responseData object contains the number of records added and rejected. The errors field contains any errors that occurred during the import process.After you import bills, you can manage them with the API. For example, you can update or delete bills, send them for approval, and create payout requests.
Partially pay a bill
If you’re using managed payables, you can pay part of a bill instead of the full amount. To pay part of a bill, send a payout for a single bill whose totalAmount is less than the bill’s outstanding balance. The bill moves to Partially Paid status (75) and stays selectable for further payment until it’s fully paid.
Each bill response includes two fields for tracking the balance:
paidAmount— the amount paid toward the bill so far.outstandingBalance— the amount still owed, calculated asnetAmountminuspaidAmount.
To check a bill’s remaining balance at any time, get the bill or list bills and read outstandingBalance. It reaches 0 when the bill is fully paid, and you can filter for bills that still owe a balance with the Partially Paid status (?status=75).
Subscribe to the BillPartiallyPaid webhook to be notified each time a partial payout posts. Paying more than the outstanding balance returns error 3448, a request with more than one bill returns 3451, and paying a bill that’s already fully paid returns 3411.
Partial payouts are available for managed payables only. On-demand payout methods (ACH, Same Day ACH, check, virtual card, wire, and RTP) stay full-payment-only, and a partial attempt returns error 3013. This feature is available on request — contact the Payabli team to enable it.
Manage bills
You can also manage your bills via the API. See these endpoint references for more information:
Related resources
See these related resources to help you get the most out of Payabli.
Prerequisites
- Manage vendors with the API - Understanding vendors is important for using the Bills API effectively
Next steps
- Manage payouts with the API - Making payouts is a good next step after learning about bills
References
- Pay Out schemas - Learn about money out statuses and events and how they work together
- Pay Out statuses - Learn about Pay Out statuses
Often confused with
Manage invoices with the API - Don’t confuse bills with invoices, which are used in Pay In. See Manage invoices with the API