Delete a Customer

Delete a customer. [See the docs](https://stripe.com/docs/api/customers/delete) for more information

Script stripe Verified

by rossmccrann ยท 8/25/2022

The script

Submitted by hugo989 Bun
Verified 4 days ago
1
import StripeClient from "stripe@11";
2

3
type Stripe = {
4
  token: string;
5
};
6
export async function main(stripe_con: Stripe, customer_id: string) {
7
  const token = stripe_con["token"];
8
  const stripe = StripeClient(`${token}`, {
9
    httpClient: StripeClient.createFetchHttpClient(),
10
  });
11

12
  const deleted = await stripe.customers.del(`${customer_id}`);
13

14
  return await deleted.json();
15
}
16

Other submissions
  • Submitted by rossmccrann Deno
    Created 396 days ago
    1
    import Stripe from "https://esm.sh/stripe?target=deno";
    2
    
    
    3
    type Stripe = {
    4
      token: string;
    5
    };
    6
    export async function main(stripe_con: Stripe, customer_id: string) {
    7
      const token = stripe_con["token"];
    8
      const stripe = Stripe(`${token}`, {
    9
        httpClient: Stripe.createFetchHttpClient(),
    10
      });
    11
    
    
    12
      const deleted = await stripe.customers.del(`${customer_id}`);
    13
    
    
    14
      return await deleted.json();
    15
    }
    16