docs getting started quickstart

Quickstart

Get your first USDC payment settled in under 10 minutes. No blockchain knowledge required — Proco handles chain routing, gas, and compliance automatically.

1. Install the SDK

bash
npm install @proco/sdk

The SDK includes TypeScript types, built-in retry logic, and helpers for all four Proco primitives.

2. Set up authentication

Create an API key from the Proco dashboard. All API keys start with proco_live_ for production and proco_test_ for sandbox.

typescript
import { Proco } from '@proco/sdk';

const proco = new Proco({
  apiKey: process.env.PROCO_API_KEY,
});

Sandbox mode: Using a proco_test_ key puts Proco into sandbox mode. All API calls behave identically, but no real USDC is moved and chain activity is simulated.

3. Create your first payment

Call proco.payments.create() with a recipient address, amount, and currency. Proco handles chain selection, gas, and compliance automatically.

typescript
const payment = await proco.payments.create({
  to: '0x742d35Cc6634C05...',  // recipient USDC address
  amount: '500.00',           // USDC amount
  currency: 'USDC',
  chain: 'auto',             // auto-route to fastest/cheapest
  compliance: 'auto',        // handle KYC/AML automatically
  memo: 'Invoice #1042',
});

console.log(payment.txHash);  // 0x4a2f...
console.log(payment.status);  // 'settled'
console.log(payment.settled_at);  // ~8-28s later

Response

{
  "id": "pay_01HXYZ...",
  "status": "settled",
  "txHash": "0x4a2f1c...",
  "amount": "500.00",
  "currency": "USDC",
  "chain": "base",
  "settled_at": "2026-03-24T14:32:08Z",
  "settlement_ms": 8240,
  "compliance_ref": "cpl_01HX..."
}

Core primitives

Proco exposes four programmable primitives. Every payment product can be built from some combination of these four.

payments

Payments

Send USDC to any address on any supported chain. Trigger on events, schedules, or conditions.

wallets

Wallets

Create programmable wallets for users, agents, or treasury accounts. Non-custodial by default.

treasury

Treasury

Set routing rules, yield destinations, and reserve thresholds for USDC balances.

compliance

Compliance

Run KYC, KYB, AML screening, and sanctions checks. Returns a compliance reference attached to each settlement.

Agent payments guide

For AI agents, the key is creating agent-owned wallets and authorizing autonomous spending without human approval at every step.

typescript
// 1. Create a wallet for your agent
const agentWallet = await proco.wallets.create({
  owner: 'agent:orchestrator-01',
  chain: 'solana',       // fastest for micropayments
  spend_limit: '10.00', // max USDC per 24h, no approval
  compliance: 'auto',
});

// 2. Agent pays for compute autonomously
const payment = await proco.payments.create({
  from: agentWallet.address,
  to: 'llm-provider:node-04',
  amount: '0.0012',
  currency: 'USDC',
  chain: 'solana',
  memo: '4096 tokens · task:img-gen-029',
});

On Solana, Proco p99 settlement is 0.4 seconds at $0.00003 gas. This makes sub-cent billing viable for the first time — an agent can pay per compute call without batching.

Webhooks

Proco sends a payment.settled webhook to your endpoint when every transaction settles. Webhooks are HMAC-signed for verification.

typescript
// Verify and handle webhook
app.post('/webhooks/proco', (req, res) => {
  const event = proco.webhooks.verify({
    payload: req.body,
    signature: req.headers['proco-signature'],
    secret: process.env.PROCO_WEBHOOK_SECRET,
  });

  if (event.type === 'payment.settled') {
    const { txHash, amount, settled_at } = event.data;
    // update your records
  }

  res.json({ received: true });
});

Error handling

Proco throws typed errors so you can handle each failure mode explicitly. All errors include a code, message, and optional compliance_ref.

typescript
import { ProcoError } from '@proco/sdk';

try {
  await proco.payments.create(...);
} catch (err) {
  if (err instanceof ProcoError) {
    switch (err.code) {
      case 'compliance_blocked':
        // OFAC / sanctions match
        break;
      case 'insufficient_balance':
        // wallet needs funding
        break;
      case 'chain_unavailable':
        // retry on alternate chain
        break;
    }
  }
}