const response = await fetch("https://autopay.shakesco.com/start_session", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
auto_address: "0x309E7d835ccE6E74BC72A2E523fa7f79FFC0d413",
delegate_address: "",
network: "137",
period: "2592000",
description: "Premium Subscription",
redirect_url: "https://yoursite.com/success",
number: "",
currency_code: "USD",
amount: "20",
token_address: ["Polygon", "USDC"],
should_split: false,
}),
});
const { url } = await response.json();
window.location.href = url; // Redirect to checkout