Network

SDK reference

Settlement

pg.settlement — SETTLs, signed receipts, executions, guarantee levels, and payment versus payment or delivery versus payment exchanges.

Scope settlement. A SETTL, its receipt and its execution are read by the client its route belongs to; the execution of an exchange by the client that submitted it. Another client's object is 404 pathglobal.core.not_found.

CallReturns
get(id)SettlementOne SETTL: the settlement obligation of one route
find(reference)Settlement[]The SETTLs a reference belongs to: a rail reference, a route, the reference of an intent, or the PATH instruction a route pays. At least 4 characters
receipt(id)ReceiptThe signed settlement receipt of a settled route
execution(id)ExecutionOne execution: its legs, where its value sits, its state
executions(settl)Execution[]The executions behind a SETTL
guarantees(query)GuaranteeAnswerThe guarantee level of an exchange received on one kind of network and delivered on another
exchange(input)ExecutionA payment versus payment or a delivery versus payment

instruction(id) and instructions(settl) are the names of execution and executions in 0.3.0, and answer the same.

SETTLs

A Settlement names its route, its funding, its execution, its guarantee, the legs and their rail references, and holding: where its value sits, one entry per asset. When a route does not deliver, held gives the value it stopped with, and failure_reason the reason of the first leg that failed (a RailReason), provider for a conversion that failed, or expired. refs holds the route, the reference of the intent, the PATH instruction a route to a PATH destination pays, and every rail reference.

Receipt is Path Global's settlement receipt. A route to a PATH destination also has a payer path.receipt, named by route.payer_receipt (pg.router).

State
funded, review, routed, liquidity_locked, executing, sentOn its way
in_doubtThe outcome of a leg is not known yet; holds stay, nothing is sent again
confirmed, finalDelivered
closedTerminal
provider_failed, settlement_failed, reroutingA leg failed; the route is carried another way or refunded
refund_required, refunding, manual_reviewrefund_required is not terminal: it moves to refunding, closed or manual_review
expiredTerminal

history lists each state with its instant.

Executions

An Execution (kind: 'pathglobal.execution') is how a SETTL, a clearing period, a treasury transfer or an exchange is carried out by Path Global. It is not a payment instruction of the PATH protocol: that is route.path_instruction. Instruction, InstructionKind and InstructionState are the names of Execution, ExecutionKind and ExecutionState in 0.3.0.

Field
typepayment, pvp, dvp, transfer, net_settlement, return
modecapture_on_final (the pay-in is captured when the pay-out is final) or commit_first
guaranteeThe level of the execution
legsSettlementLeg[]: role (pay_in, exchange, pay_out, move, pay_provider), amount, state
holdingSettlementHolding[]: where the value sits, one account per asset
stateExecutionState
historyEach state, its instant and its cause

SettlementHolding is where the value of an execution sits. It is not the holding of an Omni Account (Holding).

Execution states: created, admitted, review, awaiting_funds, preparing, prepared, committed, delivering, in_doubt, rerouting, settled, aborting, aborted, abort_blocked, delivery_blocked, unwinding, unwound. Leg states: pending, securing, secured, submitted, unknown, final, failed, released, returning, returned, blocked.

Guarantee levels

const answer = await pg.settlement.guarantees({ in: 'book', out: 'irrevocable_instant' });
answer.guarantee; // 'atomic' | 'conditional' | 'receipt_first' | 'value_dated' | 'bounded_exposure'

GuaranteeQuery takes in and out, and the flags lockable_in, lockable_out, same_chain_tx, out_final_within_hold and provider_delivers, with network kinds book, blockchain, irrevocable_instant, deferred and revocable. The level of an exchange is the weaker of its two directions. Guarantee levels gives what each level promises.

Exchanges

exchange takes an ExchangeRequest:

Field
typepvp or dvp
referenceUp to 140 characters. The same request under one reference returns the same execution
timeout_secondsUp to 86400
a, bOne ExchangeSide each

An ExchangeSide is { party, gives, on, from, receives_at, asset_role?, verdict, subject }:

Field
partyWho gives this side
gives, onThe amount, and the node it is given on ({ asset, network })
fromclient:-:<holding>:<asset> for a holding of the caller, participant:<network>:<participant>:<asset> for the participant the caller acts for, or { network, identifier, holder? }
receives_atAn account reference of the same form, or an endpoint
asset_rolecash or asset, for a dvp
verdictA passing Proof verdict for this side
subject{ amount, from, to, networks?, partners?, providers?, payer?, payee?, destination_digest?, client? }: what the verdict was given for
const execution = await pg.settlement.exchange({
  type: 'pvp',
  reference: 'fx-2026-0042',
  a: {
    party: 'acme', gives: { value: '1000.00', asset: 'USD' }, on: { asset: 'USD', network: 'book' },
    from: `client:-:${usd.id}:USD`, receives_at: `client:-:${eur.id}:EUR`,
    verdict: verdictA.id, subject: { amount: { value: '1000.00', asset: 'USD' }, from: { asset: 'USD', network: 'book' }, to: { asset: 'EUR', network: 'book' } },
  },
  b: { /* the other side, in EUR */ },
});
execution.guarantee; // 'atomic' when both pay-ins are on the book

exchange takes no idempotency key: it is idempotent per caller and reference.

CodeStatusWhen
pathglobal.core.conflict409Other content under a reference already used
pathglobal.core.not_found404A from the caller does not own
pathglobal.settlement.guarantee_unavailable422A leg cannot be secured at the level the exchange needs
pathglobal.risk.verdict_invalid422A verdict is not valid for its side

The guide is Settlement and exchanges, the recipe A payment versus payment. The routes are on Settlement.

On this page