Skip to main content

Generating Project Files

You can generate project documents (e.g. proposal, contract, energy report) via the API. Supported formats include PDF, DOCX, and CSV depending on document type.

Endpoints

EndpointDescription
POST /api/orgs/:org_id/projects/:project_id/generate_document/:document_type/Generate document (recommended)
POST /api/orgs/:org_id/projects/:project_id/generate_document_pdf/:document_type/Generate PDF (legacy)
POST /api/orgs/:org_id/projects/:project_id/generate_document_docx/:document_type/Generate DOCX

Query parameters

ParameterDescription
file_formatOutput format: pdf or csv. Optional; default depends on document type.
system_uuidWhich system to use (optional).
payment_option_idWhich payment option to use (optional).
languageLanguage code, e.g. en (optional).
file_tagsTags to apply to the generated file when saved (optional).
actionSet to save to save the generated file as a private file (optional).
temporaryWhether the file is temporary (optional).

Document types

PDF document types

Document TypeDescription
proposalSales proposal (with contract section)
proposal_onlySales proposal only
contractContract document (with proposal)
contract_onlyContract document only
owners_manualOwner's manual
installation_instructionsInstallation instructions
energy_yield_reportEnergy yield report
shade_reportShade report
structural_report_mcsMCS structural report
pv_site_planPV site plan
system_image_onlySystem image
system_performance_image_onlySystem performance image
ironridge_bomIronRidge bill of materials
global_bomGlobal bill of materials
change_orderChange order document
generic_documentGeneric document
financials_reportFinancials report
greenlancer_project_summaryGreenlancer project summary
lightreach_sales_design_detailsLightreach sales design details

CSV document types

Document TypeDescription
system_performance_8760System performance (8760 hourly)
bill_calculations_csvBill calculations
financials_reportFinancials in CSV format
note

The default format for most document types is PDF. For system_performance_8760, bill_calculations_csv, and financials_report, the default can be CSV. Use file_format to request PDF or CSV where both are supported.

Typical flow

  1. Authenticate — Obtain an OpenSolar API bearer token (see Getting Bearer Tokens).
  2. Call the endpointPOST to generate_document/{document_type}/ with the desired org_id, project_id, document_type, and any required or optional query parameters.
  3. Use the result — The response may be a URL, file content, or task reference. Some flows save the generated file as a private file (e.g. with action=save) and return a private file URL; you can then manage it via the Private Files API.

Examples

Generate proposal PDF

Request
curl "https://api.opensolar.com/api/orgs/:org_id/projects/:project_id/generate_document/proposal/?file_format=pdf&system_uuid=abc-123&payment_option_id=789&language=en"
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"
--request POST

Generate contract PDF

Request
curl "https://api.opensolar.com/api/orgs/:org_id/projects/:project_id/generate_document/contract/?file_format=pdf&system_uuid=abc-123&payment_option_id=789"
-H "Authorization: Bearer <token>"
--request POST

Generate and save as private file

Request
curl "https://api.opensolar.com/api/orgs/:org_id/projects/:project_id/generate_document_pdf/proposal/?action=save&system_uuid=abc-123&payment_option_id=789"
-H "Authorization: Bearer <token>"
--request POST

When the endpoint is called with action=save, the response includes a reference to the created private file. Use GET /api/orgs/:org_id/private_files/:id/ to retrieve or download it. See Private Files for more details.

Generate DOCX contract

Request
curl "https://api.opensolar.com/api/orgs/:org_id/projects/:project_id/generate_document_docx/contract/?system_uuid=abc-123&payment_option_id=789"
-H "Authorization: Bearer <token>"
--request POST