curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-X DELETE https://api.razorpay.com/v1/invoices/inv_DAuFuwWYU3R9tg \
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String invoiceId = "inv_DAuFuwWYU3R9tg";
List<Invoice> invoice = razorpay.invoices.delete(InvoiceId);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.invoice.delete(invoiceId)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
body, err := client.Invoice.Delete("<invoiceId>", nil, nil)
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Invoice.delete(invoiceId)
$api = new Api($key_id, $secret);
$api->invoice->fetch($invoiceId)->delete();
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.invoices.delete(invoiceId)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string invoiceId = "inv_DAweOiQ7amIUVd";
List<Invoice> invoice = client.Invoice.Fetch(invoiceId).Delete();
razorpay invoices delete inv_ABC123
[]
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Operation not allowed for Invoice in cancelled status.",
"source": "business",
"step": "payment_initiation",
"reason": "input_validation_failed",
"metadata": {}
}
}
Invoices
Delete an Invoice
Delete an invoice using this endpoint.
DELETE
/
v1
/
invoices
/
:id
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-X DELETE https://api.razorpay.com/v1/invoices/inv_DAuFuwWYU3R9tg \
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String invoiceId = "inv_DAuFuwWYU3R9tg";
List<Invoice> invoice = razorpay.invoices.delete(InvoiceId);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.invoice.delete(invoiceId)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
body, err := client.Invoice.Delete("<invoiceId>", nil, nil)
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Invoice.delete(invoiceId)
$api = new Api($key_id, $secret);
$api->invoice->fetch($invoiceId)->delete();
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.invoices.delete(invoiceId)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string invoiceId = "inv_DAweOiQ7amIUVd";
List<Invoice> invoice = client.Invoice.Fetch(invoiceId).Delete();
razorpay invoices delete inv_ABC123
[]
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Operation not allowed for Invoice in cancelled status.",
"source": "business",
"step": "payment_initiation",
"reason": "input_validation_failed",
"metadata": {}
}
}
Available in🇮🇳 India🇲🇾 Malaysia🇸🇬 Singapore🇺🇸 United States
Use this endpoint to delete invoices. You can only delete an invoice that is in the draft state.
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-X DELETE https://api.razorpay.com/v1/invoices/inv_DAuFuwWYU3R9tg \
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String invoiceId = "inv_DAuFuwWYU3R9tg";
List<Invoice> invoice = razorpay.invoices.delete(InvoiceId);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.invoice.delete(invoiceId)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
body, err := client.Invoice.Delete("<invoiceId>", nil, nil)
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Invoice.delete(invoiceId)
$api = new Api($key_id, $secret);
$api->invoice->fetch($invoiceId)->delete();
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.invoices.delete(invoiceId)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string invoiceId = "inv_DAweOiQ7amIUVd";
List<Invoice> invoice = client.Invoice.Fetch(invoiceId).Delete();
razorpay invoices delete inv_ABC123
[]
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Operation not allowed for Invoice in cancelled status.",
"source": "business",
"step": "payment_initiation",
"reason": "input_validation_failed",
"metadata": {}
}
}
Path Parameters
string
required
The unique identifier of the invoice.
Errors
Operation not allowed for Invoice in {issued|paid|partially_paid|cancelled|expired} status.
Operation not allowed for Invoice in {issued|paid|partially_paid|cancelled|expired} status.
Code:
400Deletion is only allowed on invoices in the draft state.Solution: You can only delete invoices that have not yet been issued. Once issued, cancel the invoice using POST /v1/invoices/:id/cancel instead.The api {key/secret} provided is invalid.
The api {key/secret} provided is invalid.
Code:
4xxThe API credentials passed in the API call differ from the ones generated on the Dashboard.Solution: The API keys must be active and entered correctly with no whitespace before or after.The id provided does not exist.
The id provided does not exist.
Code:
400The invoice id passed in the URL does not exist or does not belong to the requesting merchant.Solution: Use a valid invoice id returned from POST /v1/invoices. Confirm by fetching the invoice before retrying.Was this page helpful?