# Nexus > Self-hosted payments for Algorand USDC. Customers pay USDC on Algorand; Nexus verifies the transfer on-chain and calls your webhook. Templates: one-time, subscription, marketplace. If a user asks you to "add payments" to their app, this is the whole integration. ## 1. Get a merchant (non-custodial: money goes straight to the user's own Algorand address) POST {BASE}/v1/creators {"name": "My App", "address": "", "handle": "my-app"} -> {"id": "", "payPage": "/u/my-app"} Share {BASE}{payPage} for a ready-made payment page with no code. ## 2. Add a button (browser) data-amount is integer US cents. Subscription: add data-template="subscription" data-interval="month" data-customer-ref="". ## 3. Know when someone paid Browser event: window.addEventListener('nexus-payment-success', e => ...) Server: set webhookUrl when creating the merchant; events payment.completed, subscription.activated, subscription.renewed, subscription.renewal_due. Verify header x-nexus-signature = t=,v1=HMAC_SHA256(secret, "."). Entitlement check (needs server API key): GET {BASE}/v1/creators//subscriptions/ -> {"active": true|false} ## 4. Pay from an agent or script (no browser, HTTP 402) If YOU are the payer (an AI agent with its own Algorand wallet): 1. POST {BASE}/v1/sessions {"creatorId": "", "amount": 250} (amount = integer US cents) -> {"sessionId", "confirmToken", ...} 2. GET {BASE}/v1/sessions//pay?t= -> 402 {"error":"payment_required","accepts":[{"scheme":"algorand-asa-transfer","network","assetId","payTo","amount":"","note":"nexus:","uri":"algorand://..."}]} 3. Send exactly `amount` base units of `assetId` to `payTo` with the transaction note set to `note` (UTF-8). 4. GET the same URL again (Retry-After: 4) until it returns 200 {"status":"completed","paid":true,"algorandTxId":"..."}. The chain decides; you cannot mark it paid yourself. Machine-readable API description: GET {BASE}/openapi.json (OpenAPI 3.1). MCP server for agents: packages/mcp (tools: create_merchant, create_checkout, get_session, check_subscription, get_activity, integration_snippet, get_payment_instructions). ## 5. Charge agents per call (you are the API owner) Packages/agent: app.get('/data', paywall({ baseUrl: BASE, apiKey: API_KEY, creatorId: "", priceCents: 5 }), handler) Callers without a payment get 402 with instructions; agents use payFetch(url, {}, { payer, maxPriceCents }) from the same package, which pays USDC on Algorand and retries. Each payment is verified on-chain and works once. ## Rules that matter - Prices set in the browser can be edited by the buyer. For fixed prices create the session server-side: POST {BASE}/v1/sessions with header x-nexus-api-key. - Amounts are integer cents. Currency is USD (settled as USDC). - Never mark an order paid from the browser event alone; trust the webhook or GET /v1/sessions/. - Full docs: {BASE}/ (README in the repository).