Developers

We want to make payments easy for developers. Let us do the heavy lifting with these developer tools so you can simply and easily deploy payment and donation solutions.

Create a Customer Token

Once you have installed one of our API wrappers (in PHP, Ruby, or Java) you can get started right away with copy-and-paste code examples.

Create a New Token
Retrieve Customer Data from a Token

 

Update a Token

 

Create a Customer Code Token and Process an ACH/EFT Transaction (North America Only)

 

CREATE A CUSTOMER TOKEN
Creating customer code tokens allows future transactions to be carried out using the same credentials without the need to store sensitive credit card or ACH (direct debit) information on local servers.

Create a New Token
This service is to create a token from credit card details. This token can be used to do single transactions or used for recurring transactions where you manage the schedule.

Create a New Token - PHP

<?php
require 'iATS/iATS.php';

$agentCode = 'TEST88'; // Assigned by iATS
$password = 'TEST88'; // Assigned by iATS
$region = 'NA'; // NA = North America, UK = United Kingdom

// Only applies to recurring payments, but is a required parameter
$beginDate = strtotime('01/01/2014');
$endDate = strtotime('01/31/2014');

// Create and populate the request object.
$request = array(
'customerIPAddress' => '', // The client IP.
'customerCode' => '', // Optional. The iATS Customer Code.
'firstName' => 'Test', // The customer's first name.
'lastName' => 'Account', // The customer's last name.
'companyName' => 'Test Co.', // The customer's company name.
'address' => '1234 Any Street', // The customer's address.
'city' => 'Schenectady', // The customer's city.
'state' => 'NY', // The customer's state or province.
'zipCode' => '12345', // The customer's ZIP code.
'phone' => '555-555-1234', // The customer's phone number.
'fax' => '555-555-4321', // The customer's FAX number.
'alternatePhone' => '555-555-5555', // The customer's alternate phone number.
'email' => 'email@test.co', // The customer's email address.
'comment' => 'Customer code creation test.', // A comment describing this transaction.
'recurring' => FALSE, // TRUE if a recurring payment should be created.
'amount' => '5', // The payment amount.
'beginDate' => $beginDate, // The begin date of the recurring payment, if used.
'endDate' => $endDate, // The end date of the recurring payment, if used.
'scheduleType' => 'Annually', // The recurring payment schedule.
// Options: Weekly, Monthly, Quarterly, Annually.
'scheduleDate' => '', // The recurring payment schedule date.
// Options: Monthly: 1-28,29,30 or 31; Weekly: 1-7; Quarterly or Annually: empty string.
'creditCardCustomerName' => 'Test Account', // The customer's name as appears on the credit card.
'creditCardNum' => '4222222222222220', // The customer's credit card number.
'creditCardExpiry' => '12/17', // The customer's credit card expiration date.
'mop' => 'VISA', // Optional. The customer's method of payment.
'currency' => 'USD', // Optional. The customer's currency.
);

//// Make the API call using the CustomerLink service.
$iATS_CL = new iATS\CustomerLink($agentCode, $password, $region);

$response = $iATS_CL->createCreditCardCustomerCode($request);

// Verify successful call.
if (trim($response['AUTHORIZATIONRESULT']) == 'OK')
{
// Assign the new Customer Code to a new variable
$creditCardCustomerCode = $response['CUSTOMERCODE'];
}
}

Return to Top

Create a New Token - Java

import com.iatspayments.www.NetGate.*;

import java.util.GregorianCalendar;

public class CreateAToken {
public static void main(String[] args) throws Exception {

//Creates the customer link to the service
CustomerLinkService customerLink = new CustomerLinkService();
CreateCreditCardCustomerCodeV1 createCreditCardCustomerCodeV1 = new CreateCreditCardCustomerCodeV1();
createCreditCardCustomerCodeV1.setPassword("TEST");
createCreditCardCustomerCodeV1.setPassword("TEST88");
createCreditCardCustomerCodeV1.setCustomerIPAddress("");
createCreditCardCustomerCodeV1.setFirstName("Test");
createCreditCardCustomerCodeV1.setLastName("Account");
createCreditCardCustomerCodeV1.setCompanyName("Test Co");
createCreditCardCustomerCodeV1.setAddress("1234 Any Stree");
createCreditCardCustomerCodeV1.setState("NY");
createCreditCardCustomerCodeV1.setZipCode("12345");
createCreditCardCustomerCodeV1.setPhone("555-555-1234");
createCreditCardCustomerCodeV1.setFax("555-555-4321");
createCreditCardCustomerCodeV1.setAlternatePhone("555-555-5555");
createCreditCardCustomerCodeV1.setEmail("email@test.co");
createCreditCardCustomerCodeV1.setComment("Customer code creation test.");
createCreditCardCustomerCodeV1.setRecurring(false);
createCreditCardCustomerCodeV1.setAmount("5");
createCreditCardCustomerCodeV1.setScheduleDate("");
createCreditCardCustomerCodeV1.setScheduleType("Annually");
createCreditCardCustomerCodeV1.setBeginDate(new GregorianCalendar());
createCreditCardCustomerCodeV1.setEndDate(new GregorianCalendar());
createCreditCardCustomerCodeV1.setCreditCardNum("4222222222222220");
createCreditCardCustomerCodeV1.setCreditCardExpiry("12/17");
createCreditCardCustomerCodeV1.setMop("VISA");

//Creates the response which holds the customer code
IATSResponse response = customerLink.createCreditCardCustomerCode(createCreditCardCustomerCodeV1);
createCreditCardCustomerCodeV1.setCustomerCode(response.getProcessResult().getCustomerCode());
System.out.println("Customer Code (Optional): " + response.getProcessResult().getCustomerCode());
System.out.println("Authorization Result: " + response.getProcessResult().getAuthorizationResult());

}
}

Return to Top

Create a New Token - Ruby

require 'iats_payments'

# North American server:
service = ProcessLinkService.new(nil)


# UK Server:
# service = ProcessLinkService.new("https://www.iatspayments.com/NetGate/ProcessLink.asmx");

processCard = ProcessCreditCardV1.new
processCard.agentCode = "TEST88"
processCard.password = "TEST88"
processCard.creditCardNum = "4222222222222220"
processCard.creditCardExpiry = "05/15"
processCard.cvv2 = "123"
processCard.mop = "VISA"
processCard.firstName = "John"
processCard.lastName = "Smith"
processCard.address = "West Georgia St"
processCard.city = "BC"
processCard.state = "AP"
processCard.zipCode = "1312"
processCard.total = "3"
processCard.comment = "Test"
response = service.processCreditCard(processCard)
puts response.PROCESSRESULT.TRANSACTIONID, "Generated Transaction Id"

Return to Top

Retrieve Customer Data from a Token

This service allows you to see what information is stored against a particular token.

Retrieve Customer Data from a Token - PHP

<?php
require 'iATS/iATS.php';

$agentCode = 'TEST88'; // Assigned by iATS
$password = 'TEST88'; // Assigned by iATS
$region = 'NA'; // NA = North America, UK = United Kingdom

$iATS_CL = new iATS\CustomerLink($agentCode, $password, $region);

$request = array(
'customerIPAddress' => '', // Optional. The client IP.
'customerCode' => $creditCardCustomerCode, // The iATS customer code token you generated with a previous call to the CustomerLink service
);

//// Make the API call using the CustomerLink service.
$response = $iATS_CL->getCustomerCodeDetail($request);

// Response will be an array - either the returned data, or an API error.
// Handle your returned data here.

Return to Top

Retrieve Customer Data from a Token - Java

import com.iatspayments.www.NetGate.*;
import java.util.GregorianCalendar;

public class RetrieveCustomerData {

public static void main(String a[]) throws Exception {

CustomerLinkService customerLinkService = new CustomerLinkService();

CreateCreditCardCustomerCodeV1 createCreditCardCustomerCodeV1 = new CreateCreditCardCustomerCodeV1();

createCreditCardCustomerCodeV1.setPassword("TEST88");
createCreditCardCustomerCodeV1.setPassword("TEST");
createCreditCardCustomerCodeV1.setPassword("TEST88");
createCreditCardCustomerCodeV1.setCustomerIPAddress("");
createCreditCardCustomerCodeV1.setFirstName("Test");
createCreditCardCustomerCodeV1.setLastName("Account");
createCreditCardCustomerCodeV1.setCustomerCode("");
createCreditCardCustomerCodeV1.setCompanyName("Test Co");
createCreditCardCustomerCodeV1.setAddress("1234 Any Stree");
createCreditCardCustomerCodeV1.setState("NY");
createCreditCardCustomerCodeV1.setZipCode("12345");
createCreditCardCustomerCodeV1.setPhone("555-555-1234");
createCreditCardCustomerCodeV1.setFax("555-555-4321");
createCreditCardCustomerCodeV1.setAlternatePhone("555-555-5555");
createCreditCardCustomerCodeV1.setEmail("email@test.co");
createCreditCardCustomerCodeV1.setComment("Customer code creation test.");
createCreditCardCustomerCodeV1.setRecurring(false);
createCreditCardCustomerCodeV1.setAmount("5");
createCreditCardCustomerCodeV1.setScheduleDate("");
createCreditCardCustomerCodeV1.setScheduleType("Annually");
createCreditCardCustomerCodeV1.setBeginDate(new GregorianCalendar());
createCreditCardCustomerCodeV1.setEndDate(new GregorianCalendar());
createCreditCardCustomerCodeV1.setCreditCardNum("4222222222222220");
createCreditCardCustomerCodeV1.setCreditCardExpiry("12/17");
createCreditCardCustomerCodeV1.setMop("VISA");

IATSResponse response = customerLinkService.createCreditCardCustomerCode(createCreditCardCustomerCodeV1);
System.out.println("Customer code: " + response.getProcessResult().getCustomerCode());
}
}

Return to Top

Retrieve Customer Data from a Token - Ruby

class RetrieveCustomerData
require 'iats_payments'
service = CustomerLinkService.new(nil)
getCustomerCodeDetail = GetCustomerCodeDetail.new

getCustomerCodeDetail.customerIPAddress = ""
getCustomerCodeDetail.customerCode = creditCardCustomerCode

response = service.getCustomerCodeDetail(getCustomerCodeDetail)
end

Return to Top

Update a Token

This service allows you to update an existing token with new customer data, for example: a new credit card number or expiry date.

Update a Token - PHP

<?php
require 'iATS/iATS.php';

$agentCode = 'TEST88'; // Assigned by iATS
$password = 'TEST88'; // Assigned by iATS
$region = 'NA'; // NA = North America, UK = United Kingdom

$iATS_CL = new iATS\CustomerLink($agentCode, $password, $region);

$request = array(
'customerIPAddress' => '', // Optional. The client IP.
'customerCode' => $creditCardCustomerCode, // The iATS customer code token you generated with a previous call to the CustomerLink service
'firstName' => 'Test', // Optional. The customer's first name.
'lastName' => 'Account', // Optional. The customer's last name.
'companyName' => 'Test Co.', // Optional. The customer's company name.
'address' => '1234 Any Street', // Optional. The customer's address.
'city' => 'Schenectady', // Optional. The customer's city.
'state' => 'NY', // Optional. The customer's state or province.
'zipCode' => '12345', // Optional. The customer's ZIP code.
'phone' => '555-555-1234', // Optional. Optional. The customer's phone number.
'fax' => '555-555-4321', // Optional. The customer's FAX number.
'alternatePhone' => '555-555-5555', // Optional. The customer's alternate phone number.
'email' => 'email@test.co', // Optional. The customer's email address.
'comment' => 'Customer code creation test.', // Optional. A comment describing this transaction.
'recurring' => FALSE, // Optional. TRUE if a recurring payment should be created.
'amount' => '5', // Optional. The payment amount.
'beginDate' => 946684800, // Optional. The begin date of the recurring payment, if used.
'endDate' => 946771200, // Optional. The end date of the recurring payment, if used.
'scheduleType' => 'Annually', // Optional. The recurring payment schedule.
// Options: Weekly, Monthly, Quarterly, Annually.
'scheduleDate' => '', // Optional. The recurring payment schedule date.
// Options: Monthly: 1-28,29,30 or 31; Weekly: 1-7; Quarterly or Annually: empty string.
'creditCardCustomerName' => 'Test Account', // Optional. The customer's name as appears on the credit card.
'creditCardNum' => '4222222222222220', // Optional. The customer's credit card number.
'creditCardExpiry' => '12/17', // Optional. The customer's credit card expiration date.
'mop' => 'VISA', // Optional. The customer's method of payment.
'currency' => 'USD', // Optional. The customer's currency.
'updateCreditCardNum' => FALSE, // Optional. TRUE when the customer's credit card number should be updated.
);


//// Make the API call using the CustomerLink service.
$response = $iATS_CL->updateCreditCardCustomerCode($request);

var_dump($response);
// Verify successful call.
if (trim($response['AUTHORIZATIONRESULT']) == 'OK')
{
// Assign the new Customer Code to a new variable
$creditCardCustomerCode = $response['CUSTOMERCODE'];
}

Return to Top

Update a Token - Java

import com.iatspayments.www.NetGate.*;

import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

public class UpdateCustomerData {

public static void main(String[] args) throws Exception{
CustomerLinkService customerLink = new CustomerLinkService();

//Sets the data for the customer
UpdateCreditCardCustomerCodeV1 updateCreditCardCustomerCodeV1 = new UpdateCreditCardCustomerCodeV1();
updateCreditCardCustomerCodeV1.setCustomerIPAddress("123.123.123.1");
updateCreditCardCustomerCodeV1.setPassword("TEST88");
updateCreditCardCustomerCodeV1.setAgentCode("TEST88");
updateCreditCardCustomerCodeV1.setCity("Schenectady");
updateCreditCardCustomerCodeV1.setZipCode("12345");
updateCreditCardCustomerCodeV1.setPhone("555-555-1234");
updateCreditCardCustomerCodeV1.setFax("555-555-4321");
updateCreditCardCustomerCodeV1.setAlternatePhone("555-555-5555");
updateCreditCardCustomerCodeV1.setEmail("email@test.co");
updateCreditCardCustomerCodeV1.setComment("Customer code creation test");
updateCreditCardCustomerCodeV1.setRecurring(false);
updateCreditCardCustomerCodeV1.setAmount("5");
updateCreditCardCustomerCodeV1.setScheduleDate("Annually");
updateCreditCardCustomerCodeV1.setScheduleDate("");
updateCreditCardCustomerCodeV1.setCreditCardCustomerName("Test Account");
updateCreditCardCustomerCodeV1.setCreditCardNum("4222222222222220");
updateCreditCardCustomerCodeV1.setCreditCardExpiry("12/17");
updateCreditCardCustomerCodeV1.setMop("VISA");
updateCreditCardCustomerCodeV1.setUpdateCreditCardNum(false);
updateCreditCardCustomerCodeV1.setBeginDate(new GregorianCalendar());
updateCreditCardCustomerCodeV1.setEndDate(new GregorianCalendar());

IATSResponse response = customerLink.updateCreditCardCustomerCode(updateCreditCardCustomerCodeV1);

//Sets the customer code
updateCreditCardCustomerCodeV1.setCustomerCode(response.getProcessResult().getCustomerCode());
System.out.println("Authorization Result: " + response.getProcessResult().getAuthorizationResult());
System.out.println("New Customer Code: " + response.getProcessResult().getCustomerCode());

}
}

Return to Top

Update a Token - Ruby

class UpdateCustomerData

require 'iats_payments'

service = CustomerLinkService.new(nil)
updateCreditCardCustomerCode = UpdateCreditCardCustomerCode.new

updateCreditCardCustomerCode.customerIPAddress = ""
updateCreditCardCustomerCode.customerCode = customerCode
updateCreditCardCustomerCode.firstName = "Test"
updateCreditCardCustomerCode.lastName = ""
updateCreditCardCustomerCode.companyName = "Test Co."
updateCreditCardCustomerCode.address = "1234 Any Street"
updateCreditCardCustomerCode.city = "Schenectady"
updateCreditCardCustomerCode.state = "NY"
updateCreditCardCustomerCode.zipCode = "12345"
updateCreditCardCustomerCode.phone = "555-555-1234"
updateCreditCardCustomerCode.fax = "555-555-4321"
updateCreditCardCustomerCode.alternatePhone = "555-555-5555"
updateCreditCardCustomerCode.email = "email@test.co"
updateCreditCardCustomerCode.comment = "Customer code creation test"
updateCreditCardCustomerCode.recurring = false
updateCreditCardCustomerCode.amount = "5"
updateCreditCardCustomerCode.scheduleType = "Monthly"
updateCreditCardCustomerCode.creditCardCustomerName = "Test Account"
updateCreditCardCustomerCode.creditCardNum = "4222222222222220"
updateCreditCardCustomerCode.creditCardExpiry = "12/17"
updateCreditCardCustomerCode.mop = "VISA"
updateCreditCardCustomerCode.currency = "USD"

response = service.updateCreditCardCustomerCode(updateCreditCardCustomerCode)
puts response.AUTHORIZATIONRESULT, "Updated the information."

end

Return to Top

Create a Customer Code Token and Process an ACH/EFT Transaction (North America Only)

Unlike credit card processing, ACH transactions are not processed in real time.

When an ACH transaction is submitted, iATS provides a general response of OK:555555, which indicates iATS has received the transaction attempt and that the request is pending approval.

Please note the format for the bank account details:

  • USD: Routing no. (9 digits) + account no. (# of digits varies)
  • CAD: Bank no. (3 digits) + transit no. (5 digits) + account no. (# of digits varies)

* Order must be followed with NO spaces/dashes. Example: 12312345123456789

Create a Customer Code Token and Process an ACH/EFT Transaction (North America Only) - PHP

<?php
require 'iATS/iATS.php';

$agentCode = 'TEST88'; // Assigned by iATS
$password = 'TEST88'; // Assigned by iATS

$iATS_PL = new iATS\ProcessLink($agentCode, $password);

// Create and populate the request object.
$request = array(
'customerIPAddress' => '', // Optional. The client IP.
'firstName' => 'Test', // The customer's first name.
'lastName' => 'Account', // The customer's last name.
'address' => '1234 Any Street', // The customer's address.
'city' => 'Schenectady', // The customer's city.
'state' => 'NY', // The customer's state or province.
'zipCode' => '12345', // The customer's ZIP code.
'accountNum' => '02100002100000000000000001', // The customer's bank account number.
'accountType' => 'CHECKING', // The customer's bank account type.
// Options: CHECKING, SAVING (North America only.)
'invoiceNum' => '00000001', // Optional. The invoice number for this transaction.
'total' => '5', // The total payment amount.
'comment' => 'Process ACH / EFT test.' // Optional. A comment describing this transaction.
);

// Make the API call
$response = $iATS_PL->createCustomerCodeAndProcessACHEFT($request);

// For debugging.
var_dump($response);

// Verify successful call.
if (substr(trim($response['AUTHORIZATIONRESULT']),0,2) == 'OK'){
print '<br/>iATS accepted the transaction';
// Do something with your returned data
$acheftCustomerCode = $response['CUSTOMERCODE'];
$acheftTransactionID = $response['TRANSACTIONID'];
} else {
// Handle failed transaction
print '<br/>Something went wrong.';
}

Return to Top

Create a Customer Code Token and Process an ACH/EFT Transaction (North America Only) - Java

import com.iatspayments.www.NetGate.*;

import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

public class UpdateCustomerData {
public static void main(String[] args) throws Exception{
ProcessLinkService processLink = new ProcessLinkService();

CreateCustomerCodeAndProcessACHEFT createCustomerCodeAndProcessACHEFT = new CreateCustomerCodeAndProcessACHEFT();
createCustomerCodeAndProcessACHEFT.setCustomerIPAddress = ""
createCustomerCodeAndProcessACHEFT.setFirstName = "Test"
createCustomerCodeAndProcessACHEFT.setLastName = "Account"
createCustomerCodeAndProcessACHEFT.setAddress = "1234 Any Street"
createCustomerCodeAndProcessACHEFT.setCity = "Schenectady"
createCustomerCodeAndProcessACHEFT.setState = "NY"
createCustomerCodeAndProcessACHEFT.setZipCode = "12345"
createCustomerCodeAndProcessACHEFT.setAccountNum = "02100002100000000000000001:
createCustomerCodeAndProcessACHEFT.setAccountType = "CHECKING"
createCustomerCodeAndProcessACHEFT.setInvoiceNum = "00000001"
createCustomerCodeAndProcessACHEFT.setTotal = "5"
createCustomerCodeAndProcessACHEFT.setComment = "Process ACH / EFT test."

IATSResponse response = customerLink.updateCreditCardCustomerCode(updateCreditCardCustomerCodeV1);

//Sets the customer code
System.out.println("Authorization Result: " + response.getProcessResult().getTransactionID());
System.out.println("New Customer Code: " + response.getProcessResult().getCustomerCode());
}
}

Return to Top

Create a Customer Code Token and Process an ACH/EFT Transaction (North America Only) - Ruby

class createCustomerCodeAndProcessACHEFTTransaction
require 'iats_payments'

processLink = ProcessLinkService.new(nil)
createCustomerCodeAndProcessACHEFT = CreateCustomerCodeAndProcessACHEFT.new
createCustomerCodeAndProcessACHEFT.customerIPAddress = ""
createCustomerCodeAndProcessACHEFT.firstName = "Test"
createCustomerCodeAndProcessACHEFT.lastName = "Account"
createCustomerCodeAndProcessACHEFT.address = "1234 Any Street"
createCustomerCodeAndProcessACHEFT.city = "Schenectady"
createCustomerCodeAndProcessACHEFT.state = "NY"
createCustomerCodeAndProcessACHEFT.zipCode = "12345"
createCustomerCodeAndProcessACHEFT.accountNum = "02100002100000000000000001:
createCustomerCodeAndProcessACHEFT.accountType = "CHECKING"
createCustomerCodeAndProcessACHEFT.invoiceNum = "00000001"
createCustomerCodeAndProcessACHEFT.total = "5"
createCustomerCodeAndProcessACHEFT.comment = "Process ACH / EFT test."

response = processLink.createCustomerCodeAndProcessACHEFT(createCustomerCodeAndProcessACHEFT)
puts response.AUTHORIZATIONRESULT, "Updated the information."

end

Return to Top

Contact Us