Retrieving return details

For transactions with a current state of Returned, it's possible to get more details from the API. This includes the return reason and the effective return date.

// 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 + '/returns,
  "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);
});
ChecksApi apiInstance = new ChecksApi();
List<ModelReturn> returns = apiInstance.getReturns("default",
                                                   check.getDocumentId());
ACHChecksApi*apiInstance = [[ACHChecksApi alloc] init];

// Retrieve returns for a specific Check.
[apiInstance getReturnsWithClientId:@"default"
 documentId:[check documentId]
 completionHandler: ^(NSArray<ACHReturn>* output, NSError* error) {
   waitingForBlock = NO;
   if (output) {
     NSLog(@"%@", output);
   }
   if (error) {
     NSLog(@"Error calling ACHChecksApi->getReturns: %@", error);
   }
 }];
Client client = new Client("https://gateway.acheck21.com/GlobalGateway");
client.SetBasicAuth("[email protected]", "notArealpassw0rd");
ObservableCollection<Return> returns = 
  client.GetReturnsAsync("default", check.DocumentId).Result;

Return Data

The Return data object returned by the API for each programming language is described below

{
	documentId : <Number>,
  traceNumber : <String>,
	amount : <Number>,
  receivedOn : <Date>,
  returnedOn : <Date>,
  returnCode : <String>
  returnMessage : <String>
}
public class ModelReturn   {
  private Long documentId = null;
  private String traceNumber = null;
  private BigDecimal amount = null;
  private Date receivedOn = null;
  private Date returnedOn = null;
  private String returnCode = null;
  private String returnMessage = null;
}
@interface ACHReturn : ACHObject

@property(nonatomic) NSNumber* documentId;

@property(nonatomic) NSString* traceNumber;

@property(nonatomic) NSNumber* amount;

@property(nonatomic) NSDate* receivedOn;

@property(nonatomic) NSDate* returnedOn;

@property(nonatomic) NSString* returnCode;

@property(nonatomic) NSString* returnMessage;

@end
public partial class Return
{ 
	public long DocumentId; 
  public string TraceNumber; 
  public decimal Amount; 
  public System.DateTime ReceivedOn; 
  public System.DateTime? ReturnedOn; 
  public string ReturnCode; 
  public string ReturnMessage;
}