Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/blindpaylabs/blindpay-node/llms.txt

Use this file to discover all available pages before exploring further.

Get started with BlindPay Node.js SDK and make your first API call in under 5 minutes.
1

Install the SDK

Install the BlindPay Node.js SDK using your preferred package manager:
npm install @blindpay/node
2

Get your credentials

You’ll need an API key and instance ID from the BlindPay dashboard:
  1. Sign up or log in at app.blindpay.com
  2. Navigate to your instance’s API Keys page
  3. Create a new API key
  4. Copy your API key and instance ID
Keep your API key secure and never commit it to version control. Use environment variables in production.
3

Initialize the client

Create a new BlindPay client with your credentials:
import { BlindPay } from '@blindpay/node';

const blindpay = new BlindPay({
  apiKey: 'your-api-key-here',
  instanceId: 'your-instance-id-here'
});
All API calls will use these credentials automatically. You don’t need to pass them again.
4

Make your first API call

Let’s fetch the available payment rails to verify everything works:
async function getAvailableRails() {
  const { data, error } = await blindpay.available.getRails();
  
  if (error) {
    console.error('Error:', error.message);
    return;
  }
  
  console.log('Available payment rails:', data);
}

getAvailableRails();
Expected response:
{
  "data": [
    {
      "label": "PIX (Brazil)",
      "value": "pix",
      "country": "BR"
    },
    {
      "label": "ACH",
      "value": "ach",
      "country": "US"
    },
    {
      "label": "Wire Transfer",
      "value": "wire",
      "country": "US"
    }
    // ... more rails
  ],
  "error": null
}

Understanding the response format

All BlindPay SDK methods return a consistent response format with a discriminated union:
type BlindpayApiResponse<T> = 
  | { data: T; error: null }
  | { data: null; error: { message: string } };
This pattern makes error handling straightforward and type-safe:
const { data, error } = await blindpay.receivers.list();

if (error) {
  // TypeScript knows `data` is null here
  console.error('Error:', error.message);
  return;
}

// TypeScript knows `error` is null here
console.log('Receivers:', data); // data is fully typed

Complete example

Here’s a complete example that creates a receiver and lists all receivers:
import { BlindPay } from '@blindpay/node';

const blindpay = new BlindPay({
  apiKey: process.env.BLINDPAY_API_KEY!,
  instanceId: process.env.BLINDPAY_INSTANCE_ID!
});

async function main() {
  // Create a receiver with standard KYC
  const { data: receiver, error: createError } = 
    await blindpay.receivers.createIndividualWithStandardKYC({
      country: 'US',
      email: 'john.doe@example.com',
      first_name: 'John',
      last_name: 'Doe'
    });

  if (createError) {
    console.error('Failed to create receiver:', createError.message);
    return;
  }

  console.log('Created receiver:', receiver);

  // List all receivers
  const { data: receivers, error: listError } = 
    await blindpay.receivers.list();

  if (listError) {
    console.error('Failed to list receivers:', listError.message);
    return;
  }

  console.log(`Total receivers: ${receivers.length}`);
}

main();

Next steps

Core Concepts

Learn about receivers, payment rails, and quotes

Create a payout

Send crypto-to-fiat payments globally

Create a payin

Accept fiat-to-crypto payments

API Reference

Explore the complete API documentation

Common issues

Error: BlindPayError: Api key not provided, get your api key on blindpay dashboardMake sure you’re passing both apiKey and instanceId to the BlindPay constructor:
const blindpay = new BlindPay({
  apiKey: 'your-api-key',      // Required
  instanceId: 'your-instance-id' // Required
});
Error: Cannot find module '@blindpay/node'Make sure TypeScript can find the types:
  1. Check that @blindpay/node is in your package.json dependencies
  2. Run npm install to ensure dependencies are installed
  3. Check your tsconfig.json has "moduleResolution": "node" or "bundler"
Error: API returns unauthorized errorThis means your API key is invalid or expired:
  1. Verify your API key in the BlindPay dashboard
  2. Check that you’re using the correct instance ID
  3. Generate a new API key if needed