Settlements can also be viewed and monitored in the KeyStone Dashboard. Use the SDK for programmatic creation and automation.
create
Direct settlement creation when both parties are known by a single platform.Direct creation vs. bilateral instructions: Use
settlements.create() when your platform knows both parties upfront (single-platform use case). For cross-platform settlements - or when counterparties submit independently - use instructions.submit(). The bilateral instruction flow is the recommended approach for most integrations.Parameters
| Field | Type | Required | Description |
|---|---|---|---|
idempotencyKey | string | Yes | Unique key for safe retries |
templateSlug | string | Yes* | Template slug (provide slug or ID, not both) |
templateId | string | Yes* | Template UUID |
externalReference | string | No | Your internal trade reference |
parties | SettlementPartyInput[] | Yes | All parties in the settlement |
legs | SettlementLegInput[] | Yes | All legs (asset deliveries and payments) |
timeoutAt | string | Yes | ISO 8601 settlement timeout |
SettlementPartyInput
| Field | Type | Required | Description |
|---|---|---|---|
role | string | Yes | Party role (e.g., "seller", "buyer") |
externalReference | string | Yes | Your internal account ID |
walletAddress | string | Yes | On-chain wallet (for compliance screening) |
name | string | No | Display name |
chainId | number | No | Blockchain network |
SettlementLegInput
| Field | Type | Required | Description |
|---|---|---|---|
legType | string | Yes | "asset_delivery" or "payment" |
instrumentId | string | Yes | Token address, ISIN, or currency code |
quantity | string | Yes | Amount (string for precision) |
direction | "deliver" | "receive" | Yes | Transfer direction |
partyRole | string | Yes | Which party owns this leg |
chainId | number | No | Blockchain network |
tokenStandard | string | No | e.g., "ERC-20", "ERC-3643" |
externalReference | string | No | External leg reference |
get
Fetch a settlement by ID with parties and legs.SettlementRead
| Field | Type | Description |
|---|---|---|
id | string | Settlement UUID |
state | SettlementState | Current lifecycle state |
templateId | string | Template UUID |
templateVersion | number | Template version at creation time |
externalReference | string | null | Your trade reference |
parties | SettlementParty[] | All parties with roles and status |
legs | SettlementLeg[] | All legs with amounts and status |
timeoutAt | string | When the settlement times out |
createdAt | string | Creation timestamp |
updatedAt | string | Last update timestamp |
parentSettlementId | string | null | For repo closing legs |
settlementCategory | string | null | "repo_open", "repo_close", or null |
maturityAt | string | null | Repo maturity date |
repoMetadata | object | null | Repo rate, repayment amount |
SettlementState
INSTRUCTED, COMPLIANCE_CHECKING, COMPLIANCE_CLEARED, AWAITING_DEPOSITS, EXECUTING_SWAP, FINALIZED, ROLLED_BACK, TIMED_OUT
list
Paginated list with optional state filter.| Field | Type | Default | Description |
|---|---|---|---|
state | SettlementState | - | Filter by state |
limit | number | 50 | Max items per page |
offset | number | 0 | Items to skip |
listEvents
State transition history for a settlement.SettlementEventRead
| Field | Type | Description |
|---|---|---|
id | string | Event UUID |
sequence | number | Event sequence number |
fromState | string | null | Previous state (null for initial event) |
toState | string | State after this transition |
triggeredBy | string | What triggered it (e.g., "system:engine", "m2m:platform") |
contentHash | string | SHA-256 evidence hash |
createdAt | string | Timestamp |
submitComplianceDecision
Approve or reject a settlement flagged during compliance screening.COMPLIANCE_CHECKING state with a flagged party.
getRelated
Get the opening and closing legs of a repo settlement pair.{ opening: SettlementRead | null, closing: SettlementRead | null }.