Create a customer. [See the docs (https://stripe.com/docs/api/customers/create) for more information
1
type Stripe = {
2
token: string;
3
};
4
export async function main(stripe_con: Stripe) {
5
const STRIPE_CREATE_CUSTOMER_URL = `https://api.stripe.com/v1/customers`;
6
7
const token = stripe_con["token"];
8
9
const response = await fetch(STRIPE_CREATE_CUSTOMER_URL, {
10
method: "POST",
11
headers: {
12
Authorization: "Bearer " + token,
13
"Content-Type": "application/json",
14
},
15
});
16
17
return await response.json();
18
}
19