Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
api:api_applications_id_offers_id_letters [2025/01/02 21:18] โ€“ [/api/applications/ID/offers/ID/letters] Lauriapi:api_applications_id_offers_id_letters [2025/01/02 21:33] (current) โ€“ [POST] Lauri
Line 37: Line 37:
 ===== POST ===== ===== POST =====
  
-TODO+This allows to generate a new offer attachment from a letterhead. 
  
 +The process is actually comprised of 3 stages:
 +  - A letter is generated from a letterhead
 +  - The letter is rendered to PDF
 +  - The PDF file is attached to the offer
 +
 +This POST call, by the semantics of it, is meant to allow step 1 โ€” the creation of the letter. But a bare letter, on its own, is pretty useless. Therefore, as a matter of convenience, this call also renders the PDF file and attaches it to the offer.
 +
 +Note that this call is equivalent to the "one click attach" feature in the offer dialog. The same limitations apply:
 +  * There should not already be a pre-existing letter generated from this letterhead. Otherwise, this call could overwrite existing user customisation beyond the letterhead template. Keep in mind that the letterhead template can (and often is) edited when generating (and attaching) a letter.
 +  * The letterhead template markers should all be  possible to correctly fill. For example, if there is a marker to replace the applicant's phone number, the call will not work if the phone number field is not properly filled in the application. In short, this call only allows for the "happy path", as it does not offer ways to recover from errors or substitute missing information.
 ==== Syntax ==== ==== Syntax ====