GitHub
PATH CONNECT

SDK reference

Connections

createConnection, consume, revoke, and the delegations cut from a grant.

The object model is PATH CONNECT. The HTTP surface is Connections.

Every method here requires a credential.

createConnection(input)

You are the grantor.

const connection = await path.createConnection({
  grantee: 'member-b',
  subjectId: '9f2c41a8-6d1e-4b07-9c3a-2e5f81d0a4b7',
  capabilities: { payment_request: true },
  mode: 'persistent_consent',
  maxSingle: '100000',
  maxTotal: '500000',
  currency: 'USD',
  expiresAt: '2027-01-01T00:00:00Z',
});

A capability that is absent is denied. Pass schedule and the object is a path.mandate.

getConnection(reference)

Either party. Returns the signed connection. Read the terms from consent.

consumeConnection(reference, input)

You are the grantee.

await path.consumeConnection(connection.reference, {
  capability: 'payment_request',
  amount: '5000',
  currency: 'USD',
  operationRef: 'ledger-4412',
});

A refusal arrives as path.connect.delegation_out_of_scope or path.connect.delegation_limit_reached.

revokeConnection(reference, reason?)

Either party. You withdraw it as grantor, or renounce it as grantee. It takes effect at the next consumeConnection.

connectionUsage(reference, limit?)

What was done under the grant. limit defaults to 100.


Delegations

A delegation is for a third party. The grantee already consumes the connection itself.

createDelegation(connectionReference, input)

You are the grantor. The four bind fields are required.

const token = await path.createDelegation(connection.reference, {
  delegate: 'member-c',
  capability: 'payment_request',
  amount: '5000',
  currency: 'USD',
  destinationCommitment: commitment,
  maxTotal: '15000',
});

getDelegation(reference)

Read the terms from binds.

consumeDelegation(reference, input)

You are the named delegate. The body matches binds_to exactly. A smaller amount is a different operation.

revokeDelegation(reference, reason?)

Grantor, delegate, or the parent grantee.

delegationUsage(reference, limit?)

Same role as connectionUsage, for one token.

On this page