Skip to main content
POST
/
disbursements
Record a loan disbursement
curl --request POST \
  --url https://ledger.clarivo.co/v1/disbursements \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "loan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "borrower_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amount_minor": "<string>",
  "currency": "<string>",
  "effective_at": "2023-12-25",
  "method": "ach",
  "destination_ref": "<string>",
  "metadata": {}
}
'
{
  "disbursement_event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "journal_entry_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "posted_at": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.clarivo.co/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

OAuth2 JWT bearer tokens. Tokens are validated at API Gateway via a Lambda Authorizer that verifies signature against the issuer's JWKS, checks iss, aud, exp, nbf, and the tenant_id custom claim. Granular scopes are required per operation.

Headers

Idempotency-Key
string
required

Required on every POST. Must be a deterministic, client-chosen identifier unique per tenant. Recommended format: <event_type>:<resource_id>:<natural_key>. Retained for 24h minimum.

Required string length: 8 - 255
Pattern: ^[A-Za-z0-9][A-Za-z0-9._:\-]{7,254}$
Example:

"payment:loan_42:proc_txn_abc123"

X-Trace-Id
string

Deprecated — use traceparent instead (ADR-0011). Client-supplied correlation ID. Accepted until 2026-10-01 for backward compatibility; will be removed after that date.

Pattern: ^[A-Za-z0-9\-]{8,128}$
traceparent
string

W3C Trace Context traceparent header for distributed tracing (RFC 7230). When present, the service extracts the parent span context and creates child spans under it, enabling end-to-end trace correlation across API Gateway, the service, and the database. Format: 00-<trace-id>-<parent-id>-<flags>

Pattern: ^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$
Example:

"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"

tracestate
string

W3C Trace Context tracestate header. Carries vendor-specific trace metadata (e.g. AWS X-Ray sampling decision). Passed through unchanged.

Body

application/json
loan_id
string<uuid>
required
Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Example:

"11111111-1111-1111-1111-111111111111"

borrower_id
string<uuid>
required
Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Example:

"11111111-1111-1111-1111-111111111111"

amount_minor
string
required

Non-negative integer amount in the currency's minor unit, serialized as a string to preserve precision (JS numbers cannot safely represent values above 2^53). BIGINT on the wire, BIGINT in the database.

Required string length: 1 - 19
Pattern: ^(0|[1-9][0-9]{0,18})$
Examples:

"88849"

"10000000"

currency
string
required

ISO 4217 three-letter currency code.

Required string length: 3
Pattern: ^[A-Z]{3}$
Examples:

"USD"

"MXN"

"EUR"

effective_at
string<date>
required
method
enum<string>
required
Available options:
ach,
wire,
card_push,
internal_transfer
destination_ref
string
Required string length: 1 - 255
metadata
object

Free-form key-value metadata. Never used for financial logic. Size limit 2 KB serialized. Keys must match ^[a-zA-Z][a-zA-Z0-9_]*$.

Response

Idempotency replay.

disbursement_event_id
string<uuid>
required
Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Example:

"11111111-1111-1111-1111-111111111111"

journal_entry_id
string<uuid>
required
Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Example:

"11111111-1111-1111-1111-111111111111"

posted_at
string<date-time>
required

RFC 3339 timestamp, UTC.