About ChargeCustomer
This processes a receipt from a customer to withdraw funds from the authorized CustomerBankAccount.
Note: Direct bank charges to customer's bank requires customer's authorization.
When your UI allows users to charge customer's bank account directly, make ABSOLUTELY sure that those users know about and agree to Bill.com Bill Payments Terms of Service. TO EMPHASIZE: the user MUST ensure the customer has authorized and provided the bank account details.
Recommendation: Include a checkbox with text: "I have necessary authorization from this customer to charge their bank account".
After the customer provides authorization, use SetCustomerAuthorization to confirm. This is required only once for each customer. For more information, see Get signed bank authorization from your customer.
Funds received can be applied to existing invoices, or fully unapplied.
If applied to invoices, specify which invoices. Any unapplied amount is first applied to invoices until either (a) the amount is fully applied, or (b) specified invoice(s) are paid for specified amount(s). Any remaining amount on specified invoice(s) remain open (unapplied).
Example
Request
<API_URL_EndPoint>/ChargeCustomer.json
data={
"customerId" : "0cu01OVCSLTRSAWLh162",
"paymentDate" : "2016-11-10",
"paymentType" : "3",
"paymentAccountId" : "cba01JKUWIGEILPU855q",
"Memo" : "Check received",
"invoicePays" : [ {
"invoiceId" : "00e01ZWWATZFFOSAdjjw",
"amount" : 56.50
} ]
}
Response
{
"response_status" : 0,
"response_message" : "Success",
"response_data" : {
"chargedReceivedPay" : {
"entity" : "ReceivedPay",
"id" : "0rp01DCTUHXFITIQarus",
"createdTime" : "2016-11-15T21:45:13.000+0000",
"updatedTime" : "2016-11-15T21:45:13.000+0000",
"customerId" : "0cu01OVCSLTRSAWLh162",
"status" : "2",
"paymentDate" : "2016-11-10",
"depositToAccountId" : "0ca01LVTWVKRGEDTfsly",
"isOnline" : true,
"paymentType" : "3",
"amount" : 56.50,
"description" : null,
"refNumber" : "Bill.com ePayment",
"convFeeAmount" : 0.00,
"payToBankAccountId" : "bac01HNBWVPXWGNT9bw8",
"rPConvFee" : null,
"invoicePays" : [ {
"entity" : "InvoicePay",
"id" : "0ip01LKWEYMOLJDF5ol5",
"invoiceId" : "00e01ZWWATZFFOSAdjjw",
"amount" : 56.50,
"status" : "2",
"createdTime" : "2016-11-15T21:45:13.000+0000",
"updatedTime" : "2016-11-15T21:45:13.000+0000"
} ]
}
}
}
Resources
Parameters
Field Name | Description | Required? |
---|---|---|
customerId | System-generated Unique Identifier for customer. | Yes |
paymentType | Payment type to charge customer. Currently, only bank account is supported. Set value = 3 to charge customer's bank account. |
Yes |
paymentDate | The date the payment was made. | No |
paymentAccountId | Payment method ID. To charge user's bank account, pass Bill.com ID of bank account. To retrieve, use Read on CustomerBankAccount. | Yes |
memo | Description of charge details. | No |
emailReceipt | True = send email receipt to customer. | No |
totalAmount | Amount charged to customer. Use for unapplied amount. | No |
invoicePays | Invoices to be paid. NOTE: totalAmount or invoicePays must be passed. |
No |