GetReportAccountsPayable (Pull Method)
GetReportAccountsPayable
Retrieves an Accounts Payable Report for a specified company and date range.
The response contains a JSON array of objects, each representing a payable record with invoice, payment, and insured details.
Request
| Parameter | Type | Description |
|---|---|---|
| Company | String | Required. Company identifier from GetCompanies. |
| StartDate | Date | Required. Start date of range. |
| EndDate | Date | Required. End date of range. |
| Status | String | Optional. Invoice status filter. |
| LossType | String | Optional. |
| State | String | Optional. |
Response
The endpoint returns a JSON array; each object contains:
| Parameter | Type | Description |
|---|---|---|
| InvoiceNumber | String | Invoice number. |
| PolicyNumber | String | Policy number. |
| ClaimNumber | String | Claim number. |
| LossType | String | Loss type. |
| DateOfLoss | Date | Date of loss. |
| InsuredName | String | Insured’s name. |
| InsuredState | String | Insured’s state. |
| InsuredZipCode | String | Insured ZIP code. |
| Vendor | String | Vendor name. |
| Adjuster | String | Adjuster name. |
| DateSubmitted | Date | Invoice submission date. |
| TaxesPercentage | String | Tax percentage. |
| TaxesAmount | String | Tax amount. |
| InvoiceTotal | String | Invoice total. |
| InvoiceStatus | String | Current invoice status. |
| CheckNumber | String | Payment check number (if applicable). |
| CheckDate | Date | Payment check date. |
| CheckAmount | String | Payment check amount. |
| Errors | Array | Contains error message(s) if an error occurs. |
Example (C#)
// setup request parameters
NameValueCollection objAccountsPayableReportParams = new NameValueCollection
{
{ "Company", "ABC" }, // Example: 1021, 1022
{ "StartDate", "12/01/2017" },
{ "EndDate", "" },
{ "Status", "" },
{ "LossType", "" },
{ "State", "" }
};
dynamic getInvoiceAPResponse = apiClient.GetReportAccountsPayable(objAccountsPayableReportParams);
// Convert JSON array to file (if returned as base64-encoded bytes)
byte[] APbytes = Convert.FromBase64String(Convert.ToString(getInvoiceAPResponse));
string reportFileName = $"AP-{DateTime.Now:MM-dd-yyyy HH-mm-ss}.xls";
File.WriteAllBytes(@"C:\DownloadAPIFiles\" + reportFileName, APbytes);
Console.WriteLine("Saved file: {0}", reportFileName);