Deleting a transaction

Deleting a transaction requires the document ID of the transaction you want to delete.

// direct REST call from Javascript
var username= "[email protected]",
    password = "notArealpassw0rd";

// check is an earlier transaction we created.
var documentId = check.documentId;

var settings = {
  "async": true,
  "url": "https://gateway.acheck21.com/GlobalGateway/api/v1/checks/default/" + documentId,
  "method": "DELETE",
  "headers": {
    	// this header needs to be set on every REST call.
   		"Authorization": "Basic " + btoa(username + ":" + password)
  }
}

$.ajax(settings).done(function () {
  console.log('successfully deleted transaction');
});
// Assumes check was created earlier and auth is already set. 
// See Creating a transaction page
Check result = apiInstance.voidCheck("default", check.getDocumentId());
[apiInstance voidCheckWithClientId:@"default" documentId:[check documentId] 	
	completionHandler:^(NSError *error) {
    if (!error)
    {
      NSLog(@"Deleted");
    }
    else{
      NSLog(@"Error calling ACHChecksApi->voidCheck: %@", error);
    }
}];
// Assumes check was created earlier and auth is already set. 
// See Creating a transaction page 
client.VoidCheckAsync("default", check.DocumentId).Wait();