Synq
Skip to content
[ synq / docs ]Synq home

Client agreements and escrow

Wallet linking, agreement signing and funding the milestone escrow.

After a client accepts an offer, both parties sign the exact agreement with their wallets (typed data), then the client funds the escrow by sending the approve and open transactions from their own wallet. The server never holds the client's key. A deal counts as funded only when the open transaction is proven on chain. See SynqMilestoneEscrow for the contract.

The client wallet is linked by a signature over a statement the server provides. A wallet that already belongs to a workspace member is refused (CLIENT_WALLET_IS_MEMBER). The two escrow routes are registered only when the escrow is connected and answer AGREEMENT_ESCROW_UNAVAILABLE (503) otherwise; they are throttled to 30 a minute per principal.

Routes#

The statement the client wallet signs to link itself to a lead.

Route idclient.leadWalletTypedData
AuthSession (bearer or cookie)
Who may callthe lead's bound web identity (never a workspace member)
StatusIMPLEMENTED

Path parameters: leadId (UUIDs unless stated).

Query parameters

FieldTypeRequiredNotes
walletstring (^0x[0-9a-fA-F]{40}$)yesEVM address

Response (ClientWalletTypedData)

FieldTypeRequiredNotes
expiresAtISO-8601 timeyesUTC ISO-8601 timestamp
typedDataTypedDatayes

POST /v3/client/leads/{leadId}/wallet#

Link the wallet that signs and pays, proven by its own signature.

Route idclient.leadWalletLink
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callthe lead's bound web identity (never a workspace member)
StatusIMPLEMENTED

Path parameters: leadId (UUIDs unless stated).

Request body (ClientWalletLink)

FieldTypeRequiredNotes
walletstring (^0x[0-9a-fA-F]{40}$)yesEVM address
expiresAtISO-8601 timeyesUTC ISO-8601 timestamp
signaturestring (^0x[0-9a-fA-F]{130}$)yes

Response (ClientWallet)

FieldTypeRequiredNotes
walletstring (^0x[0-9a-fA-F]{40}$)yesEVM address
linkedAtISO-8601 timeyesUTC ISO-8601 timestamp

GET /v3/client/leads/{leadId}/agreement#

The agreement for the accepted offer, with the typed data to sign.

Route idclient.leadAgreement
AuthSession (bearer or cookie)
Who may callthe lead's bound web identity (never a workspace member)
StatusIMPLEMENTED

Path parameters: leadId (UUIDs unless stated).

Response (LeadAgreement)

FieldTypeRequiredNotes
clientWalletstring (^0x[0-9a-fA-F]{40}$) or nullyes
agreementAgreement or nullyes
blockedstring (max 200) or nullyesWhy no agreement exists yet, when none does

POST /v3/client/leads/{leadId}/agreement/signature#

Submit the client wallet's signature over the exact agreement.

Route idclient.leadAgreementSign
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callthe lead's bound web identity (never a workspace member)
StatusIMPLEMENTED

Path parameters: leadId (UUIDs unless stated).

Request body (AgreementSignatureSubmit)

FieldTypeRequiredNotes
agreementIduuidyes
offerVersionintegeryes
termsHashstring (^0x[0-9a-fA-F]{64}$)yes
signaturestring (^0x[0-9a-fA-F]{130}$)yes

Response (Agreement)

FieldTypeRequiredNotes
agreementIduuidyes
workspaceIduuidyes
leadIduuidyes
offerIduuidyes
offerVersionintegeryes
termsHashstring (^0x[0-9a-fA-F]{64}$)yes
agreementHashstring (^0x[0-9a-fA-F]{64}$)yes
statusAgreementStatusyes
clientWalletstring (^0x[0-9a-fA-F]{40}$)yesEVM address
ownerWalletstring (^0x[0-9a-fA-F]{40}$)yesEVM address
payeestring (^0x[0-9a-fA-F]{40}$)yesEVM address
arbiterstring (^0x[0-9a-fA-F]{40}$) or nullyes
totalMoneyyes
milestonesAgreementMilestone[]yes
expiresAtISO-8601 timeyesUTC ISO-8601 timestamp
signaturesobjectyes
signatures.clientAgreementSignature or nullyes
signatures.ownerAgreementSignature or nullyes
typedDataTypedDatayes
escrowAgreementEscrow or nullyes

POST /v3/client/leads/{leadId}/agreement/escrow#

The exact escrow approve and open calls the client wallet sends.

Route idclient.leadEscrowCall
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callthe lead's bound web identity (never a workspace member)
StatusIMPLEMENTED

Path parameters: leadId (UUIDs unless stated).

Response (EscrowCall)

FieldTypeRequiredNotes
agreementIduuidyes
chainIdintegeryes
fromstring (^0x[0-9a-fA-F]{40}$)yesEVM address
transactionsEscrowTransaction[]yes
refundAfterISO-8601 timeyesUTC ISO-8601 timestamp

POST /v3/client/leads/{leadId}/agreement/escrow/submit#

Submit the open transaction hash; funded only once proven on chain.

Route idclient.leadEscrowSubmit
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callthe lead's bound web identity (never a workspace member)
StatusIMPLEMENTED

Path parameters: leadId (UUIDs unless stated).

Request body (EscrowFundingSubmit)

FieldTypeRequiredNotes
openTxHashstring (^0x[0-9a-fA-F]{64}$)yes

Response (Agreement)

FieldTypeRequiredNotes
agreementIduuidyes
workspaceIduuidyes
leadIduuidyes
offerIduuidyes
offerVersionintegeryes
termsHashstring (^0x[0-9a-fA-F]{64}$)yes
agreementHashstring (^0x[0-9a-fA-F]{64}$)yes
statusAgreementStatusyes
clientWalletstring (^0x[0-9a-fA-F]{40}$)yesEVM address
ownerWalletstring (^0x[0-9a-fA-F]{40}$)yesEVM address
payeestring (^0x[0-9a-fA-F]{40}$)yesEVM address
arbiterstring (^0x[0-9a-fA-F]{40}$) or nullyes
totalMoneyyes
milestonesAgreementMilestone[]yes
expiresAtISO-8601 timeyesUTC ISO-8601 timestamp
signaturesobjectyes
signatures.clientAgreementSignature or nullyes
signatures.ownerAgreementSignature or nullyes
typedDataTypedDatayes
escrowAgreementEscrow or nullyes

GET /v3/workspaces/{workspaceId}/leads/{leadId}/agreement#

Agreement, signature and escrow status for a lead.

Route idworkspace.leadAgreement
AuthSession (bearer or cookie)
Who may callOWNER, ADMIN
StatusIMPLEMENTED

Path parameters: workspaceId, leadId (UUIDs unless stated).

Response (LeadAgreement)

FieldTypeRequiredNotes
clientWalletstring (^0x[0-9a-fA-F]{40}$) or nullyes
agreementAgreement or nullyes
blockedstring (max 200) or nullyesWhy no agreement exists yet, when none does

POST /v3/workspaces/{workspaceId}/leads/{leadId}/agreement/owner-signature#

Submit the owner wallet's signature over the exact agreement.

Route idworkspace.leadAgreementSign
AuthSession + Idempotency-Key (+ same origin for cookies)
Who may callOWNER
StatusIMPLEMENTED

Path parameters: workspaceId, leadId (UUIDs unless stated).

Request body (AgreementSignatureSubmit)

FieldTypeRequiredNotes
agreementIduuidyes
offerVersionintegeryes
termsHashstring (^0x[0-9a-fA-F]{64}$)yes
signaturestring (^0x[0-9a-fA-F]{130}$)yes

Response (Agreement)

FieldTypeRequiredNotes
agreementIduuidyes
workspaceIduuidyes
leadIduuidyes
offerIduuidyes
offerVersionintegeryes
termsHashstring (^0x[0-9a-fA-F]{64}$)yes
agreementHashstring (^0x[0-9a-fA-F]{64}$)yes
statusAgreementStatusyes
clientWalletstring (^0x[0-9a-fA-F]{40}$)yesEVM address
ownerWalletstring (^0x[0-9a-fA-F]{40}$)yesEVM address
payeestring (^0x[0-9a-fA-F]{40}$)yesEVM address
arbiterstring (^0x[0-9a-fA-F]{40}$) or nullyes
totalMoneyyes
milestonesAgreementMilestone[]yes
expiresAtISO-8601 timeyesUTC ISO-8601 timestamp
signaturesobjectyes
signatures.clientAgreementSignature or nullyes
signatures.ownerAgreementSignature or nullyes
typedDataTypedDatayes
escrowAgreementEscrow or nullyes

Edit this page on GitHub