Skip to content

Contracts

Understanding Islamic financial contracts in the platform.

Contract Lifecycle

Contract Types

Murabaha (Cost-Plus Sale)

typescript
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",
  },
});

Ijarah (Leasing)

typescript
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",
  },
});

Musharakah (Partnership)

typescript
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,
  },
});

Contract Operations

Create

typescript
const contract = await iof.contracts.create({ ... });

Retrieve

typescript
const contract = await iof.contracts.retrieve("contract_123");

Update

typescript
const updated = await iof.contracts.update("contract_123", {
  status: "active",
});

List

typescript
const contracts = await iof.contracts.list({
  type: "MURABAHA",
  status: "active",
  limit: 20,
});

Compliance Checks

All contracts are validated:

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

Next Steps

Licensed under the Apache License 2.0