Delete Draft
2 min
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* | String | Id of the Invoice in your connected processor. |
processorId* | String | Account Id of the connected Processor |
Note: You can only delete one record at a time
The response will confirm the deletion of the draft invoice.
// 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);