Delete an invoice
Delete an invoice. Only invoices in draft status can be deleted.
Deleting an invoice indicates it was created by mistake and should be completely disregarded.
Deleted invoices are hidden from list results by default, but can still be retrieved
individually through the get invoice endpoint. If you need to void an invoice that was
already sent or is otherwise part of the invoice history, cancel it instead by updating
its status to canceled.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/invoices.write scope.
curl -X DELETE "https://api.moov.io/accounts/{accountID}/invoices/{invoiceID}" \
-H "Authorization: Bearer {token}" \
-H "x-moov-version: v2026.04.00" \
import { Moov } from "@moovio/sdk";
const moov = new Moov({
xMoovVersion: "<value>",
security: {
username: "",
password: "",
},
});
async function run() {
const result = await moov.invoices.delete({
accountID: "<id>",
invoiceID: "<id>",
});
console.log(result);
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;
$sdk = MoovPhp\Moov::builder()
->setXMoovVersion('<value>')
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$response = $sdk->invoices->delete(
accountID: '<id>',
invoiceID: '<id>'
);
if ($response->statusCode === 200) {
// handle response
}package hello.world;
import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.operations.DeleteInvoiceResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GenericError, Exception {
Moov sdk = Moov.builder()
.xMoovVersion("<value>")
.security(Security.builder()
.username("")
.password("")
.build())
.build();
DeleteInvoiceResponse res = sdk.invoices().delete()
.accountID("<id>")
.invoiceID("<id>")
.call();
// handle response
}
}from moovio_sdk import Moov
from moovio_sdk.models import components
with Moov(
x_moov_version="<value>",
security=components.Security(
username="",
password="",
),
) as moov:
res = moov.invoices.delete(account_id="<id>", invoice_id="<id>")
# Handle response
print(res)require 'moov_ruby'
Models = ::Moov::Models
s = ::Moov::Client.new(
x_moov_version: '<value>',
security: Models::Components::Security.new(
username: '',
password: ''
)
)
res = s.invoices.delete(account_id: '<id>', invoice_id: '<id>')
if res.status_code == 200
# handle response
endusing Moov.Sdk;
using Moov.Sdk.Models.Components;
var sdk = new MoovClient(
xMoovVersion: "<value>",
security: new Security() {
Username = "",
Password = "",
}
);
var res = await sdk.Invoices.DeleteAsync(
accountID: "<id>",
invoiceID: "<id>"
);
// handle responseResponse headers
x-request-id
string
required
{
"error": "string"
}Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
{
"error": "string"
}Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Headers
X-Moov-Version
string
Specify an API version.
API versioning follows the format vYYYY.QQ.BB, where
YYYYis the yearQQis the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)BBis the build number, starting at.01, for subsequent builds in the same quarter.- For example,
v2024.01.00is the initial release of the first quarter of 2024.
- For example,
The dev version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
When no version is specified, the API defaults to v2024.01.00.
Path parameters
accountID
string
required
invoiceID
string
required