Cowdidocs
API ReferenceLegal documents

Preview a legal document for an offer

POST
/v1/legal-documents/{id}/preview

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.

AuthorizationBearer <token>

Create a client with POST /v1/oauth/clients, then exchange its credentials for an access token. AUTHORIZATION_CODE clients act on behalf of a signed-in user and always use PKCE; CLIENT_CREDENTIALS clients act as themselves. A client may only be granted scopes its creator already holds — read the grantable list from GET /v1/oauth/clients/scopes.

In: header

Path Parameters

id*string

Id of the legal document.

Request Body

application/json

The credit offer that the document describes.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/legal-documents/flex-credit-terms/preview" \  -H "Content-Type: application/json" \  -d '{    "account_id": "550e8400-e29b-41d4-a716-446655440000",    "amount": {      "value": 100000,      "currency": "KES"    },    "tenure": {}  }'
{  "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"}