Mass payments
Use POST /v3/payments/mass to pay up to 2000 bills with one API request. BILL processes each payment in the mass payment request asynchronously.
Creating a mass payment is an MFA-trusted operationCreating a mass payment requires an MFA-trusted API session. See MFA setup in the API reference for information about the BILL MFA process.
When you create a mass payment, a BILL-generated payment batch ID is available in the response. You can track the current status of each payment in a mass payment batch with GET /v3/payments/mass/{paymentBatchId}.
See the POST /v3/payments/mass API for the complete list of available operations.
Create a mass payment
In your POST /v3/payments/mass request, set the required fields.
Field | Description |
|---|---|
| Bill payment processing date in the If the funding account type is set as Note: When you add a vendor bank account, BILL requires 2 business days to complete a one-time verification of the bank account. To pay such a vendor, you must set a |
| Funding account information.
|
| BILL-generated ID of the bill to be paid. The value begins with |
| Payment amount |
See the POST /v3/payments/mass API for more information about the other mass payment fields you can set.
Sample request
In this cURL example, a mass payment is created with 5 bills. A billId is associated with each payment. Funding account details are added to provide a bank account source for the payment. Since processDate is not set in the request, BILL automatically sets the date as the next available payment date.
You can pay a single vendor or multiple vendorsYour
POST /v3/payments/massrequest can be the same regardless of whether you are paying a single vendor or multiple vendors.
curl --request POST \
--url 'https://gateway.stage.bill.com/connect/v3/payments/mass' \
--header 'content-type: application/json' \
--header 'devKey: {developer_key}' \
--header 'sessionId: {session_id}' \
--data '{
"fundingAccount": {
"type": "BANK_ACCOUNT",
"id": "{org_bank_account_id}"
},
"payments": [
{
"billId": "{bill_id01}",
"amount": 228.99
},
{
"billId": "{bill_id02}",
"amount": 142.00
},
{
"billId": "{bill_id03}",
"amount": 100.00
},
{
"billId": "{bill_id04}",
"amount": 399.99
},
{
"billId": "{bill_id05}",
"amount": 59.00
}
]
}'Sample response
BILL processes each payment in the mass payment request asynchronously. In the response, a paymentBatchId is available. The value begins with bbq. Track the current status of each payment in the mass payment batch with GET /v3/payments/mass/{paymentBatchId}.
{
"paymentBatchId": "{mass_payment_batch_id}"
}Get mass payment batch status
With GET /v3/payments/mass/{paymentBatchId}, you can track the current status or each payment in a mass payment batch.
Sample response
In the response, count is the total number of bills in the payment batch. In addition, the scheduled, completed, and failed arrays list the current payment status of each bill in the mass payment API request.
This is an example response of a mass payment batch of 5 payments.
Mass payment batch status | Description |
|---|---|
| For each payment in the list, BILL has not started generating a |
| For each payment in the list, BILL has successfully generated a Note: From the list of |
| An error response is available for each failed payment. Note: If the vendor has |
{
"count": 5,
"scheduled": [
{
"billId": "{bill_id01}"
},
{
"billId": "{bill_id02}"
}
],
"completed": [
{
"billId": "{bill_id03}",
"paymentId": "{payment_id01}"
},
{
"billId": "{bill_id04}",
"paymentId": "{payment_id02}"
}
],
"failed": [
{
"billId": "{bill_id05}",
"errorCode": "BDC_1159",
"errorMessage": "Cannot overpay a bill."
}
]
}See the POST /v3/payments/mass API for more information.
