Skip to main content

Generate Report

curl -X GET "https://api.invenicum.com/reports/generate/1?type=inventory&format=pdf" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  --output report.pdf
Generates a comprehensive report for a specific container and downloads it in the requested format.

Path Parameters

containerId
integer
required
The unique identifier of the container to generate the report for

Query Parameters

type
string
required
Type of report to generateOptions:
  • inventory - Complete inventory listing with all items
  • loans - Active and historical loan records
  • assets - Asset tracking and valuation report
format
string
required
Export format for the reportOptions:
  • pdf - PDF document (application/pdf)
  • excel - Excel spreadsheet (application/vnd.ms-excel)
startDate
string
Filter records from this date (ISO 8601 format: YYYY-MM-DD)Example: 2024-01-01
endDate
string
Filter records until this date (ISO 8601 format: YYYY-MM-DD)Example: 2024-12-31
assetTypeId
integer
Filter by specific asset type category
locationId
integer
Filter by specific location within the container
includeImages
boolean
Include item images in the report (PDF only)Default: false
lowStockOnly
boolean
Only include items below minimum stock thresholdDefault: false

Response

Returns a binary file download with appropriate Content-Type and Content-Disposition headers. Headers:
  • Content-Type: application/pdf or application/vnd.ms-excel
  • Content-Disposition: attachment; filename="informe_inventory_20240315T143022.pdf"

Get Report Preview

curl -X GET "https://api.invenicum.com/reports/preview/1?type=inventory" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Returns a preview or summary of the report data before generating the full document.

Path Parameters

containerId
integer
required
The unique identifier of the container

Query Parameters

type
string
required
Type of report: inventory, loans, or assets

Response

preview
string
HTML or text preview of the report content
{
  "preview": "<div class='report-preview'><h2>Inventory Report</h2><p>Total Items: 342</p><p>Total Value: $45,789.50</p></div>"
}

Get Report History

curl -X GET "https://api.invenicum.com/reports/history/1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Retrieves the history of previously generated reports for a container.

Path Parameters

containerId
integer
required
The unique identifier of the container

Response

data
array
required
List of historical report records
{
  "data": [
    {
      "id": 1245,
      "type": "inventory",
      "format": "pdf",
      "fileName": "informe_inventory_20240315T143022.pdf",
      "fileSize": 2457600,
      "generatedAt": "2024-03-15T14:30:22Z",
      "generatedBy": "[email protected]",
      "filters": {
        "assetTypeId": 3,
        "includeImages": true
      }
    },
    {
      "id": 1244,
      "type": "loans",
      "format": "excel",
      "fileName": "informe_loans_20240314T093015.xlsx",
      "fileSize": 156800,
      "generatedAt": "2024-03-14T09:30:15Z",
      "generatedBy": "[email protected]",
      "filters": {
        "startDate": "2024-01-01",
        "endDate": "2024-03-14"
      }
    }
  ]
}

Download Report

curl -X GET "https://api.invenicum.com/reports/download/1245" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  --output report.pdf
Downloads a previously generated report from the history.

Path Parameters

reportId
integer
required
The unique identifier of the report to download

Response

Returns the report file as a binary download with appropriate headers.

Delete Report

curl -X DELETE "https://api.invenicum.com/reports/1245" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Deletes a report from the history.

Path Parameters

reportId
integer
required
The unique identifier of the report to delete

Response

Returns 204 No Content on successful deletion.

Report Types

Inventory Report

Comprehensive listing of all inventory items including:
  • Item names, descriptions, and barcodes
  • Current quantities and minimum stock levels
  • Market values and total portfolio value
  • Locations and container assignments
  • Custom field values
  • Item images (when includeImages=true)
Use Cases:
  • Annual inventory audits
  • Insurance documentation
  • Asset valuation reports
  • Stock level analysis

Loans Report

Detailed loan tracking information including:
  • Active and completed loans
  • Borrower information
  • Loan dates and due dates
  • Overdue loan identification
  • Return status
  • Loan history trends
Use Cases:
  • Usage analysis
  • Compliance reporting
  • Equipment utilization tracking
  • Overdue item follow-up

Assets Report

Asset management and tracking details:
  • Asset categories and types
  • Acquisition dates and costs
  • Depreciation calculations
  • Maintenance schedules
  • Asset lifecycle tracking
  • Disposal records
Use Cases:
  • Financial reporting
  • Asset lifecycle management
  • Budget planning
  • Depreciation tracking

File Naming Convention

Generated reports follow this naming pattern:
informe_{reportType}_{timestamp}.{extension}
Examples:
  • informe_inventory_20240315T143022.pdf
  • informe_loans_20240314T093015.xlsx
  • informe_assets_20240313T161245.pdf
Where timestamp is in ISO 8601 format with colons removed.

Filtering Examples

Date Range Filter

curl -X GET "https://api.invenicum.com/reports/generate/1?type=loans&format=excel&startDate=2024-01-01&endDate=2024-03-31"
Generates a loans report for Q1 2024.

Low Stock Report

curl -X GET "https://api.invenicum.com/reports/generate/1?type=inventory&format=pdf&lowStockOnly=true"
Generates an inventory report showing only items below minimum stock.

Filtered by Location and Asset Type

curl -X GET "https://api.invenicum.com/reports/generate/1?type=inventory&format=excel&locationId=5&assetTypeId=3"
Generates an inventory report for specific location and asset type.

Detailed PDF with Images

curl -X GET "https://api.invenicum.com/reports/generate/1?type=inventory&format=pdf&includeImages=true"
Generates a comprehensive PDF report including all item images.

Error Responses

400 Bad Request
Returned when invalid parameters are provided.
{
  "error": "Invalid report type. Must be: inventory, loans, or assets"
}
404 Not Found
Returned when the container or report is not found.
{
  "error": "Container not found"
}
500 Internal Server Error
Returned when report generation fails.
{
  "error": "Error al generar el informe",
  "message": "PDF generation service unavailable"
}

Build docs developers (and LLMs) love