201Successful Response
Schema: SuccessEnvelope_CovenantResponse_
successbooleanmessagestringcodestringdataCovenantResponse
/api/v1/credit/lines/{credit_line_id}/covenantsWrites a covenant the nightly sweep tests against the borrower's books from tonight on. comparison defaults to the kind's own (gte for the minimums, lte for max_leverage) and is required for custom_ratio, which also needs a numerator and a denominator selector naming at least one ledger id, type or concept (400 otherwise). A line with no merchant_business_id accepts covenants but every check reads unmeasured until the borrower's business is linked.
Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.
credit_line_idstringrequiredCredit line ID. The lender's routes need a line this business operates; the borrower's read also accepts a line it borrows on.
Schema: CovenantCreate
kindstringrequiredmin_cash (cash ledgers' balance, currency), max_leverage (total liabilities / total equity), min_dscr (debt service coverage, the underwriting measurer), min_inventory_turns (cost of goods sold over 365 days / average inventory), min_current_ratio (current assets / current liabilities) or custom_ratio (two selectors).
One of: min_cash, max_leverage, min_dscr, min_inventory_turns, min_current_ratio, custom_ratio
labelstringHow the console names it.
thresholdnumberrequiredWhole currency units for min_cash; a decimal ratio otherwise.
comparisonstringvalue <comparison> threshold passes. Defaults to the kind's own (gte for the minimums, lte for max_leverage); required for custom_ratio.
warn_band_bpsintegerA pass within this share of the threshold warns (1000 = 10%).
numerator_selectorLedgerSelectorcustom_ratio only: the numerator's ledgers.
denominator_selectorLedgerSelectorcustom_ratio only: the denominator's ledgers.
activebooleanChecked nightly while true.
notesstringOperator notes.
Schema: SuccessEnvelope_CovenantResponse_
successbooleanmessagestringcodestringdataCovenantResponseSchema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.
Schema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.
Schema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.
Schema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.
Schema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.