Tasks
Tasks
Payments

Settle this task's channel with the payer's cumulative voucher

Liquidates a payment channel whose pay.sh session is gone. The payer signs a cumulative voucher with the channel's session key; EM verifies it against the channel's on-chain authorized signer, asks the pay.sh gateway — the channel's fee payer — to broadcast [ed25519, settle, distribute], and then reads the transaction back from the chain to confirm the worker was credited. Neither settle nor distribute takes a signer account, so nobody here gains any authority: without the payer's signature the money cannot move, and with it anyone could submit the same transaction.

EM names the recipients it asks the gateway to pay — the assigned worker's Solana payout address and the platform's worker share in basis points — and the gateway hashes them against the channel's on-chain distributionHash before broadcasting. When any of that is refused, the gateway's own JSON answer travels back NESTED under detail.gateway, uncut, next to the human-readable message.

post/api/v1/tasks/{task_id}/channel/settle

Request

  • Base URL: https://api.execution.market
  • URL: https://api.execution.market/api/v1/tasks/{task_id}/channel/settle
  • Auth: API key in header Signature-Input

Path parameters

task_idstring required

UUID of the task

Request body

channel_idstring required

Channel to settle (base58). Must be the one bound to this task.

cumulative_uusdcinteger required

Total the voucher commits, in micro-USDC, counted from the channel open — cumulative, not incremental. Must exceed what is already settled on chain and must not exceed the deposit.

expires_atinteger required

Unix seconds after which the voucher is void. The program enforces it when the transaction lands, so leave real margin (an hour); EM refuses anything expiring within 60 seconds.

signaturestring required

Base58 of the 64-byte raw ed25519 signature of the session key over voucher_message_bytes(channel_id, cumulative_uusdc, expires_at) — 50 bytes: magic 0x5601 | channelId(32) | u64 LE | i64 LE. Not the JSON, no personal_sign prefix, not base64.

session_pubkeystring nullable

Optional. The key you signed with. Only ever CHECKED against the channel's on-chain authorized signer, so a mismatch reports itself instead of arriving as a bare 'invalid signature'.

Response

Channel settled on chain, or already was

successboolean

Whether the operation succeeded

messagestring required

Human-readable result message

dataobject nullable

Additional response data

Changes

No recorded changes to this operation across all 1 revision of this API.