Retrieving a transaction

After creating a transaction with the API, you should have a Check object. However, you may want to get a more up to date version of the object later. For example, the transaction status will be considered pending at first but it will change as it moves through the workflow until it eventually settles or returns. With the documentId from the original Check object, you can use the API to retrieve the latest version of the Check object.

Example code to retrieve transaction

// 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": "GET",
  "headers": {
    	// this header needs to be set on every REST call.
   		"Authorization": "Basic " + btoa(username + ":" + password)
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
Check ch = client.GetCheckAsync(default, check.DocumentId).Result;
// Assumes check was created earlier and auth is already set. 
// See Creating a transaction page
[apiInstance getCheckWithClientId:@"default" documentId:[check documentId]
 completionHandler: ^(ACHCheck* output, NSError* error) {
   if (output) {
     NSLog(@"%@", output);
   }
   if (error) {
     NSLog(@"Error calling ACHChecksApi->getCheck: %@", error);
   }
 }];
// Assumes check was created earlier and auth is already set. 
// See Creating a transaction page
Check result = apiInstance.getCheck("default", check.getDocumentId());