# Delete an Invoice

**URL:** <https://forum.wixstudio.com/t/delete-an-invoice/70895>\
**Category:** Ask the community\
**Tags:** wix-billing-backend, wix-web-module, code\
**Created:** [May 13, 2025, 12:18pm UTC](https://forum.wixstudio.com/t/delete-an-invoice/70895 "2025-05-13T12:18:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5618](https://avatars.discourse-cdn.com/v4/letter/u/b3f665/32.png) [@user5618](https://forum.wixstudio.com/u/user5618)\
**Post date:** [May 13, 2025, 12:18pm UTC](https://forum.wixstudio.com/t/delete-an-invoice/70895/1 "2025-05-13T12:18:49Z")

</div>

Trying to delete an invoice that was created and I get an error Member[id] is not related to the invoice.

using WixEditor

Trying to use APIs to delete/ void an invoice after it’s creation.

```javascript
import { Permissions, webMethod } from "wix-web-module";
import { invoices } from 'wix-billing-backend';

export const deleteInvoice= webMethod(Permissions.Anyone, (invoiceId) => {
    try {
        return invoices.getInvoice(invoiceId).then((result) => {
            return invoices.deleteInvoice(result.id);
        });
    } catch (err) {
        console.error("deleteInvoiceById error:", err);
        throw err;
    }
});

```
