Get a legal document
Returns the current version of a legal document as Markdown. A label in brackets, such as [fee], stands in place of each value of an offer. A website shows this version to a reader who has no offer. The endpoint needs no authentication.
Path Parameters
Id of the legal document.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/legal-documents/flex-credit-terms"{ "id": "flex-credit-terms", "title": "Flex Credit purchase terms", "version": "1.0-draft", "effective_date": "2019-08-24", "markdown": "# Flex Credit purchase terms"}{ "code": "BAD_REQUEST", "description": "Bad Request"}{ "code": "UNAUTHORISED", "description": "Unauthorised"}{ "code": "FORBIDDEN", "description": "Forbidden"}{ "code": "BAD_REQUEST", "description": "Invalid input"}{ "code": "RATE_LIMIT_EXCEEDED", "description": "Too Many Requests"}{ "code": "INTERNAL_ERROR", "description": "Internal Server Error"}Stream the unread count GET
A server-sent event stream. Each event holds the unread count, for example `{"unread_count": 3}`. The server sends a `received` event when a new message arrives in the caller's inbox. The client can play a sound for this event. The server sends an `inbox` event when the stream opens and for every other change to the caller's inbox. The end of a snooze sends no event. The client gets the count again when it opens a new stream or when the app gets focus. The server sends a comment every 25 seconds to keep the connection open, and closes the stream after 15 minutes. The client then opens a new stream.
Preview a legal document for an offer POST
Returns the current version of a legal document as Markdown, filled with the values of the caller's offer: the amount, the tenure, the fee, the payment plan and the account terms. The app shows this text before the customer accepts the offer. The preview creates nothing, so a client can repeat it. Requires an active user who owns the account. An offer that the account cannot draw fails with the error of the payment preview.