Prerequisites
Before integrating:
Deploy Business Auto account
Installation
npm i @shakesco/automation
Import the SDK:
const { Automation , parseUnits } = require ( "@shakesco/automation" );
Testing Mode
Test addresses are automatically funded - no need to add balance in testing
mode.
Request Test Address
const your_smart_wallet_address = "" ; // Same for Ethereum and Polygon
const shakescocontract = new Automation (
your_smart_wallet_address ,
process . env . SHAKESCOAPIKEY ,
"11155111" // Sepolia testnet
);
const requestAddress = await shakescocontract . testDelegateAddressBuss ();
console . log ( requestAddress );
// {
// id: "1",
// test_delegate_address: "0x472ef8282b420396ad307cb89f542e60b1dec1a1"
// }
Send Test Request
const address = "" ; // Your test delegate address from above
const shakescocontract = new Automation (
address ,
process . env . SHAKESCOAPIKEY ,
"11155111"
);
const period = "86400" ; // 1 day
const requestUser = await shakescocontract . requestUser (
"0x309E7d835ccE6E74BC72A2E523fa7f79FFC0d413" , // Test user address
"" , // No token (native currency)
period ,
"" , // No amount in test mode
false , // No split payment
[], // No split addresses
[] // No split amounts
);
console . log ( requestUser ); // "Requested user successfully"
Check your Shakesco app: - Business requests → Business Wallet - User requests
→ Personal Wallet
Production Integration
Network IDs
Network Chain ID Ethereum "1"Polygon "137"
Basic Request Flow
Step 1: Initialize SDK
const address = "" ; // From dashboard: users.shakesco.com
const shakescocontract = new Automation (
address ,
process . env . SHAKESCOAPIKEY ,
"137" // Polygon
);
Step 2: Prepare parameters
const period = "604800" ; // 1 week (seconds)
const amount = parseUnits ( "20" , 18 ); // $20 USD
const delegateAddress = "" ; // User's Shakesco card address
Step 3: Send request
// For users
const requestUser = await shakescocontract . requestUser (
delegateAddress ,
"" , // Token address (empty = native)
period ,
amount ,
false , // Split payment
[], // Split addresses
[] // Split amounts
);
// For businesses
const requestBusiness = await shakescocontract . requestBusiness (
delegateAddress ,
"" , // Token address
period ,
amount
);
Period: seconds (e.g., "604800" = 1 week) - Amount: USD (e.g.,
parseUnits("20", 18) = $20) - Boolean returns: strings ("true" /
"false")
Pre-Request Checks
Verify User Can Be Requested
const shakescocontract = new Automation (
your_smart_wallet_address ,
process . env . SHAKESCOAPIKEY ,
"1"
);
const canRequest = await shakescocontract . canRequest ( delegateAddress );
console . log ( canRequest ); // {"id": 1, "status": "true"}
If status: "false", user must accept requests in Shakesco app first.
Check If Payer Is Business
Different fee rates apply for B2B vs B2C:
const isBusiness = await shakescocontract . isBusiness ( delegateAddress );
console . log ( isBusiness ); // {"id": 1, "is_business": false}
Split Payments
Enable multiple users to share subscription costs:
const mainAddress = "" ; // Group leader's address
const friends = [ "0x..." , "0x..." ]; // Other participants
const friendsAmount = [ parseUnits ( "10" , 18 ), parseUnits ( "10" , 18 )];
const mainAmount = parseUnits ( "10" , 18 );
const requestUser = await shakescocontract . requestUser (
mainAddress ,
"" ,
"604800" , // 1 week
mainAmount ,
true , // Enable split
friends ,
friendsAmount
);
console . log ( requestUser ); // Returns only for mainAddress
// Verify all participants were requested
for ( let i = 0 ; i < friends . length ; i ++ ) {
const isRequested = await shakescocontract . isRequested ( friends [ i ]);
console . log ( isRequested ); // "true" / "false"
}
Service granted only to group leader (mainAddress). Total: 30 s p l i t a m o n g 3 p e o p l e ( 30 split among 3
people ( 30 s pl i t am o n g 3 p eo pl e ( 10 each). All participants must be verified with isRequested.
Token Payments
Request payment in specific ERC-20 tokens.
Polygon example:
const tokenAddress = "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359" ; // USDC
const shakescocontract = new Automation (
address ,
process . env . SHAKESCOAPIKEY ,
"137"
);
const requestUser = await shakescocontract . requestUser (
delegateAddress ,
tokenAddress ,
"604800" ,
parseUnits ( "20" , 18 ),
false ,
[],
[]
);
Supported tokens on Polygon: WETH, WBTC, USDT, USDC, DAI
Ethereum example:
const tokenAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ; // USDC
const shakescocontract = new Automation (
address ,
process . env . SHAKESCOAPIKEY ,
"1"
);
const requestUser = await shakescocontract . requestUser (
delegateAddress ,
tokenAddress ,
"604800" ,
parseUnits ( "20" , 18 ),
false ,
[],
[]
);
Supported tokens on Ethereum: USDC, USDT, DAI
See all token addresses →
Token addresses must be checksummed. Use addresses from the documentation
exactly.
Check Payment Status
Critical: Verify payment before granting service access:
const shakescocontract = new Automation (
address ,
process . env . SHAKESCOAPIKEY ,
"137"
);
const hasPaid = await shakescocontract . hasPaid ( delegateAddress );
console . log ( hasPaid ); // "true" or "false"
Always check payment status before delivering service. This is your only
verification method.
For split payments, only query the group leader. Other participants will
return false.
Additional Methods
Check If User Was Requested
const isRequested = await shakescocontract . isRequested ( delegateAddress );
console . log ( isRequested ); // "true" / "false"
Pricing & Fees
Need Custom Intervals?
Daily automation not offered by default. Need it? Contact us .
Next Steps
API Integration Prefer REST API? View the API documentation