Skip to main content

Banksy Pay

Overview

Banksy Pay is a payment provider that enables businesses to accept cryptocurrency payments. It supports various cryptocurrencies including USDT, USDC, and native blockchain currencies across multiple blockchain networks like Ethereum, Polygon, Tron, and more.

Banksy Pay Logo

Features

  • Multiple cryptocurrency support
  • Multi-blockchain compatibility
  • Secure payment processing
  • Customizable success and failure callbacks
  • Optional KYC integration

Integration Requirements

  • Banksy API Key
  • Valid callback URLs for success and failure scenarios
  • Customer email for transaction notifications

Supported Options

Supported Cryptocurrencies and Networks
BlockchainNetwork NameSymbolSupported Tokens
EthereumethereumETHETH (Native), USDT, USDC
PolygonpolygonPOLPOL (Native), USDT, USDC
TrontronTRONTRON (Native), USDT, USDC
AvalancheavalancheAVAXAVAX (Native), USDT, USDC
ArbitrumarbitrumARBARB (Native), USDT, USDC
Binance Smart Chainbinance-smart-chainBSCBSC (Native), USDT, USDC

Implementation

Payment Payload Parameters

ParameterTypeRequiredDescription
amountnumberYesAmount to be charged
currencystringYesCurrency in which the amount to be charged
currencyType"banksy-pay"YesMust be "banksy-pay" for crypto transactions
customerEmailstringYesCustomer's email address
customerPhonestringYesCustomer's phone number
successCallbackstringYesURL for successful payment redirect
failureCallbackstringYesURL for failed payment redirect
externalClientIdstringNoExternal client id for webhook tracking
isKycOptionalbooleanYesIndicates if KYC is optional
contextanyNoAdditional JSON data for webhook
cryptoobjectYesCryptocurrency configuration
crypto.tokenNamestringYesName of the cryptocurrency token
crypto.blockchainSymbolstringYesSymbol of the blockchain
crypto.blockchainNamestringYesName of the blockchain

Example Implementation

import { Banksy } from "banksy-sdk";

// Initialize the Banksy SDK with your API key
const banksy = new Banksy("your-api-key");

async function createCryptoPayment() {
try {
const paymentPayload = {
currencyType: "banksy-pay",
amount: 100,
currency: "INR",
customerEmail: "customer@example.com",
customerPhone: "+919876543210",
successCallback: "https://your-domain.com/success",
failureCallback: "https://your-domain.com/failure",
isKycOptional: true,
crypto: {
tokenName: "USDC",
blockchainSymbol: "ETH",
blockchainName: "ethereum",
},
};

const payment = await banksy.createPayment(paymentPayload);
console.log("Payment Created:", payment);

// Redirect to payment page
window.location.href = payment.paymentLink;
} catch (error) {
console.error("Payment creation failed:", error);
}
}

API Testing with cURL

curl --location 'https://sandbox-api.banksy.id/sdk/payment/create' \
--header 'Content-Type: application/json' \
--header 'X-AUTH: ck_test_************738139' \
--data-raw '{
"currencyType": "banksy-pay",
"amount": 100,
"currency": "INR",
"customerEmail": "customer@example.com",
"customerPhone": "+919876543210",
"successCallback": "http://domain.com/success",
"failureCallback": "http://domain.com/failure",
"isKycOptional": true,
"crypto": {
"tokenName": "USDC",
"blockchainSymbol": "ETH",
"blockchainName": "ethereum"
}
}'

Security Considerations

  • Always use HTTPS for API calls
  • Validate all input parameters
  • Store sensitive data securely
  • Implement proper authentication for callback endpoints
  • Monitor transactions for suspicious activity
  • Keep private keys secure
  • Verify blockchain addresses carefully

Best Practices

  1. Amount Validation

    • Ensure the amount is a positive number
    • Validate against minimum and maximum transaction limits
    • Consider gas fees in calculations
    • Send exact amounts without rounding (e.g., if amount is 42.41234, don't round to 42.41)
    • Maintain precision for all decimal places in
  2. Blockchain Selection

    • Choose appropriate blockchain based on transaction requirements
    • Consider gas fees and transaction speed
    • Verify network compatibility with tokens
  3. Callback URLs

    • Use HTTPS for callback URLs
    • Implement proper validation in callback endpoints
    • Handle both success and failure scenarios gracefully
    • Verify transaction confirmations
  4. Error Handling

    • Implement comprehensive error handling
    • Log all payment attempts and responses
    • Provide clear error messages to users
    • Handle network-specific errors appropriately

Testing

  1. Use test API keys for development
  2. Test with small amounts initially
  3. Verify callback handling for both success and failure scenarios
  4. Test across different blockchain networks
  5. Validate KYC flows if required

Support

For technical support or integration assistance, please contact the Banksy support team through the official channels.