Publish, accept or decline an offer
POST/v1/offers/:id/state
Moves an offer to another state. An offer goes from DRAFT to PUBLISHED, and from there to ACCEPTED or DECLINED. Requires the write:offers scope.
- Publish (
PUBLISHED): the customer can see the offer. A draft whose last valid day (validTo) is over, or whose price is zero or less, cannot be published (409 offer_not_publishable;messagesays which). - Accept (
ACCEPTED): records the order, for example one the customer gave you by phone. The offer is taken as offered: on each roof the module variant markedrecommended, theactivebattery and wallbox, the recommended emergency power, and no optional extras. Possible until the end of thevalidToday, German time (409 offer_expiredafter that). - Decline (
DECLINED): the customer can no longer order it.
An offer cannot go back to DRAFT (409 offer_not_draft), and a draft cannot be accepted or declined before it is published (409 offer_not_published). To change a published offer, create a new one.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 500
The offer in its new state.
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.
The state change is not possible. offer_not_publishable: validTo is over or the price is zero or less. offer_not_published: a draft cannot be accepted or declined. offer_not_draft: an offer cannot go back to DRAFT. offer_expired: the last valid day is over. offer_selection_required: a roof has several module variants and none is marked recommended, so it is not clear what was ordered.
db_error: the database refused or failed the request. message has the details.