Generate a plan and store it on an offer
POST/v1/offers/:id/documents/generate
Draws the string plan or the circuit diagram from the offer as it stands and stores it as a document of the offer. The offer's document of that plan is renewed and keeps its id (200); an offer that has none gets one (201). On a published or accepted offer the customer sees it at once, and the offer's history names the API key. No mail is sent.
To get a plan without storing it, see GET /v1/offers/{id}/string-plan and GET /v1/offers/{id}/circuit-diagram. Generating takes a few seconds. Requires the read:documents and write:offers scopes.
Request
Responses
- 200
- 201
- 400
- 401
- 403
- 404
- 409
- 429
- 500
The offer's document of this plan, renewed.
The new document.
validation_error: the body, a path or a query parameter is not valid. message names each problem, e.g. firstName: Required.
missing_api_key or invalid_api_key: no API key was sent, or it is wrong, expired or revoked.
insufficient_scope: the API key does not have the scope this endpoint needs. required names it.
not_found: there is no such record in your company.
strings_not_configured: no modules of the offer are wired to an inverter, so there is nothing to draw. document_already_in_offer: another document of the offer is this very file, as documentId.
rate_limited: the API key has stored 1000 files within the hour. Try again after the seconds in the Retry-After header.
Response Headers
generation_failed: the plan could not be produced. db_error: the database refused or failed the request. storage_error: the file could not be stored. message has the details.