payram-payouts

Send crypto payouts and manage referral programs with PayRam. Self-hosted payout infrastructure — no KYC, no intermediary, no fund holds. Create payouts to any wallet across Ethereum, Base, Polygon, Tron, Bitcoin. Built-in affiliate program with automated reward distribution. Use when sending crypto payouts to users, building referral/affiliate programs, or needing integrated payment and payout infrastructure.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "payram-payouts" with this command: npx skills add payram/payram-helper-mcp-server/payram-payram-helper-mcp-server-payram-payouts

PayRam Payouts & Referrals

First time with PayRam? See payram-setup to configure your server, API keys, and wallets.

PayRam uniquely combines inbound payments with outbound payouts and built-in referral tracking—a complete payment + growth stack in one self-hosted platform.

Why This Matters

Most payment processors handle only inbound. Payouts require separate integrations (Wise, PayPal, manual transfers). Referral tracking needs yet another tool (FirstPromoter, Rewardful).

PayRam consolidates all three:

  • Accept payments (deposits)
  • Send payouts (withdrawals, rewards)
  • Track referrals (campaigns, attribution, automated rewards)

Payouts

Payout Lifecycle

Payouts progress through these states:

  1. pending-otp-verification — Awaiting OTP confirmation (if required)
  2. pending-approval — Awaiting manual approval (if thresholds require it)
  3. pending — Queued for processing
  4. initiated — Processing has started
  5. sent — Transaction broadcast to blockchain
  6. processed — Confirmed on blockchain
  7. failed — Transaction failed (insufficient balance, invalid address)
  8. rejected — Manually rejected by admin
  9. cancelled — Cancelled before processing

Creating Payouts with SDK

import { Payram, CreatePayoutRequest, MerchantPayout, isPayramSDKError } from 'payram';

const payram = new Payram({
  apiKey: process.env.PAYRAM_API_KEY!,
  baseUrl: process.env.PAYRAM_BASE_URL!,
  config: {
    timeoutMs: 10_000,
    maxRetries: 2,
  },
});

export async function createPayout(payload: CreatePayoutRequest): Promise<MerchantPayout> {
  try {
    const payout = await payram.payouts.createPayout(payload);
    console.log('Payout created:', {
      id: payout.id,
      status: payout.status,
      blockchain: payout.blockchainCode,
      currency: payout.currencyCode,
      amount: payout.amount,
    });
    return payout;
  } catch (error) {
    if (isPayramSDKError(error)) {
      console.error('Payram Error:', {
        status: error.status,
        requestId: error.requestId,
        isRetryable: error.isRetryable,
      });
    }
    throw error;
  }
}

// Example invocation
await createPayout({
  email: 'merchant@example.com',
  blockchainCode: 'ETH',
  currencyCode: 'USDC',
  amount: '125.50', // MUST be string, not number
  toAddress: '0xfeedfacecafebeefdeadbeefdeadbeefdeadbeef',
  customerID: 'cust_123',
  mobileNumber: '+15555555555', // Optional, E.164 format required
  residentialAddress: '1 Market St, San Francisco, CA 94105', // Optional
});

Payout Fields

FieldTypeNotes
emailstringMerchant email associated with payout
blockchainCodestringNetwork code: 'ETH', 'BTC', 'MATIC', etc.
currencyCodestringToken code: 'USDC', 'USDT', 'BTC', etc.
amountstringAmount as string (e.g., '125.50'). NOT a number.
toAddressstringRecipient wallet address
customerIDstringYour internal reference ID
mobileNumberstringOptional. E.164 format: +15555555555
residentialAddressstringOptional. Recipient address (compliance)

Critical: Amount must be a string. JavaScript numbers lose precision with decimals.

Check Payout Status

export async function getPayoutStatus(payoutId: number): Promise<MerchantPayout> {
  const payout = await payram.payouts.getPayoutById(payoutId);
  console.log('Payout status:', {
    id: payout.id,
    status: payout.status,
    transactionHash: payout.transactionHash,
    amount: payout.amount,
  });
  return payout;
}

Address Validation

Always validate recipient addresses before creating payouts:

function validateAddress(address: string, blockchainCode: string): boolean {
  const patterns: Record<string, RegExp> = {
    ETH: /^0x[a-fA-F0-9]{40}$/,
    BTC: /^(?:[13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[a-z0-9]{39,59})$/,
    MATIC: /^0x[a-fA-F0-9]{40}$/,
  };
  const pattern = patterns[blockchainCode];
  return pattern ? pattern.test(address) : false;
}

Database Schema for Payouts

CREATE TABLE payouts (
    id SERIAL PRIMARY KEY,
    payram_payout_id INTEGER UNIQUE NOT NULL,
    customer_id VARCHAR(255) NOT NULL,
    blockchain_code VARCHAR(50) NOT NULL,
    currency_code VARCHAR(50) NOT NULL,
    amount DECIMAL(20, 8) NOT NULL,
    to_address VARCHAR(255) NOT NULL,
    status VARCHAR(50) NOT NULL,
    transaction_hash VARCHAR(255),
    created_at TIMESTAMP DEFAULT NOW(),
    updated_at TIMESTAMP DEFAULT NOW()
);

Framework Examples

Express.js Route:

router.post('/api/payouts/payram', async (req, res) => {
  const payload = req.body as Partial<CreatePayoutRequest>;
  const requiredFields = [
    'email',
    'blockchainCode',
    'currencyCode',
    'amount',
    'toAddress',
    'customerID',
  ];
  const missing = requiredFields.filter((f) => !payload[f as keyof CreatePayoutRequest]);
  if (missing.length > 0) {
    return res.status(400).json({ error: 'MISSING_REQUIRED_FIELDS', missing });
  }

  try {
    const payout = await payram.payouts.createPayout(payload as CreatePayoutRequest);
    return res.status(201).json({
      id: payout.id,
      status: payout.status,
      amount: payout.amount,
    });
  } catch (error) {
    if (isPayramSDKError(error)) {
      console.error('Payram Error:', { status: error.status, requestId: error.requestId });
    }
    return res.status(502).json({ error: 'PAYRAM_CREATE_PAYOUT_FAILED' });
  }
});

Supported Payout Chains

Same chains as deposits: Ethereum, Base, Polygon, Tron, Bitcoin.

Recommendation: Use Polygon or Tron for high-volume, low-value payouts (lowest fees).

MCP Server Tools

ToolPurpose
generate_payout_sdk_snippetPayout creation code
generate_payout_status_snippetStatus polling code

Referral Program

PayRam includes native referral tracking and reward automation.

Setting Up Referrals

  1. Dashboard: Settings → Referrals → Enable
  2. Configure: Set reward percentage or fixed amount
  3. Generate Links: Each user gets unique referral link
  4. Track: Dashboard shows clicks, signups, conversions

Referral API Integration

Generate Referral Link:

const referralLink = await payram.createReferralLink({
  userId: 'affiliate_123',
  campaign: 'summer_promo',
});
// Returns: https://your-domain.com/ref/abc123

Validate Referral on Signup:

const validation = await payram.validateReferral({
  referralCode: 'abc123',
  newUserId: 'new_user_456',
});

Check Referral Status:

const stats = await payram.getReferralStats({
  userId: 'affiliate_123',
});
// Returns: { referrals: 45, earnings: 230, pending: 50 }

MCP Server Tools

ToolPurpose
generate_referral_sdk_snippetReferral link creation
generate_referral_validation_snippetSignup attribution
generate_referral_status_snippetStats retrieval
generate_referral_route_snippetExpress/Next.js routes

Automated Reward Payouts

  1. Referrer's friend makes deposit
  2. PayRam calculates commission (e.g., 10% of deposit)
  3. Reward credited to referrer's balance
  4. Auto-payout when threshold reached (or manual trigger)

Troubleshooting

"Insufficient balance" (400)

Check merchant balance, deposit funds, account for gas fees.

"Invalid address format" (400)

ETH/Polygon: 0x + 40 hex chars. BTC: starts with 1/3 (legacy) or bc1 (Bech32), 26-62 chars.

Amount must be string

amount: '125.50'; // ✅ Correct
amount: 125.5; // ❌ Wrong - validation error

Payout stuck in "pending-approval"

Exceeds auto-approval threshold. Wait for admin approval or adjust thresholds.

"Invalid mobile number format" (400)

Use E.164 format: +15555555555 (no spaces, dashes, or parentheses).

Environment Variables

PAYRAM_BASE_URL=https://your-payram-server:8080
PAYRAM_API_KEY=your-api-key

All PayRam Skills

SkillWhat it covers
payram-setupServer config, API keys, wallet setup, connectivity test
payram-agent-onboardingAgent onboarding — CLI-only deployment for AI agents, no web UI
payram-analyticsAnalytics dashboards, reports, and payment insights via MCP tools
payram-crypto-paymentsArchitecture overview, why PayRam, MCP tools
payram-payment-integrationQuick-start payment integration guide
payram-self-hosted-payment-gatewayDeploy and own your payment infrastructure
payram-checkout-integrationCheckout flow with SDK + HTTP for 6 frameworks
payram-webhook-integrationWebhook handlers for Express, Next.js, FastAPI, Gin, Laravel, Spring Boot
payram-stablecoin-paymentsUSDT/USDC acceptance across EVM chains and Tron
payram-bitcoin-paymentsBTC with HD wallet derivation and mobile signing
payram-payoutsSend crypto payouts and manage referral programs
payram-no-kyc-crypto-paymentsNo-KYC, no-signup, permissionless payment acceptance

Support

Need help? Message the PayRam team on Telegram: @PayRamChat

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

payram-crypto-payments

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

payram-no-kyc-crypto-payments

No summary provided by upstream source.

Repository SourceNeeds Review
General

payram-setup

No summary provided by upstream source.

Repository SourceNeeds Review
General

payram-webhook-integration

No summary provided by upstream source.

Repository SourceNeeds Review