export type DeleteApiCreditorAgentsIcaCreditorsCreditorIdArgs = {ica: string, creditor_id: string}; export type DeleteApiCreditorAgentsIcaCreditorsCreditorIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Creditor Registration * * DELETE /creditor-agents/{ica}/creditors/{creditor_id} */ export const deleteApiCreditorAgentsIcaCreditorsCreditorId = async (args: DeleteApiCreditorAgentsIcaCreditorsCreditorIdArgs, options?: DeleteApiCreditorAgentsIcaCreditorsCreditorIdOptions) => { const {baseUrl = "https://api.mastercard.com/commercial/payments", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/creditor-agents/${encodeURIComponent(String(args.ica))}/creditors/${encodeURIComponent(String(args.creditor_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };