type Stripe = {
token: string;
};
/**
* Delete invoiceitems invoiceitem
* Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
*/
export async function main(auth: Stripe, invoiceitem: string) {
const url = new URL(`https://api.stripe.com/v1/invoiceitems/${invoiceitem}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "Bearer " + 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 368 days ago
type Stripe = {
token: string;
};
/**
* Delete invoiceitems invoiceitem
* Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
*/
export async function main(auth: Stripe, invoiceitem: string) {
const url = new URL(`https://api.stripe.com/v1/invoiceitems/${invoiceitem}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "Bearer " + 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 795 days ago
type Stripe = {
token: string;
};
/**
* Delete invoiceitems invoiceitem
* <p>Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.</p>
*/
export async function main(auth: Stripe, invoiceitem: string) {
const url = new URL(`https://api.stripe.com/v1/invoiceitems/${invoiceitem}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "Bearer " + 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 922 days ago