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 \<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 note you can only delete one record at a time the response will confirm the deletion of the draft invoice request // 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 { "id" "invoice id", "object" "invoice", "deleted" true }