Skip to main content

11.7 Financing cases

A financing case is created from a committee-approved application and then moves through disbursement and repayment lifecycle steps.

Lifecycle values: CONDITIONS_PRECEDENT, DOCUMENTATION, READY_TO_DISBURSE, PARTIALLY_DISBURSED, ACTIVE, COMPLETED, RESTRUCTURED, DEFAULTED, RECOVERY, CANCELLED, WRITTEN_OFF.

High-risk targets (require approve authority, MFA and fresh session): READY_TO_DISBURSE, PARTIALLY_DISBURSED, ACTIVE, COMPLETED, RESTRUCTURED, DEFAULTED, RECOVERY, WRITTEN_OFF.

GET /api/v1/financing-cases​

  • Purpose. Lists financing cases visible to the actor.
  • Authentication. Session cookie and X-DFFMS-Tenant-Id.
  • Role. Finance read set, with case data scope.
  • Parameters. limit, cursor.
  • Errors. As for generic list.

POST /api/v1/financing-cases​

  • Purpose. Creates a controlled financing case from an application whose committee approval is complete.
  • Authentication. Session cookie, tenant header, Origin, Idempotency-Key, MFA enrolled, session age within 15 minutes.
  • Role. approve on financing_case: FA (or PSA).
  • Body.
FieldTypeRequiredRules
applicationIdUUIDYesApplication must be APPROVED
beneficiary.displayNamestringYes2 to 200
beneficiary.typestringYes2 to 100
beneficiary.externalReferencestringNoMax 120
beneficiary.genderenumNoFEMALE or MALE (for inclusion indicators)
beneficiary.youthbooleanNoYouth inclusion indicator
institutionIdUUIDNoInstitution must exist
curl -s -X POST https://dffms.org/api/v1/financing-cases \
-H 'Cookie: __Secure-dffms.session_token=<session-cookie>' \
-H 'X-DFFMS-Tenant-Id: <tenantId>' \
-H 'Origin: https://dffms.org' \
-H 'Idempotency-Key: fc-create-2026-10-26-0001' \
-H 'Content-Type: application/json' \
-d '{
"applicationId": "0190f2c4-6b3e-7a1d-8c2f-000000000040",
"beneficiary": {
"displayName": "Demo Agro Cooperative",
"type": "COOPERATIVE",
"externalReference": "COOP-000123",
"gender": "FEMALE",
"youth": false
},
"institutionId": "0190f2c4-6b3e-7a1d-8c2f-000000000050"
}'

Response (201): the financing case row (id, tenantId, applicationId, lifecycle CONDITIONS_PRECEDENT at creation, idempotencyKey, timestamps).

Errors:

HTTPCodeMeaning
400IDEMPOTENCY_KEY_REQUIREDHeader missing or malformed.
400VALIDATION_ERRORBody invalid.
401UNAUTHENTICATEDNo session.
403MFA_REQUIRED / FRESH_AUTH_REQUIRED / FORBIDDENAs for application decisions.
404APPLICATION_NOT_FOUNDApplication missing in the tenant.
404INSTITUTION_NOT_FOUNDInstitution missing.
409APPLICATION_NOT_APPROVEDApplication not APPROVED.
409COMMITTEE_APPROVAL_REQUIREDNo completed committee approval with a decider.
409APPROVED_TERMS_MISSINGCommittee decision lacks a valid immutable term snapshot.

Side effects: creates the case, its initial workflow rows, outbox entries and audit FINANCING_CASE_CREATED. A replay with the same key returns the existing case.

POST /api/v1/financing-cases/{financingCaseId}/transition​

  • Purpose. Moves a case to the next lifecycle state, checking conditions precedent and restructuring approval where relevant.
  • Authentication. Session cookie, tenant header, Origin, Idempotency-Key. For high-risk targets: MFA enrolled and session within 15 minutes.
  • Role. approve (FA, or PSA) for high-risk targets; otherwise update on financing_case (CSA, PA, IA, FEO, FA, or PSA).
  • Body.
FieldTypeRequiredRules
expectedLifecycleenumYesCurrent lifecycle
targetLifecycleenumYesTarget lifecycle
reasonstringYes10 to 1,000

Errors:

HTTPCodeMeaning
400IDEMPOTENCY_KEY_REQUIREDHeader missing or malformed.
400VALIDATION_ERRORBody invalid.
401UNAUTHENTICATEDNo session.
403MFA_REQUIRED / FRESH_AUTH_REQUIRED / FORBIDDENStep-up or role failure.
404NOT_FOUNDMissing or outside scope.
409INVALID_STATE_TRANSITIONTransition not permitted.
409STALE_STATEexpectedLifecycle no longer matches.
409(condition code)A condition-precedent check failed; the code is specific to the failing rule.
409RESTRUCTURING_APPROVAL_REQUIREDTarget RESTRUCTURED without an approved restructuring.

Side effects: updates lifecycle, writes a transition event and audit FINANCING_CASE_TRANSITIONED, and may queue notifications. Replays with the same key return the stored transition.

POST /api/v1/financing-cases/{financingCaseId}/agreements​

  • Purpose. Records an executed financing, guarantee, investment or security agreement against a case. Records are immutable once written.
  • Authentication. Session cookie, tenant header, Origin, Idempotency-Key. No step-up.
  • Role. create on financing_case: CSA, PA, IA, FEO, FA (or PSA).
  • Body.
FieldTypeRequiredRules
agreementTypeenumYesFINANCING_AGREEMENT, GUARANTEE_AGREEMENT, INVESTMENT_AGREEMENT, SECURITY_DOCUMENT
versionstringYes1 to 40; ^[A-Za-z0-9][A-Za-z0-9._/-]*$
executedOndateYesISO date (YYYY-MM-DD)
signatoriesstringYes5 to 1,000
executionReferencestringNoMax 160
curl -s -X POST https://dffms.org/api/v1/financing-cases/0190f2c4-6b3e-7a1d-8c2f-000000000060/agreements \
-H 'Cookie: __Secure-dffms.session_token=<session-cookie>' \
-H 'X-DFFMS-Tenant-Id: <tenantId>' \
-H 'Origin: https://dffms.org' \
-H 'Idempotency-Key: fc-agr-2026-10-26-0001' \
-H 'Content-Type: application/json' \
-d '{
"agreementType": "FINANCING_AGREEMENT",
"version": "v1.0",
"executedOn": "2026-10-20",
"signatories": "Director, Demo Agro Cooperative; Accounting Officer, DFFMS",
"executionReference": "EXEC-2026-0001"
}'

Response (201): the agreement record.

Errors:

HTTPCodeMeaning
400IDEMPOTENCY_KEY_REQUIREDHeader missing or malformed.
400VALIDATION_ERRORBody invalid.
401UNAUTHENTICATEDNo session.
403FORBIDDENRole not permitted. This route has no step-up check.
404NOT_FOUNDCase missing in the tenant.
409CASE_CLOSEDCase is COMPLETED, CANCELLED or WRITTEN_OFF.
409(agreement rule code)Agreement failed validation (for example, duplicate version of the same type).

Side effects: inserts the agreement, writes audit FINANCING_AGREEMENT_EXECUTED. A replay with the same key returns the stored agreement.