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.

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
Blockchain | Network Name | Symbol | Supported Tokens |
---|---|---|---|
Ethereum | ethereum | ETH | ETH (Native), USDT , USDC |
Polygon | polygon | POL | POL (Native), USDT , USDC |
Tron | tron | TRON | TRON (Native), USDT , USDC |
Avalanche | avalanche | AVAX | AVAX (Native), USDT , USDC |
Arbitrum | arbitrum | ARB | ARB (Native), USDT , USDC |
Binance Smart Chain | binance-smart-chain | BSC | BSC (Native), USDT , USDC |
Implementation
Payment Payload Parameters
Parameter | Type | Required | Description |
---|---|---|---|
amount | number | Yes | Amount to be charged |
currency | string | Yes | Currency in which the amount to be charged |
currencyType | "banksy-pay" | Yes | Must be "banksy-pay" for crypto transactions |
customerEmail | string | Yes | Customer's email address |
customerPhone | string | Yes | Customer's phone number |
successCallback | string | Yes | URL for successful payment redirect |
failureCallback | string | Yes | URL for failed payment redirect |
externalClientId | string | No | External client id for webhook tracking |
isKycOptional | boolean | Yes | Indicates if KYC is optional |
context | any | No | Additional JSON data for webhook |
crypto | object | Yes | Cryptocurrency configuration |
crypto.tokenName | string | Yes | Name of the cryptocurrency token |
crypto.blockchainSymbol | string | Yes | Symbol of the blockchain |
crypto.blockchainName | string | Yes | Name 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
-
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
-
Blockchain Selection
- Choose appropriate blockchain based on transaction requirements
- Consider gas fees and transaction speed
- Verify network compatibility with tokens
-
Callback URLs
- Use HTTPS for callback URLs
- Implement proper validation in callback endpoints
- Handle both success and failure scenarios gracefully
- Verify transaction confirmations
-
Error Handling
- Implement comprehensive error handling
- Log all payment attempts and responses
- Provide clear error messages to users
- Handle network-specific errors appropriately
Testing
- Use test API keys for development
- Test with small amounts initially
- Verify callback handling for both success and failure scenarios
- Test across different blockchain networks
- Validate KYC flows if required
Support
For technical support or integration assistance, please contact the Banksy support team through the official channels.