const rewardsUserId = 'USER_REWARDS_ID';
const apiKey = 'YOUR_API_KEY'; // Get from https://docs.zbdpay.com/earn/sdk/create-api-key
async function increaseWithdrawalLimit(rewardsUserId, amount, currency) {
const response = await fetch(
`https://api.zebedee.io/api/v1/rewards/user/${rewardsUserId}/withdrawal-limit`,
{
method: 'POST',
headers: {
'x-api-key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: amount,
currency: currency
})
}
);
const data = await response.json();
if (data.success) {
console.log('Withdrawal limit increased successfully');
return data;
} else {
throw new Error(`Failed: ${data.message}`);
}
}
// Increase limit by 1000 MSATS
await increaseWithdrawalLimit('b28e0306-2c06-4092-8d56-a1623d6b97fb', 1000, 'MSATS');