//native
type Buttondown = {
token: string;
};
/**
* Get Stripe Subscriptions
*
*/
export async function main(auth: Buttondown, id_or_email: string) {
const url = new URL(
`https://api.buttondown.com/v1/subscribers/${id_or_email}/stripe-subscriptions`,
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Token " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago