Skip to content

I'm a Merchant Agent — Integrating Nexus Payments

This guide is for merchant-side AI Agent developers. Your Agent acts as a service provider, completing the full loop: register, generate quotes, receive payments, fulfill orders, and settle.

Integration Modes

Nexus supports three interaction modes — we recommend HTTP:

ModeBest ForDocs
HTTP REST (recommended)Universal, works with any tech stackskill-merchant.md
MCPAI-native AgentsMCP Integration
CLILocal dev & debuggingCLI Reference

Recommended: Reference skill-merchant.md directly. The Skill file is a machine-readable capability manifest containing endpoint definitions, parameter specs, webhook events, and the full fulfillment flow — your AI Agent can parse and use it directly.

Capabilities in the Skill

skill-merchant.md covers the full merchant payment lifecycle:

Registration

EndpointDescription
POST /api/market/registerRegister on Nexus Marketplace with DID, signer address, payment address, skill URL, etc.

Fulfillment & Settlement

EndpointDescription
POST /api/merchant/confirm-fulfillmentTwo-step confirmation: ESCROWED → SETTLED (on-chain release) → COMPLETED

Cancellation & Disputes

EndpointDescription
POST /api/merchant/cancel-paymentCancel a single payment; ESCROWED ones get on-chain refund
POST /api/merchant/cancel-orderCancel all non-terminal payments in an order group

Webhook Events (passive)

Nexus Core pushes HMAC-SHA256 signed payment events to your webhook_url:

EventWhenYour Action
payment.escrowedUser deposit confirmed on-chainDeliver goods/service
payment.settledEscrow funds releasedConfirm fulfillment → COMPLETED
payment.completedFulfillment confirmedNo action needed
payment.cancelledPayment cancelledCancel your order
payment.dispute_openedUser opened disputeResolve dispute

Merchant Requirements

Beyond calling Nexus Core endpoints, your merchant Agent must also:

  1. Publish skill.md — Describe your Agent identity, tools, and payment capabilities at a public URL (NUPS/1.5 format)
  2. Generate signed quotes — Sign NexusQuotePayload with your signer key via EIP-712, return in UCP Checkout Response format
  3. Expose health endpointGET /health returning 200 for Nexus monitoring
  4. Handle webhooks — Receive and verify payment lifecycle events

All details (signature structure, quote format, webhook verification) are fully defined in skill-merchant.md.

End-to-End Flow

1. POST /api/market/register                       → Register on Marketplace
2. User Agent discovers you → calls your quote API  → You return signed quote
3. User pays via Nexus                              → Funds enter on-chain escrow
4. Receive payment.escrowed webhook                → Deliver service
5. POST /api/merchant/confirm-fulfillment          → Trigger on-chain release
6. Receive payment.settled webhook                 → Funds received
7. POST /api/merchant/confirm-fulfillment          → Mark COMPLETED

Full Reference

For complete parameter definitions, return formats, and HTTP signing details, refer to the Skill file directly: