Network

Guides

Clearing by period

Obligations between clearing participants, netted per netting set and settled per period — recording, proposals, caps and headroom, closing, net settlement and signed period reports.

Needs: a key that acts for a clearing participant and carries clearing. To close a set in test mode, operations and risk as well.

Clearing lets participants that owe each other many payments settle only the net. Each obligation enters the running positions of its two participants in a netting set. A set is netted by period: at the close, each participant's position is netted, a net debtor pays its net amount in, and a net creditor is paid out. Participants and their caps are set by Path Global.

The participant a key acts for

A key acts for the participant whose credentials include the key's credential. Path Global sets which participant a test key acts for.

const me = await pg.clearing.participant(); // GET /clearing/participants/me
console.log(me.id, me.status);              // "sandbox-member" "active"
console.log(me.caps);                       // per asset: net_debit_cap and its split between sets

kind is provider, partner or client, a client of Path Global that clears through it. status is pending, active, restricted, suspended or exited. A key that acts for no participant gets 404 pathglobal.clearing.participant_unknown on every clearing route. The examples below use the sandbox participants sandbox-member and meridian-markets.

Record an obligation

The debtor records what it owes:

const obligation = await pg.clearing.record(
  {
    set: 'USD@book',
    debtor: 'sandbox-member',
    creditor: 'meridian-markets',
    amount: { value: '12500.00', asset: 'USD' },
    reference: 'inv-2026-11-0042',
  },
  { idempotencyKey: 'inv-2026-11-0042' },
);
console.log(obligation.state); // "accepted"
FieldRequiredNotes
debtor, creditoryesParticipant ids: up to 53 characters of [A-Za-z0-9_.-]
amountyesNo finer than the precision of its asset
referenceyesUp to 140 characters
setnoThe netting set, <ASSET>@<network>. Default <ASSET>@book
cyclenoA cycle of the cycle surface

The body carries these fields and nothing else. 201 with the obligation.

state
proposedStated by the creditor; waits for its debtor
pendingBeing recorded
acceptedIn the running positions of the set
queuedWaits for headroom under the debtor's cap
rejectedNot recorded
settledIts period is settled
ErrorWhen
404 pathglobal.clearing.participant_unknownThe key acts for no participant
403 pathglobal.clearing.not_debtorThe caller is neither the debtor nor the creditor
422 pathglobal.clearing.cap_exceededThe obligation passes a cap of the debtor
409 pathglobal.clearing.participant_suspendedA party is suspended
409 pathglobal.core.conflictThe netting set is paused, or the obligation changed meanwhile

GET /clearing/obligations/:id reads an obligation the caller is a party of; any other answers 404.

A creditor's proposal

When the caller is the creditor, the obligation is stored proposed and has no effect until its debtor accepts it:

// with the creditor's key
const proposal = await pg.clearing.record({ debtor: 'sandbox-member', creditor: 'meridian-markets', amount, reference: 'fee-2026-11' });

// with the debtor's key: POST /clearing/obligations/:id/accept
const accepted = await pg.clearing.accept(proposal.id);

An accepted proposal is recorded as if the debtor had sent it. Only the debtor accepts.

Caps, headroom and the queue

A participant's cap bounds what it may owe: a net debit cap per asset, split between its netting sets, with optional bilateral bounds and a net credit cap. The headroom is what the cap leaves once the running positions are counted.

An obligation recorded through POST /obligations past the debtor's headroom is refused with 422 pathglobal.clearing.cap_exceeded. An obligation Path Global records for the participant can wait for headroom instead: it is queued, and it is recorded when headroom frees up. GET /clearing/queue lists the caller's queued obligations, in the order they are retried.

Netting sets and periods

A netting set is written <ASSET>@<network>: the asset and the network the set settles on. USD@book settles on the Path Global ledger. In the sandbox a set is created on first use.

const sets = await pg.clearing.sets();            // GET /clearing/sets
const periods = await pg.clearing.periods('USD@book'); // GET /clearing/periods?set=

A set has settles_on_network, the network it settles on, cutoffs (UTC HH:MM) and a status (active or paused). A period is written <set>#<seq>, for instance USD@book#14.

Period state
openTakes obligations
closedNetted; waits for settlement
settlingIts net positions are being paid in and out
settledEvery position is settled
partially_settledWhat remains is carried to the next period (carried)

Closing a period

A period closes at a cut-off of its set, or earlier under the terms of the set. The next period starts at once, from zero.

In test mode a key with operations and risk closes the open period of a set now, and settles a closed period as far as it can be now:

const closed = await pg.operations.closeSet('USD@book');        // POST /operations/clearing/sets/:id/close
const settled = await pg.operations.settlePeriod(closed.id);    // POST /operations/clearing/periods/:id/settle
curl -s -X POST "https://api.pathglobal.finance/operations/clearing/sets/USD%40book/close" \
  -H "Authorization: Bearer $PATHGLOBAL_TEST_KEY" \
  -H "Path-Version: 2026-11-26.genesis"

Ids in a path are URL-encoded: @ is %40 and # is %23. In live mode these two routes are available to a key whose agreement includes operator access, and every request carries the signature of a registered operator.

Reading a period

{
  "id": "USD@book#14",
  "kind": "clearing.period",
  "set": "USD@book",
  "seq": 14,
  "status": "closed",
  "state": "settled",
  "opened_at": "2026-11-19T00:00:00.000Z",
  "closed_at": "2026-11-19T17:00:00.000Z",
  "gross": { "value": "4200000.00", "asset": "USD" },
  "positions": [
    { "participant": "sandbox-member", "asset": "USD", "net": "-180000.00" },
    { "participant": "meridian-markets", "asset": "USD", "net": "180000.00" }
  ],
  "netting_efficiency": 0.957142,
  "instructions": ["in_…"],
  "report": "…"
}
FieldNotes
positionsThe net position of each participant at the close: negative for a net debtor
grossThe sum of the obligations netted
netting_efficiency1 − net / gross, between 0 and 1
instructionsThe executions of the period: read them with GET /settlement/executions/:id
carriedPositions carried to the next period

GET /clearing/positions answers the caller's running positions in the open periods: { positions: [{ participant, asset, net }] }.

Net settlement

At the close, a net debtor pays its net amount to the settlement account of the set, under the rail reference

ns.<asset>.<network>.<seq>.<participant>

for instance ns.USD.fedwire.14.sandbox-member for period USD@fedwire#14. Pay under that exact reference. A net creditor is paid out by an execution of the period, or stays credited on the book when it has no settlement account for the set. On <ASSET>@book, the net positions settle on the ledger.

Signed period reports

GET /clearing/periods/:id/report, or pg.clearing.report(id), answers the signed report of a settled period: its state, gross, positions, the transfers between participants, netting_efficiency, instructions and carried, with protocol_version, signed_at, kid and signature. Verify it as any signed object of Path Global (Route a payment).

On this page