Delete Draft Purchase

This function is used to delete a Purchase before it is finalized. Only draft purchases can be deleted.

Path Parameters

IdIntegerThis is the ID value of the Purchase you want to delete.
curl -X DELETE "{Id}" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//path parameter
int purchaseId = {Id};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://" + purchaseId);
//Set content length
request.ContentLength = 0;
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic " + apiKey);
//Set request method
request.Method = "DELETE";
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
  result = streamReader.ReadToEnd();
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI and Headers
r = requests.delete('{id}', headers=headers)
This returns a 204 No Content upon success
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
            "Key": "Api Error",
            "Value": "Only purchases in status Draft may be deleted."