ACH REST API
Simplicity of integrating your existing software utilizing the Representational State Transfer (REST).
Use of any platform (Windows/ Linux/ Solaris) and/or any programming language or developer tool for ACH REST API integration.
Simplicity of integrating your existing software utilizing the Representational State Transfer (REST).
Use of any platform (Windows/ Linux/ Solaris) and/or any programming language or developer tool for ACH REST API integration.
Get access to our comprehensive ACH REST API Developer Package. The ACH REST API Developer Package includes:
Support is available throughout the design, development, testing and post production phases of integrating the ACH REST API.
When integrating an ACH API with ACHWorks, we insist on having an ACH Best Practices call for the ACH implementation in your software.
Avoid repeating the mistakes others have made by having an in-depth call with an ACHWorks professional to review your ACH integration design. ACHWorks will walk through your planned design and the methods you intend to employ with your technical and operational staff. At each step we will point out the pro’s and con’s of using the various methodologies in the development plan.
Spending the time upfront reviewing the design with operations and technical staff within your organization significantly reduces the need to change the implementation after live deployment.
Click below for Example Sample code in: PHP, Java, C#, Visual Basic (.Net)
Sample Code in PYTHON
GetAuthKey———————————————
import requests
myheaders = {
'accept': 'application/json',
'Content-Type': 'application/json',
}
mydata = '{' \
'"SSS":"TST",' \
'"LocID":"9505",' \
'"APIUser":"MYCOMPANY5",' \
'"APIKey":"PASSWORD123",' \
'"Options":"0000"' \
'}'
response = requests.post('https://resttest.achworks.com/GetAuthKey', headers=myheaders, data=mydata)
print(response.content)
Sample Code in Java
GetAuthKey
——————————————————————
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
public class GetAuthKey {
public static void main(String[] args) {
System.out.println("ACHWorks-REST Client: GetAuthKey");
try {
URL url = new URL("https://resttest.achworks.com/GetAuthKey");
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
httpCon.setRequestMethod("POST");
httpCon.setDoOutput(true);
httpCon.setRequestMethod("POST");
httpCon.setRequestProperty("Content-Type", "application/json");
httpCon.setRequestProperty("Accept", “application/json");
OutputStream os = httpCon.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8");
String mydata = “{“ +
“\”SSS\”:\”TST\"," +
“\”LocID\":\"9505\"," +
“\”APIUser\”:\"MYCOMPANY5\"," +
“\”APIKey\":\"PASSWORD123\"," +
“\”Options\":\"0000\"" +
“}";
osw.write(mydata);
osw.flush();
osw.close();
os.close();
//httpCon.connect(); not needed because of OutputStream
String responseMessage = httpCon.getResponseMessage();
BufferedReader reader = new BufferedReader(new
InputStreamReader(httpCon.getInputStream()));
StringBuffer content = new StringBuffer();
try (reader) {
String line;
while ((line = reader.readLine()) != null) {
content.append(line);
}
} finally {
reader.close();
}
System.out.println("HTTP Response: " + responseMessage);
System.out.println("GetAuthKey Response: " + content.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
}
Sample Code in C#
GetAuthKey
——————————————————————
using System;
using System.Windows.Forms;
using System.Net;
using System.IO;
namespace TestRest1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//GetAuthKey
private void btnGetAuthKey_Click(object sender, EventArgs e)
{
System.Net.ServicePointManager.Expect100Continue = false;
const string URL = "https://resttest.achworks.com/GetAuthKey";
const string DATA = @“{
""SSS"":""TST"",
""LocID"":""9505"",
""APIUser"":""MYCOMPANY5"",
""APIKey"":""PASSWORD123"",
""Options"":""0000""
}";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
request.Method = "POST";
request.ContentType = "application/json";
request.ContentLength = DATA.Length;
using (Stream webStream = request.GetRequestStream())
using (StreamWriter requestWriter = new StreamWriter(webStream, System.Text.Encoding.ASCII))
{
requestWriter.Write(DATA);
}
try
{
WebResponse webResponse = request.GetResponse();
using (Stream webStream = webResponse.GetResponseStream() ?? Stream.Null)
using (StreamReader responseReader = new StreamReader(webStream))
{
string response = responseReader.ReadToEnd();
Console.Out.WriteLine(response);
}
}
catch (Exception error)
{
Console.Out.WriteLine("-----------------");
Console.Out.WriteLine(error.Message);
}
}
}
}
Sample Code in PHP
GetAuthKey
——————————————————————
'TST',
'LocID' => '9505',
'APIUser' => 'MYCOMPANY5',
'APIKey' => 'PASSWORD123',
'Options' => '0000'
);
$jsondata = json_encode($mydata);
$s = curl_init();
curl_setopt($s, CURLOPT_URL, 'https://resttest.achworks.com/GetAuthKey');
curl_setopt($s, CURLOPT_HEADER, true);
curl_setopt($s, CURLOPT_POSTFIELDS, $jsondata);
// Set HTTP Header for POST request
curl_setopt($s, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($jsondata))
);
//result
$result = curl_exec($s);
echo "
";print_r($result);echo “
";
// Close cURL session handle
curl_close($s);
?>
Sample Code in Javascript using XMLHTTPRequest
GetAuthKey
——————————————————————
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var response = JSON.parse(xhttp.responseText);
console.log(response.AuthKey); //or alert(response.AuthKey)
console.log(xhttp.responseText); //and/or display complete response
}
};
xhttp.open("POST", "https://RESTTest.achworks.com/GetAuthKey", true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.send("{" +
"\"SSS\":\"TST\"," +
"\"LocID\":\"9505\"," +
"\"APIUser\":\"MYCOMPANY5\"," +
"\"APIKey\":\"PASSWORD123\"," +
"\"Options\":\"0000\"" +
"}");
Sample Code in Javascript using Fetch
GetAuthKey
——————————————————————
const url='https://resttest.achworks.com/GetAuthKey';
const mydata=('{' +
'\"SSS\":\"TST\",' +
'\"LocID\":\"9505\",' +
'\"APIUser\":\"MYCOMPANY5\",' +
'\"APIKey\":\"PASSWORD123\",' +
'\"Options\":\"0000\"' +
'}');
const headersandbody={
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: mydata
};
fetch(url, headersandbody)
.then(data=>{return data.json()})
.then(res=>{console.log(res)})
.catch(error=>console.log(error))
Sample Code in Javascript using JQuery
GetAuthKey
——————————————————————
var mydata=('{' +
'\"SSS\":\"TST\",' +
'\"LocID\":\"9505\",' +
'\"APIUser\":\"MYCOMPANY5\",' +
'\"APIKey\":\"PASSWORD123\",' +
'\"Options\":\"0000\"' +
'}');
$.ajax({
url: 'https://resttest.achworks.com/GetAuthKey',
dataType: 'text',
type: 'post',
contentType: 'application/json',
data: mydata,
success: function(result){
console.log(result);
},
error: function( jqXhr, textStatus, errorThrown ){
console.log( errorThrown );
}
});
The ACH REST API has 6 methods, GetAuthKey, SendTrans, EditTrans, DeleteTrans, ViewStatusTrans, and GetAllNewStatus.
Each new customer is automatically assigned a Token. Going forward it is your option weather to store the customers name and bank account information in your system or to simply use the token, and store the customers information on the ACHWorks Secure Servers.
Checkout the ACH REST API methods below.
The ACH REST API Developer guide is a comprehensive instruction set for integrating new or legacy systems into the ACHWorks platform. The ACH REST API supports:
The developer guide includes descriptions and sample code for all methods and extensive data definitions.
We’re here to help. Get in touch to discuss special integrations or customizations.