Skip to content

Contracts

Understanding Islamic financial contracts in the platform.

stateDiagram-v2
direction LR
[*] --> Draft: 📝 Create
Draft --> Active: ✅ Approve
Draft --> Rejected: ❌ Reject
Active --> Mature: 📅 Complete Term
Active --> Suspended: ⚠️ Issue Found
Suspended --> Active: 🔄 Resolve
Mature --> Settled: 💰 Final Payment
Mature --> Closed: 📋 Close
Settled --> Closed: 📁 Archive
Closed --> [*]
note right of Draft: Shariah compliance review
note right of Active: Contract in force
note right of Suspended: Under investigation
classDef green fill:#1a5f4a,color:#fff,stroke:#1a5f4a
classDef blue fill:#1565c0,color:#fff,stroke:#1565c0
classDef orange fill:#e65100,color:#fff,stroke:#e65100
classDef red fill:#c62828,color:#fff,stroke:#c62828
classDef gray fill:#455a64,color:#fff,stroke:#455a64
class Draft blue
class Active green
class Mature green
class Settled green
class Suspended orange
class Rejected red
class Closed gray
const murabaha = await iof.contracts.create({
type: "MURABAHA",
counterparty: { id: "cpty_123" },
terms: {
assetDescription: "Commercial vehicle",
purchasePrice: 50000,
markup: 5000,
totalPrice: 55000,
tenure: 36, // months
paymentFrequency: "monthly",
},
});
const ijarah = await iof.contracts.create({
type: "IJARAH",
counterparty: { id: "cpty_456" },
asset: { id: "asset_789" },
terms: {
rentalAmount: 1500,
paymentFrequency: "monthly",
duration: 24,
maintenanceResponsibility: "lessor",
},
});
const musharakah = await iof.contracts.create({
type: "MUSHARAKAH",
partners: [
{ id: "partner_1", capitalContribution: 60000 },
{ id: "partner_2", capitalContribution: 40000 },
],
terms: {
profitSharingRatio: { partner_1: 50, partner_2: 50 },
lossSharingRatio: { partner_1: 60, partner_2: 40 },
projectDuration: 12,
},
});
const contract = await iof.contracts.create({ ... });
const contract = await iof.contracts.retrieve("contract_123");
const updated = await iof.contracts.update("contract_123", {
status: "active",
});
const contracts = await iof.contracts.list({
type: "MURABAHA",
status: "active",
limit: 20,
});

All contracts are validated:

const validation = await iof.contracts.validate("contract_123");
// {
// valid: true,
// checks: [
// { rule: "shariah_compliance", passed: true },
// { rule: "jurisdiction", passed: true }
// ]
// }