Delete an invoice | Moov Documentation

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.

DELETE

/accounts/{accountID}/invoices/{invoiceID}

Ask

curl -X DELETE "https://api.moov.io/accounts/{accountID}/invoices/{invoiceID}" \
  -H "Authorization: Bearer {token}" \
  -H "X-Moov-Version: v2026.04.00"

Ask

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.invoices.delete({
    accountID: "<id>",
    invoiceID: "<id>",
  });

console.log(result);
}

run();

Ask

declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$response = $sdk->invoices->delete(
    accountID: '<id>',
    invoiceID: '<id>'
);

if ($response->statusCode === 200) {
    // handle response
}

Ask

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()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

DeleteInvoiceResponse res = sdk.invoices().delete()
                .accountID("<id>")
                .invoiceID("<id>")
                .call();

// handle response
    }
}

Ask

from moovio_sdk import Moov
from moovio_sdk.models import components

with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

res = moov.invoices.delete(account_id="<id>", invoice_id="<id>")

# Handle response
    print(res)

Ask

require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
  security: Models::Components::Security.new(
    username: '',
    password: ''
  )
)
res = s.invoices.delete(account_id: '<id>', invoice_id: '<id>')

if res.status_code == 200
  # handle response
end

Ask

using Moov.Sdk;
using Moov.Sdk.Models.Components;

var sdk = new MoovClient(security: new Security() {
    Username = "",
    Password = "",
});

var res = await sdk.Invoices.DeleteAsync(
    accountID: "<id>",
    invoiceID: "<id>"
);

// handle response

Response headers

A unique identifier used to trace requests.

The server could not understand the request due to invalid syntax.

Response headers

A unique identifier used to trace requests.

The request contained missing or expired authentication.

Response headers

A unique identifier used to trace requests.

The user is not authorized to make the request.

Response headers

A unique identifier used to trace requests.

The requested resource was not found.

Response headers

A unique identifier used to trace requests.

The request conflicted with the current state of the target resource.

Response headers

A unique identifier used to trace requests.

Request was refused due to rate limiting.

Response headers

A unique identifier used to trace requests.

The request failed due to an unexpected error.

Response headers

A unique identifier used to trace requests.

The request failed because a downstream service failed to respond.

Response headers

A unique identifier used to trace requests.

Set this header to v2026.04.00 to use the API described in this specification. When omitted, the server defaults to v2024.01.00, which may not match the behavior documented here.

Possible values:

v2026.04.00