{"id":47332,"library":"cpay-node-api-sdk","title":"Cpay Node API SDK","description":"A TypeScript SDK for interacting with the Cpay REST API (version 2.1.1), providing convenient methods for authentication, wallet management (including multi-currency and deposit wallets), and withdrawals (including NFTs and internal transfers). It supports both v1 and v2 wallet versions. Ideal for Node.js applications needing seamless integration with Cpay payment infrastructure.","status":"active","version":"2.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/cpayhq/cpay-node-sdk","tags":["javascript","typescript"],"install":[{"cmd":"npm install cpay-node-api-sdk","lang":"bash","label":"npm"},{"cmd":"yarn add cpay-node-api-sdk","lang":"bash","label":"yarn"},{"cmd":"pnpm add cpay-node-api-sdk","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export, not named. Must use default import.","wrong":"import { CpaySDK } from 'cpay-node-api-sdk';","symbol":"CpaySDK","correct":"import CpaySDK from 'cpay-node-api-sdk';"},{"note":"CommonJS require returns the default export directly, not an object.","wrong":"const { CpaySDK } = require('cpay-node-api-sdk');","symbol":"CpaySDK","correct":"const CpaySDK = require('cpay-node-api-sdk');"},{"note":"Use type-only import for compile-time types to avoid runtime overhead.","wrong":"import { WalletOptions } from 'cpay-node-api-sdk';","symbol":"types","correct":"import type { WalletOptions } from 'cpay-node-api-sdk';"}],"quickstart":{"code":"import CpaySDK from 'cpay-node-api-sdk';\n\nconst cpay = new CpaySDK({\n  publicKey: process.env.CPAY_PUBLIC_KEY ?? '',\n  privateKey: process.env.CPAY_PRIVATE_KEY ?? '',\n  walletId: process.env.CPAY_WALLET_ID,\n  passphrase: process.env.CPAY_PASSPHRASE,\n});\n\nasync function main() {\n  // Register a new account\n  const account = await cpay.auth.register({\n    email: 'user@example.com',\n    password: 'securePassword123',\n    roles: ['merchant'],\n  });\n  console.log('Account created:', account);\n\n  // Deposit wallet\n  const wallet = await cpay.wallet.createDepositWallet({\n    currencyId: '1',\n    walletVersion: 'v2',\n  });\n  console.log('Deposit wallet:', wallet);\n\n  // Withdrawal\n  const fee = await cpay.withdrawal.estimateFee({\n    to: 'recipient-address',\n    amount: '0.01',\n  });\n  console.log('Estimated fee:', fee);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Demonstrates initialization, authentication, wallet creation, and fee estimation – core Cpay operations."},"warnings":[{"fix":"Check walletVersion and handle response fields accordingly.","message":"Wallet v2 response shape differs from v1; accessing fields that only exist in v1 may return undefined.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure walletId and passphrase are provided in the options object when constructing CpaySDK.","message":"walletId and passphrase are required for most withdrawal and wallet info methods but not passed as parameters; they are set during SDK initialization.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Store private keys securely and avoid printing them.","message":"The createDepositWallet and createMulticurrencyWallets methods may return sensitive data (privateKey, mnemonic). Handle with care and never log or expose them.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Set walletVersion to 'v2' in wallet creation options.","message":"Support for v1 wallet endpoints may be deprecated in future versions. Use v2 for new integrations.","severity":"deprecated","affected_versions":">=2.0.0 <3.0.0"}],"env_vars":null,"search_vec":"'2.1.1':16 'api':3,14 'applic':49 'authent':21 'conveni':18 'cpay':1,12,54 'currenc':27 'deposit':29 'ideal':46 'includ':24,33 'infrastructur':56 'integr':52 'interact':9 'intern':36 'javascript':57 'manag':23 'method':19 'multi':26 'multi-curr':25 'need':50 'nfts':34 'node':2 'node.js':48 'payment':55 'provid':17 'rest':13 'sdk':4,7 'seamless':51 'support':39 'transfer':37 'typescript':6,58 'v1':41 'v2':43 'version':15,45 'wallet':22,30,44 'withdraw':32","created_at":"2026-06-07T16:50:58.819714+00:00","updated_at":"2026-06-07T16:50:58.819714+00:00","problems":[{"fix":"Use: const cpay = new CpaySDK(options);","cause":"Forgot to instantiate CpaySDK with new keyword or used named export.","error":"TypeError: cpay.auth.register is not a function"},{"fix":"Pass walletId in the options object: new CpaySDK({ ..., walletId: 'your-wallet-id' })","cause":"Missing walletId in SDK initialization for methods that require it.","error":"Error: walletId is required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/cpayhq/cpay-node-sdk#readme","github":"https://github.com/cpayhq/cpay-node-sdk","docs":null,"changelog":null,"pypi":null,"npm":"cpay-node-api-sdk","openapi_spec":null,"status_page":null,"smithery":null,"categories":["payments"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}