Invoices
Delete a Draft Invoice
Delete a draft invoice. Only a draft can be deleted.
DELETE
/
billing
/
invoices
/
{invoice_id}
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
await client.invoices.delete('invoice_id', { 'If-Match': 'If-Match' });import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
client.invoices.delete(
invoice_id="invoice_id",
if_match="If-Match",
)package main
import (
"context"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
err := client.Invoices.Delete(
context.TODO(),
"invoice_id",
dodopayments.InvoiceDeleteParams{
IfMatch: dodopayments.F("If-Match"),
},
)
if err != nil {
panic(err.Error())
}
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.invoices.InvoiceDeleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
InvoiceDeleteParams params = InvoiceDeleteParams.builder()
.invoiceId("invoice_id")
.ifMatch("If-Match")
.build();
client.invoices().delete(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.invoices.InvoiceDeleteParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: InvoiceDeleteParams = InvoiceDeleteParams.builder()
.invoiceId("invoice_id")
.ifMatch("If-Match")
.build()
client.invoices().delete(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
result = dodo_payments.invoices.delete("invoice_id", if_match: "If-Match")
puts(result)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$result = $client->invoices->delete('invoice_id', ifMatch: 'If-Match');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using DodoPayments.Client;
using DodoPayments.Client.Models.Invoices;
DodoPaymentsClient client = new();
InvoiceDeleteParams parameters = new()
{
InvoiceID = "invoice_id",
IfMatch = "If-Match",
};
await client.Invoices.Delete(parameters);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let invoice_id = "invoice_id";
let result = client
.invoices()
.delete()
.invoice_id(invoice_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request DELETE \
--url https://test.dodopayments.com/billing/invoices/{invoice_id} \
--header 'Authorization: Bearer <token>' \
--header 'If-Match: <if-match>'Authorizations
Send your API key as a bearer token: Authorization: Bearer <api_key>. A test mode key starts with dodo_test_, for example dodo_test_AbCd1234EfGh5678.<secret>. A live mode key starts with dodo_live_. Use a test mode key on test.dodopayments.com and a live mode key on live.dodopayments.com. Keys from before these tags have no tag and operate as before.
Headers
The row_version of the invoice that the request changes.
Path Parameters
Invoice ID
Response
The draft is deleted.
Last modified on November 10, 2026
Was this page helpful?
⌘I
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
await client.invoices.delete('invoice_id', { 'If-Match': 'If-Match' });import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
client.invoices.delete(
invoice_id="invoice_id",
if_match="If-Match",
)package main
import (
"context"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
err := client.Invoices.Delete(
context.TODO(),
"invoice_id",
dodopayments.InvoiceDeleteParams{
IfMatch: dodopayments.F("If-Match"),
},
)
if err != nil {
panic(err.Error())
}
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.invoices.InvoiceDeleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
InvoiceDeleteParams params = InvoiceDeleteParams.builder()
.invoiceId("invoice_id")
.ifMatch("If-Match")
.build();
client.invoices().delete(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.invoices.InvoiceDeleteParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: InvoiceDeleteParams = InvoiceDeleteParams.builder()
.invoiceId("invoice_id")
.ifMatch("If-Match")
.build()
client.invoices().delete(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
result = dodo_payments.invoices.delete("invoice_id", if_match: "If-Match")
puts(result)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$result = $client->invoices->delete('invoice_id', ifMatch: 'If-Match');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using DodoPayments.Client;
using DodoPayments.Client.Models.Invoices;
DodoPaymentsClient client = new();
InvoiceDeleteParams parameters = new()
{
InvoiceID = "invoice_id",
IfMatch = "If-Match",
};
await client.Invoices.Delete(parameters);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let invoice_id = "invoice_id";
let result = client
.invoices()
.delete()
.invoice_id(invoice_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request DELETE \
--url https://test.dodopayments.com/billing/invoices/{invoice_id} \
--header 'Authorization: Bearer <token>' \
--header 'If-Match: <if-match>'