Network

SDK reference

Clearing

pg.clearing — the participant a key acts for, obligations and proposals, positions and the queue, netting sets, periods and their signed reports.

Scope clearing. A key acts for the participant whose credentials include the key's credential. A key that acts for no participant is 404 pathglobal.clearing.participant_unknown. Participants and their caps are set by Path Global.

CallReturns
participant()ParticipantThe participant the key acts for: its kind (provider, partner or client), status, settlement accounts, caps and collateral
record(input, opts?)Obligation & Partial<ClearingObligation>Records an obligation. The debtor's call records it; a creditor's call stores a proposal its debtor accepts
accept(id)ClearingObligationThe debtor accepts a proposal
obligation(id)ClearingObligationOne obligation of which the participant is debtor or creditor
positions()ClearingNetPosition[]The running net positions of the participant, per asset
queue()ClearingObligation[]The participant's obligations that wait for cap headroom
sets()NettingSet[]The netting sets: asset, settles_on_network (the network each settles on), cut-offs, status
periods(set?)ClearingPeriod[]The periods, of one set or of all
period(id)ClearingPeriodOne period: state, gross, net positions, netting_efficiency, and in instructions the executions that settle it
report(id)ClearingReportThe signed report of a settled period
cycles()Cycle[]The clearing cycles
current()CycleThe open cycle
cycle(id)CycleOne cycle, with its obligations
close(id)CycleTest mode only. Closes a cycle
settle(id)CycleTest mode only. Settles a closed cycle

Recording an obligation

const me = await pg.clearing.participant();

const obligation = await pg.clearing.record(
  {
    debtor: me.id,
    creditor: 'meridian-markets', // a sandbox participant
    amount: { value: '25000.00', asset: 'USD' },
    reference: 'inv-2026-114',
    set: 'USD@book',
  },
  { idempotencyKey: 'inv-2026-114' },
);
obligation.state; // 'accepted' (a creditor's call answers 'proposed'; past the cap the call fails with 422 pathglobal.clearing.cap_exceeded)

record takes { set?, cycle?, debtor, creditor, amount, reference }. The caller's participant is the debtor, or the creditor, whose call stores a proposed obligation. An obligation is proposed, pending, accepted, queued, rejected or settled.

CodeStatusWhen
pathglobal.clearing.participant_unknown404The key acts for no participant
pathglobal.clearing.not_debtor403record: the caller is not a party; accept: the caller is not the debtor of the proposal
pathglobal.clearing.cap_exceeded422The obligation passes a cap of the participant
pathglobal.clearing.participant_suspended409A party is suspended
pathglobal.clearing.cycle_closed409The cycle is closed or settled

Sets, periods and reports

A netting set is <ASSET>@<network>; the default set of an asset is <ASSET>@book. A period is <set>#<seq>; pass it as it is, the client encodes it. A period is open, closed, settling, settled or partially_settled. It closes at a cut-off of its set; in test mode, operations.closeSet closes it now.

A net debtor pays its net position under the rail reference ns.<asset>.<network>.<seq>.<participant>. A settled period has a signed ClearingReport: its net positions, the transfers, netting_efficiency (between 0 and 1), the executions that settle it and what is carried to the next period.

The guide is Clearing by period, the recipe Close a clearing period. The routes are on Clearing.

On this page