1
Retrieve Invoice Line Item
One script reply has been approved by the moderators Verified

Retrieve a single line item on an invoice. See the docs for more information

Created by rossmccrann 815 days ago Viewed 9220 times
0
Submitted by rossmccrann Deno
Verified 815 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, invoice_id: string) {
7
  const token = stripe_con["token"];
8
  const stripe = Stripe(`${token}`, {
9
    httpClient: Stripe.createFetchHttpClient(),
10
  });
11

12
  const invoiceItem = await stripe.invoiceItems.retrieve(`${invoice_id}`);
13

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