---
title: Delete Draft
slug: payments/delete-draft
description: Learn how to delete a draft invoice using Apex code in this informative document. Follow the provided example, which includes initializing a request JSON data map and specifying the invoice ID. Discover how to make a request to the Breadwinner Global API 
docTags: 
createdAt: 2023-10-27T11:28:43.510Z
---

Only a draft invoice can be deleted in Stripe. The following is an example of a request to delete a draft invoice in Stripe. The ID of the draft Invoice you want to delete and the Processor ID is required.

| **Field Name**                            | **Data Type** | **Description**                                |
| ----------------------------------------- | ------------- | ---------------------------------------------- |
| invoice\_id<font color="#eb144c">*</font> | String        | Id of the Invoice in your connected processor. |
| processorId<font color="#eb144c">*</font> | String        | Account Id of the connected Processor          |

:::hint{type="info"}
Note: You can only delete one record at a time
:::

The response will confirm the deletion of the draft invoice.

:::CodeblockTabs
Request

```apex
//  Initializing the RequestJSON Data to be passed.
Map<String, Object> requestJSONMap = new Map<String, Object>();
requestJSONMap.put('invoice_id', 'Id of the Draft Invoice');
String reqJSON = JSON.serialize(requestJSONMap);

Map<String, Object> reqObj = new Map<String, Object>();
reqObj.put('version','1.0');
reqObj.put('action','DeleteInvoice');
reqObj.put('processorId', 'Account Id of the Invoice');
reqObj.put('requestJSON',reqJSON);

//  Placing a request to Breadwinner Global API
Map<String,Object> resp = bw_payments.BreadwinnerPaymentsAPI.call(reqObj);
System.debug(resp);
```

Response

```json
{
  "id": "Invoice ID",
  "object": "invoice",
  "deleted": true
}
```
:::

