Creating an Invoice and Multi-Invoice
Creating an Invoice
After you go through the Authentication process, you can call the ClientPay API in order to create invoices with a single line item or multiple.
The Invoice call requires an accessId and requestId. Use the Generate Request ID endpoint to create a requestId.
Invoice Request Object
When you POST to the Invoice endpoint, the following fields are necessary:
{
"accessId": "sample string 1",
"requestId": "sample string 2",
"customerRefNumber": "sample string 3",
"sessionId": "sample string 4",
"invoices": [
{
"invoiceNumber": "sample string 1",
"invoiceDate": "2017-12-14T11:10:21.0004016-06:00",
"dueDate": "2017-12-14T11:10:21.0004016-06:00",
"subtotalAmount": 1.0,
"discountAmount": 1.0,
"tax": 1.0,
"outstandingBalance": 4.0,
"paymentAmount": 1.0,
"invoiceAmountTotal": 5.0,
"clientID": "sample string 6",
"clientName": "sample string 7",
"pdfLink": "sample string 8"
},
{
"invoiceNumber": "sample string 1",
"invoiceDate": "2017-12-14T11:10:21.0004016-06:00",
"dueDate": "2017-12-14T11:10:21.0004016-06:00",
"subtotalAmount": 1.0,
"discountAmount": 1.0,
"tax": 1.0,
"outstandingBalance": 4.0,
"paymentAmount": 1.0,
"invoiceAmountTotal": 5.0,
"clientID": "sample string 6",
"clientName": "sample string 7",
"pdfLink": "sample string 8"
}
],
"cardholderName": "sample string 7",
"billingAddress": "sample string 8",
"billingCity": "sample string 10",
"billingCountry": "sample string 11",
"duration": 12,
"billingZipCode": "sample string 13",
"billingStateCode": "sample string 14",
"enableClientSidePostBack": true,
"clientSideReturnAddress": "sample string 19",
"hideCustomerHeaderLogo": true
}
Invoices Array
Within the Invoice request object, there is an Invoices array. Sending multiple Invoice arrays within a single request will add multiple line items to the Invoice when it is opened in a browser. Below is a breakdown of the invoice array.
InvoiceNumber | Required Field in request indicating the Invoice number from customer to attach to each invoice payment page; (64 Chars Max). |
InvoiceDate | Required Field in request indicating the Invoice Date of each invoice displayed on the invoice payment page. |
DueDate | Required Field in request indicating the Invoice Due Date of each invoice displayed on the invoice payment page. |
SubtotalAmount | Optional Field in request for subtotal amount of each invoice in invoice payment request. |
DiscountAmount | Optional Field in request for discount amount applied off each invoice total display on invoice payment page. |
Tax | Optional Field in request for tax amount of subtotal applied to each invoice total display on invoice payment page. |
OutstandingBalance | Required Field in request for outstanding amount remaining amount for each payment amount displayed on invoice payment page. |
PaymentAmount | Optional Field in request for suggested payment amount off outstanding balance for each invoice displayed on invoice payment page. |
InvoiceAmountTotal | Optional Field in request for total amount of invoice request that includes total = (subtotal - discountAmount + tax) of each invoice total displayed on invoice payment page. |
ClientID | Optional Field in request for Client ID applied to each invoice on invoice payment page. |
ClientName | Optional Field in request for Client Name applied to each invoice on invoice payment page. |
PDFLink | Optional Field in request for External link to invoice in PDF format to be shown on click event after each invoice on invoice payment page. |
Updated over 7 years ago