//native
type Zoho = {
token: string;
};
/**
* Delete a customer
* Delete an existing customer.
*/
export async function main(
auth: Zoho,
customer_id: string,
X_com_zoho_subscriptions_organizationid: string,
) {
const url = new URL(
`https://www.zohoapis.com/billing/v1/customers/${customer_id}`,
);
const response = await fetch(url, {
method: "DELETE",
headers: {
"X-com-zoho-subscriptions-organizationid":
X_com_zoho_subscriptions_organizationid,
Authorization: "Zoho-oauthtoken " + 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 235 days ago