API Integration

Last updated: Jan. 31, 2019

Introduction

GoodFunds Gateway API is a secure, server based engine that provides support for transaction processing in real-time. Our RESTful API supports different formats available to use as listed below.

Sandbox Request:

If you don't currently have an account with us than you can Request Access Here

  • xml - almost any programming language can read XML
  • json - useful for JavaScript and increasingly PHP apps. [ Default format ]

This means your URLs can look like this:
https://demo.goodfundsgateway.com/v2/api/payment.json
https://demo.goodfundsgateway.com/v2/api/payment?format=json

This guide will focus on the RESTful API through the use of an integrated application.

Connections

Test connections provides your with the ability to ensure your credentials, integration and connections between our systems are 100% good.

  • Method: POST
  • URL: https://demo.goodfundsgateway.com/v2/api/connection.json

Method Parameters

N/A

Query Parameters

N/A

POST Test Connection [PHP Example]

endpoint: connection.json

<?php 
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://demo.goodfundsgateway.com/v2/api/connection.json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json",
    "GFG-API-ID: YOUR API ID",
    "GFG-API-KEY: YOU API KEY"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} 

Payment

One-time ach payments.

POST Payment ACH
  • Method: POST
  • URL: https://demo.goodfundsgateway.com/v2/api/payment.json

Method Parameters

N/A

Query Parameters

Parameter Type Required Description
gatewayId int Y Unique gateway account id generated by GoodFunds Gateway to be used.
transactionType string Y DEBIT or CREDIT
billing node Y Billing Node: Billing information for payment.
billingInternalId string N A username or user ID in your own records, e.g. "Simulatedusername", "98765432".
billingFirstName string Y Joe
billingLastName string Y Smith
billingCompany string N John Smith Plumbing
billingAddressLine1 string N 12345 Simulated St.
billingAddressLine2 string N For apartment/unit/suite #'s, eg. "Unit 2".
billingCity string N San Diego
billingState string N The state/province/region of the customer. For the US and Canada, this must be supplied as the two letter abbreviation, eg. "CA"
billingZip string N The zip or postal code of the user, e.g. "A1B2C3", "90210".
billingCountry string N The ISO 3166-1 alpha-2 code of the customer's country, e.g. "US".
billingPhone string N Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555
billingEmail string N A valid email address for the customer. Email node can be generated more than once inside the emails wrapper.
shipping node Y Shipping Node: Shipping information for payment.
shippingFirstName string Y Joe
shippingLastName string Y Smith
shippingCompany string N John Smith Plumbing
shippingAddressLine1 string N 12345 Simulated St.
shippingAddressLine2 string N For apartment/unit/suite #'s, eg. "Unit 2".
shippingCity string N San Diego
shippingState string N The state/province/region of the customer. For the US and Canada, this must be supplied as the two letter abbreviation, eg. "CA"
shippingZip string N The zip or postal code of the user, e.g. "A1B2C3", "90210".
shippingCountry string N The ISO 3166-1 alpha-2 code of the customer's country, e.g. "US".
shippingPhone string N Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555
shippingTax money N Total shipping tax amount.
ach node Y ACH Node: ACH information to be processed with this current payment
achBankName string N Name of Bank
achNameOnCheck string Y Full Name or Company Name as printed on the Check.
achAccountNumber string Y Bank account number as printed on the Check.
achRoutingNumber string Y Routing/Transit Number as printed on the Check.
achCheckNumber string N The check Number as printed on the Check.
achAccountType string Y BUSINESS or PERSONAL
achDepositType string Y CHECKING or SAVINGS
achSecCode string N default "PPD"
achAgreementFlag int Y The agreement flag. One numeric digit value, valid values are: 1 for I agree, 0 for I do not Agree.
recurringIndicator string Y TRUE if recurring transaction or FALSE not a recurring transaction.
invoiceNumber string N Invoice Number to be supplied with the current transaction.
currencyCode string N default: "USD"
amount string Y e.g. "45.67"
taxAmount string N e.g. "45.67"
POST Payment ACH [PHP Example]
<?php 
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://demo.goodfundsgateway.com/v2/api/payment.json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\r\n  \"gatewayId\":\"Your Gateway ID\",\r\n  \"transactionType\":\"DEBIT\",\r\n  \"billing\":\r\n  {\r\n  \t\"billingInternalId\":\"123456\",\r\n    \"billingFirstName\":\"John\",\r\n    \"billingLastName\":\"Doe\",\r\n    \"billingCompany\":\"John Doe's Bakery\",\r\n    \"billingAddressLine1\":\"321 Way St.\",\r\n    \"billingAddressLine2\":\"Suite 400\",\r\n    \"billingCity\":\"San Diego\",\r\n    \"billingState\":\"CA\",\r\n    \"billingZip\":\"92020\",\r\n    \"billingCountry\":\"US\",\r\n    \"billingPhone\":\"619-444-5555\",\r\n    \"billingEmail\":\"demo@gmail.com\"\r\n  },\r\n  \"shipping\":\r\n  {\r\n    \"shippingFirstName\":\"John\",\r\n    \"shippingLastName\":\"Doe\",\r\n    \"shippingCompany\":\"John Doe's Bakery\",\r\n    \"shippingAddressLine1\":\"321 Way St.\",\r\n    \"shippingAddressLine2\":\"Suite 400\",\r\n    \"shippingCity\":\"San Diego\",\r\n    \"shippingState\":\"CA\",\r\n    \"shippingZip\":\"92020\",\r\n    \"shippingCountry\":\"US\",\r\n    \"shippingPhone\":\"619-444-5555\",\r\n    \"shippingTax\":\"0.00\"\r\n  },\r\n  \"ach\":\r\n  {\r\n  \t\"achBankName\":\"Bank of West\",\r\n    \"achNameOnCheck\":\"John Doe\",\r\n    \"achAccountNumber\":\"9900000003\",\r\n    \"achRoutingNumber\":\"321174851\",\r\n    \"achCheckNumber\":\"2020\",\r\n    \"achAccountType\":\"BUSINESS\",\r\n    \"achDepositType\":\"CHECKING\",\r\n    \"achSecCode\":\"PPD\",\r\n    \"achAgreementFlag\":\"1\"    \r\n  },\r\n  \"recurringIndicator\":\"FALSE\",\r\n  \"invoiceNumber\":\"352352\",\r\n  \"currencyCode\":\"USD\",\r\n  \"amount\":\"1.00\",\r\n  \"taxAmount\":\"0.00\"\r\n}",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json",
    "GFG-API-ID: YOUR API ID",
    "GFG-API-KEY: YOU API KEY"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} 
POST Payment ACH [JSON Body Example]
{
  "gatewayId":"Your Gateway ID",
  "transactionType":"DEBIT",
  "billing":
  {
    "billingInternalId":"123456",
    "billingFirstName":"John",
    "billingLastName":"Doe",
    "billingCompany":"John Doe's Bakery",
    "billingAddressLine1":"321 Way St.",
    "billingAddressLine2":"Suite 400",
    "billingCity":"San Diego",
    "billingState":"CA",
    "billingZip":"92020",
    "billingCountry":"US",
    "billingPhone":"619-444-5555",
    "billingEmail":"demo@gmail.com"
  },
  "shipping":
  {
    "shippingFirstName":"John",
    "shippingLastName":"Doe",
    "shippingCompany":"John Doe's Bakery",
    "shippingAddressLine1":"321 Way St.",
    "shippingAddressLine2":"Suite 400",
    "shippingCity":"San Diego",
    "shippingState":"CA",
    "shippingZip":"92020",
    "shippingCountry":"US",
    "shippingPhone":"619-444-5555",
    "shippingTax":"0.00"
  },
  "ach":
  {
    "achBankName":"Bank of West",
    "achNameOnCheck":"John Doe",
    "achAccountNumber":"9900000003",
    "achRoutingNumber":"321174851",
    "achCheckNumber":"2020",
    "achAccountType":"BUSINESS",
    "achDepositType":"CHECKING",
    "achSecCode":"PPD",
    "achAgreementFlag":"1"
  },
  "recurringIndicator":"FALSE",
  "invoiceNumber":"352352",
  "currencyCode":"USD",
  "amount":"1.00",
  "taxAmount":"0.00"
}

Recurring Payment

Recurring ach setup.

POST Payment ACH
  • Method: POST
  • URL: https://demo.goodfundsgateway.com/v2/api/payment.json

Method Parameters

N/A

Query Parameters

Parameter Type Required Description
gatewayId int Y Unique gateway account id generated by GoodFunds Gateway to be used.
transactionType string Y DEBIT or CREDIT
billing node Y Billing Node: Billing information for payment.
billingInternalId string N A username or user ID in your own records, e.g. "Simulatedusername", "98765432".
billingFirstName string Y Joe
billingLastName string Y Smith
billingCompany string N John Smith Plumbing
billingAddressLine1 string N 12345 Simulated St.
billingAddressLine2 string N For apartment/unit/suite #'s, eg. "Unit 2".
billingCity string N San Diego
billingState string N The state/province/region of the customer. For the US and Canada, this must be supplied as the two letter abbreviation, eg. "CA"
billingZip string N The zip or postal code of the user, e.g. "A1B2C3", "90210".
billingCountry string N The ISO 3166-1 alpha-2 code of the customer's country, e.g. "US".
billingPhone string N Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555
billingEmail string N A valid email address for the customer. Email node can be generated more than once inside the emails wrapper.
shipping node Y Shipping Node: Shipping information for payment.
shippingFirstName string Y Joe
shippingLastName string Y Smith
shippingCompany string N John Smith Plumbing
shippingAddressLine1 string N 12345 Simulated St.
shippingAddressLine2 string N For apartment/unit/suite #'s, eg. "Unit 2".
shippingCity string N San Diego
shippingState string N The state/province/region of the customer. For the US and Canada, this must be supplied as the two letter abbreviation, eg. "CA"
shippingZip string N The zip or postal code of the user, e.g. "A1B2C3", "90210".
shippingCountry string N The ISO 3166-1 alpha-2 code of the customer's country, e.g. "US".
shippingPhone string N Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555
shippingTax money N Total shipping tax amount.
ach node Y ACH Node: ACH information to be processed with this current payment
achBankName string N Name of Bank
achNameOnCheck string Y Full Name or Company Name as printed on the Check.
achAccountNumber string Y Bank account number as printed on the Check.
achRoutingNumber string Y Routing/Transit Number as printed on the Check.
achCheckNumber string N The check Number as printed on the Check.
achAccountType string Y BUSINESS or PERSONAL
achDepositType string Y CHECKING or SAVINGS
achSecCode string N default "PPD"
achAgreementFlag int Y The agreement flag. One numeric digit value, valid values are: 1 for I agree, 0 for I do not Agree.
recurringIndicator string Y TRUE if recurring transaction or FALSE not a recurring transaction.
If TRUE recurring node is required.
recurring node Y If recurringIndicator is equal "Y" than recurring node is required.
recurringStartDate string Y Bank account number as printed on the Check.
recurringBillingCycle string Y Billing Cycle
Valid returned values, all caps and no hyphens:
MONTHLY
DAILY
recurringEndOfMonth string Y "Y" Set payment at end of month. "N" Don't set payment at end of month.
recurringNumOfPayments string Y If not installment set to 0 to continue till stopped. Otherwise set to how many payments in numeric value based off the recurring setup.
achSecCode string N default "PPD"
recurringAgreementFlag int Y The recurring agreement flag. One numeric digit value, valid values are: 1 for I agree, 0 for I do not Agree.
invoiceNumber string N Invoice Number to be supplied with the current transaction.
currencyCode string N default: "USD"
amount string Y e.g. "45.67"
taxAmount string N e.g. "45.67"
POST Payment Recurring ACH [PHP Example]
<?php 
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://demo.goodfundsgateway.com/v2/api/payment.json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\r\n  \"gatewayId\":\"YOUR GATEWAY ID\",\r\n  \"transactionType\":\"DEBIT\",\r\n  \"billing\":\r\n  {\r\n  \t\"billingInternalId\":\"123456\",\r\n    \"billingFirstName\":\"John\",\r\n    \"billingLastName\":\"Doe\",\r\n    \"billingCompany\":\"John Doe's Bakery\",\r\n    \"billingAddressLine1\":\"321 Way St.\",\r\n    \"billingAddressLine2\":\"Suite 400\",\r\n    \"billingCity\":\"San Diego\",\r\n    \"billingState\":\"CA\",\r\n    \"billingZip\":\"92020\",\r\n    \"billingCountry\":\"US\",\r\n    \"billingPhone\":\"619-444-5555\",\r\n    \"billingEmail\":\"demo@gmail.com\"\r\n  },\r\n  \"shipping\":\r\n  {\r\n    \"shippingFirstName\":\"John\",\r\n    \"shippingLastName\":\"Doe\",\r\n    \"shippingCompany\":\"John Doe's Bakery\",\r\n    \"shippingAddressLine1\":\"321 Way St.\",\r\n    \"shippingAddressLine2\":\"Suite 400\",\r\n    \"shippingCity\":\"San Diego\",\r\n    \"shippingState\":\"CA\",\r\n    \"shippingZip\":\"92020\",\r\n    \"shippingCountry\":\"US\",\r\n    \"shippingPhone\":\"619-444-5555\",\r\n    \"shippingTax\":\"0.00\"\r\n  },\r\n  \"ach\":\r\n  {\r\n  \t\"achBankName\":\"Bank of West\",\r\n    \"achNameOnCheck\":\"John Doe\",\r\n    \"achAccountNumber\":\"9900000003\",\r\n    \"achRoutingNumber\":\"321174851\",\r\n    \"achCheckNumber\":\"2020\",\r\n    \"achAccountType\":\"BUSINESS\",\r\n    \"achDepositType\":\"CHECKING\",\r\n    \"achSecCode\":\"PPD\",\r\n    \"achAgreementFlag\":\"1\"    \r\n  },\r\n  \"recurring\":\r\n  {\r\n\t\"recurringStartDate\":\"02/18/2019\",\r\n\t\"recurringBillingCycle\":\"MONTHLY\",\r\n\t\"recurringEndOfMonth\":\"N\",\r\n\t\"recurringNumOfPayments\":\"0\",\r\n\t\"recurringAgreementFlag\":\"Y\"\r\n  },\r\n  \"recurringIndicator\":\"TRUE\",\r\n  \"invoiceNumber\":\"352352\",\r\n  \"currencyCode\":\"USD\",\r\n  \"amount\":\"1.00\",\r\n  \"taxAmount\":\"0.00\"\r\n}",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json",
    "GFG-API-ID: YOUR API ID",
    "GFG-API-KEY: YOU API KEY"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} 
POST Payment Recurring ACH [JSON Body Example]
{
  "gatewayId":"Your Gateway ID",
  "transactionType":"DEBIT",
  "billing":
  {
    "billingInternalId":"123456",
    "billingFirstName":"John",
    "billingLastName":"Doe",
    "billingCompany":"John Doe's Bakery",
    "billingAddressLine1":"321 Way St.",
    "billingAddressLine2":"Suite 400",
    "billingCity":"San Diego",
    "billingState":"CA",
    "billingZip":"92020",
    "billingCountry":"US",
    "billingPhone":"619-444-5555",
    "billingEmail":"demo@gmail.com"
  },
  "shipping":
  {
    "shippingFirstName":"John",
    "shippingLastName":"Doe",
    "shippingCompany":"John Doe's Bakery",
    "shippingAddressLine1":"321 Way St.",
    "shippingAddressLine2":"Suite 400",
    "shippingCity":"San Diego",
    "shippingState":"CA",
    "shippingZip":"92020",
    "shippingCountry":"US",
    "shippingPhone":"619-444-5555",
    "shippingTax":"0.00"
  },
  "ach":
  {
    "achBankName":"Bank of West",
    "achNameOnCheck":"John Doe",
    "achAccountNumber":"9900000003",
    "achRoutingNumber":"321174851",
    "achCheckNumber":"2020",
    "achAccountType":"BUSINESS",
    "achDepositType":"CHECKING",
    "achSecCode":"PPD",
    "achAgreementFlag":"1"
  },
  "recurringIndicator":"TRUE",
  "recurring":
  {
    "recurringStartDate":"02/18/2019",
    "recurringBillingCycle":"MONTHLY",
    "recurringEndOfMonth":"N",
    "recurringNumOfPayments":"0",
    "recurringAgreementFlag":"Y"
  },
  "invoiceNumber":"352352",
  "currencyCode":"USD",
  "amount":"1.00",
  "taxAmount":"0.00"
}