---
title: "Delete Invoice"
source_url: https://docs.rapyd.net/en/delete-invoice.html
lang: en
---

# Delete Invoice

Delete an invoice.

You can delete an invoice when `status` is **draft**.

This method triggers the **Invoice Deleted** webhook. This webhook contains the same information as the response.

### Parameters

### Request Path Parameters

- - invoice
  - ID of the invoice you want to delete.

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Response Parameters

- - deleted
  - Indicates whether the invoice was deleted.
- - id
  - ID of the invoice. String starting with **invoice_**.

### Code Samples

- - .NET

    - ```csharp
      using System;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      string invoice = "invoice_dd9571ff036045f717b8378ed2c671b7";

                      string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/v1/invoices/{invoice}");

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```javascript
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const result = await makeRequest(
            'DELETE',
            '/v1/invoices/invoice_dd9571ff036045f717b8378ed2c671b7'
          );

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```php
      <?php
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      try {
          $object = make_request('delete', "/v1/invoices/invoice_dd9571ff036045f717b8378ed2c671b7");
          var_dump($object);
      } catch(Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```python
      from pprint import pprint

      from utilities import make_request

      result = make_request(method='delete', path='/v1/invoices/invoice_dd9571ff036045f717b8378ed2c671b7')
      pprint(result)
      ```

- /v1/invoices/:invoice

- Delete Invoice
- ```curl
  curl -X delete 'https://sandboxapi.rapyd.net/v1/invoices/invoice_bc09ba51dfc3e709beda58f0d397da9c' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "80e6f247-5b2f-4f62-91ee-b9da2aa06e77"
      },
      "data": {
          "deleted": true,
          "id": "invoice_bc09ba51dfc3e709beda58f0d397da9c"
      }
  }
  ```
