Get Customer Invoice Files
The Get Customer Invoice files API is used to download customer single or multiple invoice files to the user’s local machine. The API may return one or more files* of a particular invoice or even one or more files of multiple invoices. When downloading multiple invoices, the downloaded file is a zip file which contains all the requested invoices.
Currently XML and PDF file types are supported
| HTTP URL |
|
|---|---|
| POST | api/v2/customer/{id}/download-invoices |
Eligibility
The Requestor is eligible to request download of invoices which were assigned to his own customer or his own sub-customers.
Customer {id} can be either the requestor’s customer ID or any of the customer’s direct sub customers.
API Request
| Parameter | Type | M/O/CM | Description |
|---|---|---|---|
| id | UUID | O | Array of invoice UUIDs to retrieve |
API Response
Response Structure
| Parameter | Type | M/O/CM | Description |
|---|---|---|---|
| errorCode | String | O | Failure code. See list below, under ‘Error Codes’ section |
| errorMessage | String | O | Failure detailed description. See list below, under ‘Error Codes’ section |
| content | Object | O | Array of main response body object. Displayed when an API call was successful. For a failure it will be empty. |
| pageable | Object | O | Paging information object. Displayed when an API call was successful. For a failure it will be empty. |
Content
| Parameter | Type | M/O/CM | Description |
|---|---|---|---|
| attachmentData | String | M | Base64 text encoding string representing the requested invoice file as a binary data (as a particular or a zip file type). |
Error Codes
In addition to the general success and failure codes, the following error codes are possible.
| Code | Message |
|---|---|
| GLOBAL_1001 | Service unavailable. Please try again |
| CUSTOMER_1002 | Customer does not exist |
| CUSTOMER_1006 | Failed to retrieve customer details |
| CUSTOMER_1040 | Requested invoice ID\s invalid |
Examples
Request Body
{
}
Response Body: Full Success (ACK)
{
"errorCode": "",
"errorMessage": "",
"content": [
{
"attachmentData": "blob:http://flo-invoice.storage.flo.int:8080/74c15934-f0a0-437a-92cf-fbd86b0abbb0"
}
],
"pageable": null
}
Response Body: Includes Failure(s) (NAK)
{
"errorCode": "GLOBAL_1001",
"errorMessage": "Service unavailable. Please try again",
"content": "",
"pageable": null
}