executeAgentPayment
PQSafe AgentPay API Reference v0.1.0
PQSafe AgentPay API Reference / executeAgentPayment
Function: executeAgentPayment()
executeAgentPayment(
signed,request,railConfig?,approvalRequest?):Promise<PaymentResult>
Defined in: pqsafe/agent-pay/src/index.ts:101
Verify a PQ-signed SpendEnvelope and execute the payment if all checks pass.
Checks performed (in order):
- ML-DSA-65 signature verification
- Zod schema validation
- Temporal validity (validFrom / validUntil)
- Recipient allowlist check
- Amount ceiling check (request.amount <= envelope.maxAmount) 5b. Human approval gate (if approvalRequest provided, or amount >= requiresApprovalAbove)
- Route to rail connector
Parameters
signed
request
railConfig?
approvalRequest?
Optional approval gate config. If omitted and amount is below any configured threshold, the payment executes immediately. If provided, the payment is blocked until a human approves via the configured channels.
Returns
Promise<PaymentResult>
Throws
if approval is rejected
Throws
if approval times out
Throws
if any other check fails — payments are only attempted if ALL checks pass.