Swipelux

Pay-out API

Pay out crypto from platform wallets to external addresses

Pay-out API

The Pay-out API enables you to send cryptocurrency from your customer's platform wallet to any external wallet address. The source wallet is automatically detected based on the payment rail.

Currently, only crypto payouts are supported. Off-ramp (crypto-to-fiat) functionality will be available soon.

How It Works

  1. Auto-Detection: Specify the customer ID and rail (e.g., polygon) - the system automatically finds the corresponding wallet
  2. Transfer Creation: Creates a blockchain transaction from the customer's wallet to the specified external address
  3. Tracking: Returns a transfer ID (tr_...) for monitoring the payout status
  4. Blockchain Confirmation: Transaction is broadcast to the blockchain and confirmed

API Specification

Endpoint

POST /v1/payout

Request Parameters

ParameterTypeRequiredDescription
fromstringYesCustomer ID whose wallet to payout from (e.g., cus_abc123)
tostringYesExternal wallet address (e.g., 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb)
amountstringYesAmount to payout (decimal string, e.g., 20.5)
currencystringYesCurrency code (e.g., USDC)
railstringYesPayment rail - currently only polygon is supported

Example Request

curl -X POST https://api.swipelux.com/v1/payout \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "cus_abc123",
    "to": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "amount": "20.5",
    "currency": "USDC",
    "rail": "polygon"
  }'

Response Example

{
  "id": "tr_payout789",
  "from": "cus_abc123",
  "to": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "amount": "20.5",
  "currency": "USDC",
  "rail": "polygon",
  "state": "pending",
  "url": "https://polygonscan.com/tx/0xabc...def"
}

Response Fields

FieldTypeDescription
idstringTransfer ID for tracking the payout (e.g., tr_abc123)
fromstringCustomer ID
tostringExternal wallet address
amountstringPay-out amount
currencystringCurrency code
railstringPayment rail used
statestringPay-out state (pending, completed, failed, etc.)
urlstringBlockchain explorer URL when transaction is broadcast

Error Responses

StatusErrorSolution
400Off-ramp will be supported soonFiat rails (card, wire, etc.) are not yet supported for payouts
400Rail X is not yet supportedOnly polygon rail is currently available
400Insufficient balanceCustomer's wallet doesn't have enough balance for the payout
404Customer X not foundVerify the customer ID is correct
404No polygon wallet foundCustomer doesn't have a wallet for the specified rail - create one first

Common Use Cases

Cash-Out Flow

Enable customers to payout their crypto balances to their personal wallets:

// Customer requests payout
const payout = await createPay-out({
  from: customerId,
  to: customerExternalWallet,
  amount: '100',
  currency: 'USDC',
  rail: 'polygon'
});
 
// Track payout status
const status = await getTransferStatus(payout.id);
console.log(`Pay-out ${status.state}`);

Pay-outs to External Wallets

Send payments to external wallet addresses:

// Pay contractor in crypto
const payout = await createPay-out({
  from: businessCustomerId,
  to: contractorWalletAddress,
  amount: '500',
  currency: 'USDC',
  rail: 'polygon'
});

Best Practices

Balance Check: Always verify the customer has sufficient balance before initiating a payout to avoid errors.

Gas Fees: Pay-out amounts are net of gas fees. The actual amount received may be slightly less due to network fees.

Wallet Validation: Ensure the destination address is valid for the specified rail (e.g., valid Ethereum address for polygon).

Next Steps

On this page