Charges are individual transactions made by either a credit card or electronic check. Charges will be linked to either recurring charges and/or customers.
Charges are processed immediately via the gateway account specified by the gateway_id in the request or by the default gateway account associated with the API client. Their are two default gateway accounts for processing that can be tied to a API client, which is their default credit card processing gateway account and/or their default echeck processing gateway account.
Charges can be created and records of the charges can be retrieved. However, charges cannot be updated and/or deleted because the records serve as receipts for the transactions made via external payment gateways.
List all charges of a specific users transactions.
N/A
Parameter | Type | Required | Description |
recur_id | int | N | Get all charges linked to a recurring charge |
gateway_id | int | N | Get all charges for a specific gateway account |
customer_id | int | N | Only show payment methods for this specific customer |
internal_id | string | N | Only show payment methods for this specific customer |
billto_first_name | string | N | Search for any charges that match thier customers billing information first name |
billto_last_name | string | N | Search for any charges that match thier customers billing information last name |
card_last_four | string | N | Search for any charges that match the last four on a specific credit card |
echeck_last_four | string | N | Search for any charges that match the last four on a specific echeck account number |
filter | node | N | Filter Node for setting the following: sort, sort_dir, & limit |
sort | string | N |
Sort by either of the following values: customer_id, internal_id, method_type_cc, method_type_echeck, or payment_method_id Default: payment_method_id |
sort_dir | string | N |
Sort direction by either of the following values: ASC or DSC Default: DESC |
limit | int | N | Limits the number of results returned |
PHP Example Request:
$data = array( 'internal_id' => '123456', 'filter' => array( 'limit' => 5 ) ); if(isset($data)) { $url = 'https://demo.goodfundsgateway.com/api/charges.json?' . http_build_query($data); } else { $url = 'https://demo.goodfundsgateway.com/api/charges.json'; } $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'svs-api-id: [SVS API ID]', 'svs-api-key: [SVS API KEY]') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: (json format)
{ "status": "success", "successMessage": { "response_code": 706, "message": { "charges": [ { "id": "[Client ID]", "user_id": "[User ID]", "gateway_id": "[Gateway Account ID]", "date": "[Transaction Timestamp]", "amount": "[Amount]", "account_holder_fullname": "[Fullname Printed on Check]", "echeck_last_four": "[Bank Account Last Four]", "customer_id": "[Customer ID]", "internal_id": "[Internal ID]", "billing": { "first_name": "[Billing First Name]", "last_name": "[Billing Last Name]", "company": "[Billing Company Name]", "address_1": "[Billing Street Address]", "address_2": "[Billing Address Line 2]", "city": "[Billing City]", "state": "[Billing State]", "country": "[Billing Country]", "postal_code": "[Billing Postal Code]", "email": "[Billing Email]", "phone": "[Billing Phone]" }, "internal_name": [Internal Name], "status": "[Status]", "refunded": "[Refunded]", "type": "[Transaction Type]", "authorization": { "auth_id": "[Authorization ID]", "charge_id": "[Charge ID]", "tran_id": "[Transaction ID]", "auth_code": "[Transaction Authorization Code]", "raw_data": { [Full Transaction Response Array] } } }, { "id": "[Client ID]", "user_id": "[User ID]", "gateway_id": "[Gateway Account ID]", "date": "[Transaction Timestamp]", "amount": "[Amount]", "card_holder_fullname": "[Card Holder Fullname]", "card_type": "[Credit Card Brand]", "card_last_four": "[Credit Card Last Four]", "customer_id": "[Customer ID]", "internal_id": "[Internal ID]", "billing": { "first_name": "[Billing First Name]", "last_name": "[Billing Last Name]", "company": "[Billing Company Name]", "address_1": "[Billing Street Address]", "address_2": "[Billing Address Line 2]", "city": "[Billing City]", "state": "[Billing State]", "country": "[Billing Country]", "postal_code": "[Billing Postal Code]", "email": "[Billing Email]", "phone": "[Billing Phone]" }, "internal_name": [Internal Name], "status": "[Status]", "refunded": "[Refunded]", "type": "[Transaction Type]", "authorization": { "auth_id": "[Authorization ID]", "charge_id": "[Charge ID]", "tran_id": "[Transaction ID]", "auth_code": "[Transaction Authorization Code]", "raw_data": { [Full Transaction Response Array] } } } ] } } }
Charge a credit card.
N/A
Parameter | Type | Required | Description |
charge_type | string | Y |
"ccauthcapture" : Charge transaction as Authorization & Capture of payment "ccauthorize" : Authorize an specific amount to be captured at a later time "ccprocesspreauthorize" : Capture a proir authorized transaction |
gateway_id | int | N |
Condition: { If not included, the default credit card gateway account will be used if possible } Unique gateway account id to be used for processing credit cards. |
customer | node | N | Customer Node: Customer information node |
internal_id | string | N | A username or user ID in your own records, e.g. "Simulatedusername", "98765432". |
first_name | string | Y | Joe |
last_name | string | Y | Smith |
company | string | N | John Smith Plumbing |
address_1 | string | N | 12345 Simulated St. |
address_2 | string | N | For apartment/unit/suite #'s, eg. "Unit 2". |
city | string | N | San Diego |
state | 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" |
postal_code | string | N | The zip or postal code of the user, e.g. "A1B2C3", "90210". |
country | string | N | The ISO 3166-1 alpha-3 code of the customer's country, e.g. "CAN", "USA". |
string | N | A valid email address for the customer. Email node can be generated more than once inside the emails wrapper. | |
phone | string | N | Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555 |
billto | node | N | Billto Node: Billing information to be attached for the specific Credit Card |
first_name | string | Y | Joe |
last_name | string | Y | Smith |
company | string | N | John Smith Plumbing |
address_1 | string | N | 12345 Simulated St. |
address_2 | string | N | For apartment/unit/suite #'s, eg. "Unit 2". |
city | string | N | San Diego |
state | 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" |
postal_code | string | N | The zip or postal code of the user, e.g. "A1B2C3", "90210". |
country | string | N | The ISO 3166-1 alpha-3 code of the customer's country, e.g. "CAN", "USA". |
string | N | A valid email address for the customer. Email node can be generated more than once inside the emails wrapper. | |
phone | string | N | Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555 |
shipto | node | N | Shipto Node: Shipping information to be attached for the specific Credit Card |
first_name | string | N | Joe |
last_name | string | N | Smith |
company | string | N | John Smith Plumbing |
address_1 | string | N | 12345 Simulated St. |
address_2 | string | N | For apartment/unit/suite #'s, eg. "Unit 2". |
city | string | N | San Diego |
state | 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" |
postal_code | string | N | The zip or postal code of the user, e.g. "A1B2C3", "90210". |
country | string | N | The ISO 3166-1 alpha-3 code of the customer's country, e.g. "CAN", "USA". |
string | N | A valid email address for the customer. Email node can be generated more than once inside the emails wrapper. | |
phone | string | N | Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555 |
level2 | node | N | Level2 Node: Level2 information to be processed with this current transaction |
invoice_number | string | N | Invoice Number to be supplied with the current transaction. |
salestax | string | N | e.g. "45.67" |
po_number | string | N | Purchase Order # provided with the Credit Card for the transaction |
customer_code | string | N | Customer Code provided with the Credit Card for the transaction |
level3 | node | N | Level3 Node: Level3 information to be processed with this current transaction |
ship_from_postal_code | string | N | Postal code for the address from which the goods are shipped, e.g. "A1B2C3", "90210". |
destination_postal_code | string | N |
Postal code for the shipping address. This is the same as level3_ship_from_postal_code when your customer takes possession of the items at your location. e.g. "A1B2C3", "90210". |
frieght_number | string | N | The frieght number. |
duty_amount | string | N | Total charges for any import or export duties included in the order |
item_product_code | string | N | Product code for the item. In the United States, this may be a UPC code, part number, or product number. |
item_commodity_code | string | N | Commodity code used to classify the item. |
item_description | string | N | Text description of the item. |
item_quantity | string | N | Number of units of the item purchased. Must be a whole number. |
item_unit_of_measure | string | N | Unit of measure, or unit of measure code, for the item. |
item_extended_amount | string | N | The item extended amount. |
creditcard | node | Y | Credit Card Node: Credit Card information to be saved |
creditcard_name | string | Y | Full Name printed on Credit Card. |
creditcard_number | string | Y | Full Credit Card number otherwise known as Primary Account Number. |
creditcard_type | string | N |
Credit Card brand, e.g. "Visa", "MasterCard". Supported Brands if not present: Visa, MasterCard, Discover, AmericanExpress, DinersClub, JCB, EnRoute, & Maestro |
creditcard_exp_month | int | Y | Credit Card 2-digit expiration month, e.g. "01", "12". |
creditcard_exp_year | int | Y | Credit Card 4-digit expiration year, e.g. "2020". |
creditcard_cvv | int | N |
Credit Card Security Code, e.g. "222" or for American Express "2222". CVV: Will not be stored / saved in any manner this is just for verification of credit card purposes only |
amount | int | Y | e.g. "45.67" |
PHP Example Request: (json format)
$data = array( 'charge_type' => 'ccauthcapture', 'gateway_id' => '[Gateway ID]', 'customer' => array( 'internal_id' => '1375894109', 'first_name' => 'John', 'last_name' => 'Doe', 'company' => 'John Doe\'s Bakery', 'address_1' => '321 Way St.', 'address_2' => 'Suite 400', 'city' => 'San Diego', 'state' => 'CA', 'postal_code' => '92020', 'country' => 'US', 'phone' => '619-444-5555', 'email' => 'example@domain.com' ), 'billto' => array( 'first_name' => 'John', 'last_name' => 'Doe', 'company' => 'John Doe\'s Bakery', 'address_1' => '321 Way St.', 'address_2' => 'Suite 400', 'city' => 'San Diego', 'state' => 'CA', 'postal_code' => '92020', 'country' => 'US', 'phone' => '619-444-5555', 'email' => 'example@domain.com' ), 'shipto' => array( 'first_name' => 'John', 'last_name' => 'Doe', 'company' => 'John Doe\'s Bakery', 'address_1' => '321 Way St.', 'address_2' => 'Suite 400', 'city' => 'San Diego', 'state' => 'CA', 'postal_code' => '92020', 'country' => 'US', 'phone' => '619-444-5555', 'email' => 'example@domain.com' ), 'level2' => array( 'invoice_number' => '1090', 'salestax' => '0.00', 'customer_code' => '1111', 'po_number' => '3523' ), 'level3' => array( 'ship_from_postal_code' => '92106', 'destination_postal_code' => '92020' ), 'creditcard' => array( 'creditcard_name' => 'John Doe', 'creditcard_number' => '4111111111111111', 'creditcard_type' => 'VISA', 'creditcard_exp_month' => '05', 'creditcard_exp_year' => '2018', 'creditcard_cvv' => '222' ), 'amount' => '1.00' ); $data_string = json_encode($data); $ch = curl_init('https://demo.goodfundsgateway.com/api/charge.json'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string), 'svs-api-id: UPB0W66B96PCIXU45PRI', 'svs-api-key: 192QP4J8K4LI5M58P4VDCQN5I2GECDEEHMYPXQKJ') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: (json format)
{ "status": "success", "successMessage": { "response_code": 1, "message": { "charge": { "success": true, "charge_id": [Charge ID], "trans_id": "[Transaction ID]", "approval_code": "[Transaction Authorization Code]", "card_number": "[Masked Card Number Used]", "raw_data": { [Transaction Response Array] }, "amount": "[Amount Processed]" } } } }
Charge a credit card with a specific Payment Method.
N/A
Parameter | Type | Required | Description |
charge_type | string | Y | "ccauthcapture" : Charge transaction as Authorization & Capture of payment |
gateway_id | int | N |
Condition: { If not included, the default credit card gateway account will be used if possible } Unique gateway account id to be used for processing credit cards. |
payment_method_id | int | Y | Unique Payment Method ID stored in Secure Vault System. |
gateway_id | int | N |
Condition: { If not included, the default credit card gateway account will be used if possible } Unique gateway account id to be used for processing credit cards. |
level2 | node | N | Level2 Node: Level2 information to be processed with this current transaction |
invoice_number | string | N | Invoice Number to be supplied with the current transaction. |
salestax | string | N | e.g. "45.67" |
po_number | string | N | Purchase Order # provided with the Credit Card for the transaction |
customer_code | string | N | Customer Code provided with the Credit Card for the transaction |
creditcard | node | Y | Credit Card Node: Credit Card information to be saved |
creditcard_cvv | int | N |
Credit Card Security Code, e.g. "222" or for American Express "2222". CVV: Will not be stored / saved in any manner this is just for verification of credit card purposes only |
amount | int | Y | e.g. "45.67" |
PHP Example Request: (json format)
$data = array( 'charge_type' => 'ccauthcapture', 'gateway_id' => '[Gateway ID]', 'payment_method_id' => '[Payment Method ID]', 'level2' => array( // Level 2 data to be sent to processor 'invoice_number' => '1090', 'salestax' => '0.00', 'customer_code' => '1111', 'po_number' => '3523' ), 'creditcard' => array( // Credit Card information 'cvv' => '222' ), 'amount' => '1.00' // Total amount to charge ); $data_string = json_encode($data); $ch = curl_init('https://demo.goodfundsgateway.com/api/charge.json'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string), 'svs-api-id: [SVS API ID]', 'svs-api-key: [SVS API KEY]') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: (json format)
{ "status": "success", "successMessage": { "response_code": 1, "message": { "charge": { "success": true, "charge_id": [Charge ID], "trans_id": "[Transaction ID]", "approval_code": "[Transaction Authorization Code]", "card_number": "[Masked Card Number Used]", "raw_data": { [Transaction Response Array] }, "amount": "[Amount Processed]" } } } }
Charge a electronic check.
N/A
Parameter | Type | Required | Description |
charge_type | string | Y | "ecdebit" : Charge transaction in which money is debited from a checking account. "eccredit" : Charge transaction in which money is credited to a checking account. |
gateway_id | int | N |
Condition: { If not included, the default echeck gateway account will be used if possible } Unique gateway account id to be used for processing echecks. |
customer | node | Y | Customer Node: Customer information node |
internal_id | string | N | A username or user ID in your own records, e.g. "Simulatedusername", "98765432". |
first_name | string | Y | Joe |
last_name | string | Y | Smith |
company | string | N | John Smith Plumbing |
address_1 | string | N | 12345 Simulated St. |
address_2 | string | N | For apartment/unit/suite #'s, eg. "Unit 2". |
city | string | N | San Diego |
state | 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" |
postal_code | string | N | The zip or postal code of the user, e.g. "A1B2C3", "90210". |
country | string | N | The ISO 3166-1 alpha-3 code of the customer's country, e.g. "CAN", "USA". |
string | N | A valid email address for the customer. Email node can be generated more than once inside the emails wrapper. | |
phone | string | N | Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555 |
billto | node | Y | Billto Node: Billing information to be attached for the specific Credit Card |
first_name | string | Y | Joe |
last_name | string | Y | Smith |
company | string | N | John Smith Plumbing |
address_1 | string | N | 12345 Simulated St. |
address_2 | string | N | For apartment/unit/suite #'s, eg. "Unit 2". |
city | string | N | San Diego |
state | 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" |
postal_code | string | N | The zip or postal code of the user, e.g. "A1B2C3", "90210". |
country | string | N | The ISO 3166-1 alpha-3 code of the customer's country, e.g. "CAN", "USA". |
string | N | A valid email address for the customer. Email node can be generated more than once inside the emails wrapper. | |
phone | string | N | Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555 |
shipto | node | N | Shipto Node: Shipping information to be attached for the specific Credit Card |
first_name | string | N | Joe |
last_name | string | N | Smith |
company | string | N | John Smith Plumbing |
address_1 | string | N | 12345 Simulated St. |
address_2 | string | N | For apartment/unit/suite #'s, eg. "Unit 2". |
city | string | N | San Diego |
state | 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" |
postal_code | string | N | The zip or postal code of the user, e.g. "A1B2C3", "90210". |
country | string | N | The ISO 3166-1 alpha-3 code of the customer's country, e.g. "CAN", "USA". |
string | N | A valid email address for the customer. Email node can be generated more than once inside the emails wrapper. | |
phone | string | N | Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555 |
level2 | node | N | Level2 Node: Level2 information to be processed with this current transaction |
invoice_number | string | N | Invoice Number to be supplied with the current transaction. |
salestax | string | N | e.g. "45.67" |
po_number | string | N | Purchase Order # provided with the Credit Card for the transaction |
customer_code | string | N | Customer Code provided with the Credit Card for the transaction |
level3 | node | N | Level3 Node: Level3 information to be processed with this current transaction |
ship_from_postal_code | string | N | Postal code for the address from which the goods are shipped, e.g. "A1B2C3", "90210". |
destination_postal_code | string | N |
Postal code for the shipping address. This is the same as level3_ship_from_postal_code when your customer takes possession of the items at your location. e.g. "A1B2C3", "90210". |
frieght_number | string | N | The frieght number. |
duty_amount | string | N | Total charges for any import or export duties included in the order |
item_product_code | string | N | Product code for the item. In the United States, this may be a UPC code, part number, or product number. |
item_commodity_code | string | N | Commodity code used to classify the item. |
item_description | string | N | Text description of the item. |
item_quantity | string | N | Number of units of the item purchased. Must be a whole number. |
item_unit_of_measure | string | N | Unit of measure, or unit of measure code, for the item. |
item_extended_amount | string | N | The item extended amount. |
echeck | node | Y | ECheck Node: ECheck information to be processed with this current transaction |
echeck_name | string | Y | Full Name or Company Name as printed on the Check. |
echeck_account_number | string | Y | Bank account number as printed on the Check. |
echeck_routing_number | string | Y | Routing/Transit Number as printed on the Check. |
echeck_check_number | string | N | The check Number as printed on the Check. |
echeck_account_type | int | Y |
"0" : Business Bank Account "1" : Personal Bank Account |
echeck_holder_type | int | Y |
"0" : Checking Account "1" : Savings Account |
echeck_seccode | string | Y |
"WEB" : Internet-Initiated Entry "TEL" : Telephone-Initiated Entry "PPD" : Prearranged Payment & Deposit Entry "CCD" : Cash Concentration or Disbursement |
echeck_agree | int | Y | The agreement flag. One numeric digit value, valid values are: 1 for I agree, 0 for I do not Agree. |
echeck_bank_name | string | N | Condition: { Only required when using MyEcheck Gateway } Name of bank. |
amount | int | Y | e.g. "45.67" |
JSON Format Example
{ "charge_type":"ecdebit", "gateway_id":"[Gateway ID]", "customer": { "internal_id":"174", "first_name":"John", "last_name":"Doe", "company":"John Doe's Bakery", "address_1":"321 Way St.", "address_2":"Suite 400", "city":"San Diego", "state":"CA", "postal_code":"92020", "country":"US", "phone":"619-444-5555", "email":"demo@gmail.com" }, "billto": { "first_name":"John", "last_name":"Doe", "company":"John Doe's Bakery", "address_1":"321 Way St.", "address_2":"Suite 400", "city":"San Diego", "state":"CA", "postal_code":"92020", "country":"US", "phone":"619-444-5555", "email":"demo@gmail.com" }, "shipto": { "first_name":"John", "last_name":"Doe", "company":"John Doe's Bakery", "address_1":"321 Way St.", "address_2":"Suite 400", "city":"San Diego", "state":"CA", "postal_code":"92020", "country":"US", "phone":"619-444-5555", "email":"demo@gmail.com" }, "level2": { "invoice_number":"1090", "salestax":"0.00", "po_number":"3523", "customer_code":"1111" }, "echeck": { "echeck_name":"John Doe", "echeck_account_number":"9900000003", "echeck_routing_number":"321174851", "echeck_check_number":"2020", "echeck_account_type":"1", "echeck_holder_type":"0", "echeck_seccode":"PPD", "echeck_agree":"1" }, "amount":"1.00" }
PHP Example Request: (json format)
$data = array( 'charge_type' => 'ecdebit', //eccredit for credit transactions 'gateway_id' => '[Gateway ID]', 'customer' => array( // Customer Job From QB's 'internal_id' => '1375894109', 'first_name' => 'John', 'last_name' => 'Doe', 'company' => 'John Doe\'s Bakery', 'address_1' => '321 Way St.', 'address_2' => 'Suite 400', 'city' => 'San Diego', 'state' => 'CA', 'postal_code' => '92020', 'country' => 'US', 'phone' => '619-444-5555', 'email' => 'example@domain.com' ), 'billto' => array( // AVS billing information 'first_name' => 'John', 'last_name' => 'Doe', 'company' => 'John Doe\'s Bakery', 'address_1' => '321 Way St.', 'address_2' => 'Suite 400', 'city' => 'San Diego', 'state' => 'CA', 'postal_code' => '92020', 'country' => 'US', 'phone' => '619-444-5555', 'email' => 'example@domain.com' ), 'shipto' => array( // Shipping information 'first_name' => 'John', 'last_name' => 'Doe', 'company' => 'John Doe\'s Bakery', 'address_1' => '321 Way St.', 'address_2' => 'Suite 400', 'city' => 'San Diego', 'state' => 'CA', 'postal_code' => '92020', 'country' => 'US', 'phone' => '619-444-5555', 'email' => 'example@domain.com' ), 'level2' => array( // Level 2 data to be sent to processor 'invoice_number' => '1090', 'salestax' => '0.00', 'customer_code' => '1111', 'po_number' => '3523' ), 'level3' => array( // Level 3 data to be sent to processor 'ship_from_postal_code' => '92106', 'destination_postal_code' => '92020' ), 'echeck' => array( // ECheck information 'echeck_name' => 'John Doe', 'echeck_account_number' => '9900000003', 'echeck_routing_number' => '321174851', 'echeck_check_number' => '2020', 'echeck_account_type' => '1', 'echeck_holder_type' => '0', 'echeck_seccode' => 'PPD', 'echeck_agree' => '1' ), 'amount' => '1.00' // Total amount to charge ); $data_string = json_encode($data); $ch = curl_init('https://demo.goodfundsgateway.com/api/charge.json'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string), 'svs-api-id: [SVS API ID]', 'svs-api-key: [SVS API KEY]') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: (json format)
{ "status": "success", "successMessage": { "response_code": 1, "message": { "charge": { "success": true, "charge_id": [Charge ID], "trans_id": "[Transaction ID]", "approval_code": "NACREN", "bank_account_number": "[Masked Bank Account Number Used]", "raw_data": { [Transaction Response Array] } } } } }
Charge a electronic check with a specific Payment Method.
N/A
Parameter | Type | Required | Description |
charge_type | string | Y | "ecdebit" : Charge transaction in which money is debited from a checking account using a check. |
gateway_id | int | N |
Condition: { If not included, the default echeck gateway account will be used if possible } Unique gateway account id to be used for processing echecks. |
payment_method_id | int | Y | Unique Payment Method ID stored in Secure Vault System. |
level2 | node | N | Level2 Node: Level2 information to be processed with this current transaction |
invoice_number | string | N | Invoice Number to be supplied with the current transaction. |
salestax | string | N | e.g. "45.67" |
po_number | string | N | Purchase Order # provided with the Credit Card for the transaction |
customer_code | string | N | Customer Code provided with the Credit Card for the transaction |
echeck | node | Y | ECheck Node: ECheck information to be processed with this current transaction |
echeck_check_number | string | N | The check Number as printed on the Check. |
echeck_seccode | int | Y |
"WEB" : Internet-Initiated Entry "TEL" : Telephone-Initiated Entry "PPD" : Prearranged Payment & Deposit Entry "CCD" : Cash Concentration or Disbursement |
echeck_agree | int | Y | The agreement flag. One numeric digit value, valid values are: 1 for I agree, 0 for I do not Agree. |
amount | int | Y | e.g. "45.67" |
PHP Example Request: (json format)
$data = array( 'charge_type' => 'ecdebit', 'gateway_id' => '[Gateway ID]', 'payment_method_id' => '[Payment Method ID]', 'level2' => array( // Level 2 data to be sent to processor 'invoice_number' => '1090', 'salestax' => '0.00', 'customer_code' => '1111', 'po_number' => '3523' ), 'echeck' => array( // ECheck information 'echeck_check_number' => '2020', 'echeck_seccode' => 'PPD', 'echeck_agree' => '1' ), 'amount' => '1.00' // Total amount to charge ); $data_string = json_encode($data); $ch = curl_init('https://demo.goodfundsgateway.com/api/charge.json'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string), 'svs-api-id: [SVS API ID]', 'svs-api-key: [SVS API KEY]') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: (json format)
{ "status": "success", "successMessage": { "response_code": 1, "message": { "charge": { "success": true, "charge_id": [Charge ID], "trans_id": "[Transaction ID]", "approval_code": "NACREN", "bank_account_number": "[Masked Bank Account Used]", "raw_data": { [Transaction Full Response Array] } } } } }
Get details of a specific charge by ID.
Parameter | Type | Required | Description |
chargeId | int | Y | Unique charge id generated by Receive Pay |
N/A
PHP Example Request:
$data = '25'; $url = 'https://demo.goodfundsgateway.com/api/charge.json/' . $data; $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'svs-api-id: [SVS API ID]', 'svs-api-key: [SVS API KEY]') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: Credit Card Payment Method (json format)
{ "status": "success", "successMessage": { "response_code": 707, "message": { "charge": { "id": "[Client ID]", "user_id": "[User ID]", "gateway_id": "[Gateway Account ID]", "date": "[Transaction Timestamp]", "amount": "[Amount]", "card_holder_fullname": "[Card Holder Fullname]", "card_type": "[Credit Card Brand]", "card_last_four": "[Credit Card Last Four]", "customer_id": "[Customer ID]", "internal_id": "[Internal ID]", "billing": { "first_name": "[Billing First Name]", "last_name": "[Billing Last Name]", "company": "[Billing Company Name]", "address_1": "[Billing Street Address]", "address_2": "[Billing Address Line 2]", "city": "[Billing City]", "state": "[Billing State]", "country": "[Billing Country]", "postal_code": "[Billing Postal Code]", "email": "[Billing Email]", "phone": "[Billing Phone]" }, "internal_name": [Internal Name], "status": "[Status]", "refunded": "[Refunded]", "type": "[Transaction Type]", "authorization": { "auth_id": "[Authorization ID]", "charge_id": "[Charge ID]", "tran_id": "[Transaction ID]", "auth_code": "[Transaction Authorization Code]", "raw_data": { [Full Transaction Response Array] } } } } } }
Response data: eCheck Payment Method (json format)
{ "status": "success", "successMessage": { "response_code": 707, "message": { "charge": { "id": "[Client ID]", "user_id": "[User ID]", "gateway_id": "[Gateway Account ID]", "date": "[Transaction Timestamp]", "amount": "[Amount]", "account_holder_fullname": "[Fullname Printed on Check]", "echeck_last_four": "[Bank Account Last Four]", "customer_id": "[Customer ID]", "internal_id": "[Internal ID]", "billing": { "first_name": "[Billing First Name]", "last_name": "[Billing Last Name]", "company": "[Billing Company Name]", "address_1": "[Billing Street Address]", "address_2": "[Billing Address Line 2]", "city": "[Billing City]", "state": "[Billing State]", "country": "[Billing Country]", "postal_code": "[Billing Postal Code]", "email": "[Billing Email]", "phone": "[Billing Phone]" }, "internal_name": [Internal Name], "status": "[Status]", "refunded": "[Refunded]", "type": "[Transaction Type]", "authorization": { "auth_id": "[Authorization ID]", "charge_id": "[Charge ID]", "tran_id": "[Transaction ID]", "auth_code": "[Transaction Authorization Code]", "raw_data": { [Full Transaction Response Array] } } } } } }
Refund a credit card charge.
N/A
Parameter | Type | Required | Description |
charge_type | string | Y | "ccrefund" : This runs a two step process in one call, which will void the charge if the transaction has not settled or if settled will run the refund transaction which will return the amount back to card holder's credit card. |
gateway_id | int | N |
Condition: { If not included, the default credit card gateway account will be used if possible } Unique gateway account id to be used for processing credit cards. |
charge_id | string | Y | Unique id for that specific charge that was generated by ReceivePay. |
amount | string | N |
If process was ran as a void this does not apply to the refund which will stop the charge from going through all together. If the amount is set and the process goes to refund than the amount provided will be returned back to the card holder's credit card if not above orginal amount. If no amount is provided than the full amount of the orginal charge will be used to return the full amount back to the card holder's credit card. |
PHP Example Request: (json format)
$data = array( 'charge_type' => 'ccrefund', 'gateway_id' => '[Gateway ID]', 'charge_id' => '[Charge ID]', 'amount' => '1.00' // Total amount to charge ); $data_string = json_encode($data); $ch = curl_init('https://demo.goodfundsgateway.com/api/charge.json'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string), 'svs-api-id: [SVS API ID]', 'svs-api-key: [SVS API KEY]') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: (json format)
{ "status": "success", "successMessage": { "response_code": 1, "message": { "charge": { "success": true, "raw_data": { [Transaction Full Response Array] } } } } }
Refund a eCheck charge. Note: Depending on the gateway account this may have limited functionality.
N/A
Parameter | Type | Required | Description |
charge_type | string | Y | "ecrefund" : This runs a two step process in one call, which will void the charge if the transaction has not settled or if settled will run the refund transaction which will return the amount back to their bank account. |
gateway_id | int | N |
Condition: { If not included, the default eCheck gateway account will be used if possible } Unique gateway account id to be used for processing eChecks. |
charge_id | string | Y | Unique id for that specific charge that was generated by ReceivePay. |
amount | string | N |
If process was ran as a void this does not apply to the refund which will stop the charge from going through all together. If the amount is set and the process goes to refund than the amount provided will be returned back to their bank account if not above orginal amount. If no amount is provided than the full amount of the orginal charge will be used to return the full amount back to their bank account. |
PHP Example Request: (json format)
$data = array( 'charge_type' => 'ecrefund', 'gateway_id' => '[Gateway ID]', 'charge_id' => '[Charge ID]', 'amount' => '1.00' // Total amount to charge ); $data_string = json_encode($data); $ch = curl_init('https://demo.goodfundsgateway.com/api/charge.json'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string), 'svs-api-id: [SVS API ID]', 'svs-api-key: [SVS API KEY]') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: (json format)
{ "status": "success", "successMessage": { "response_code": 1, "message": { "charge": { "success": true, "raw_data": { [Transaction Full Response Array] } } } } }
Charge a recurring charge.
N/A
Parameter | Type | Required | Description |
charge_type | string | Y | "ecrecurring" : Setup a recurring transaction schedule from a checking account. |
gateway_id | int | N |
Condition: { If not included, the default echeck gateway account will be used if possible } Unique gateway account id to be used for processing echecks. |
customer | node | Y | Customer Node: Customer information node |
internal_id | string | N | A username or user ID in your own records, e.g. "Simulatedusername", "98765432". |
first_name | string | Y | Joe |
last_name | string | Y | Smith |
company | string | N | John Smith Plumbing |
address_1 | string | N | 12345 Simulated St. |
address_2 | string | N | For apartment/unit/suite #'s, eg. "Unit 2". |
city | string | N | San Diego |
state | 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" |
postal_code | string | N | The zip or postal code of the user, e.g. "A1B2C3", "90210". |
country | string | N | The ISO 3166-1 alpha-3 code of the customer's country, e.g. "CAN", "USA". |
string | N | A valid email address for the customer. Email node can be generated more than once inside the emails wrapper. | |
phone | string | N | Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555 |
billto | node | Y | Billto Node: Billing information to be attached for the specific Credit Card |
first_name | string | Y | Joe |
last_name | string | Y | Smith |
company | string | N | John Smith Plumbing |
address_1 | string | N | 12345 Simulated St. |
address_2 | string | N | For apartment/unit/suite #'s, eg. "Unit 2". |
city | string | N | San Diego |
state | 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" |
postal_code | string | N | The zip or postal code of the user, e.g. "A1B2C3", "90210". |
country | string | N | The ISO 3166-1 alpha-3 code of the customer's country, e.g. "CAN", "USA". |
string | N | A valid email address for the customer. Email node can be generated more than once inside the emails wrapper. | |
phone | string | N | Supported: 1-555-555-0000 | 555-555-5555 | 555.555.5555 | 555 555 5555 | (555) 555-5555 |
echeck | node | Y | ECheck Node: ECheck information to be processed with this current transaction |
echeck_name | string | Y | Full Name or Company Name as printed on the Check. |
echeck_account_number | string | Y | Bank account number as printed on the Check. |
echeck_routing_number | string | Y | Routing/Transit Number as printed on the Check. |
echeck_check_number | string | N | The check Number as printed on the Check. |
echeck_account_type | int | Y |
"0" : Business Bank Account "1" : Personal Bank Account |
echeck_holder_type | int | Y |
"0" : Checking Account "1" : Savings Account |
echeck_seccode | string | Y |
"WEB" : Internet-Initiated Entry "TEL" : Telephone-Initiated Entry "PPD" : Prearranged Payment & Deposit Entry "CCD" : Cash Concentration or Disbursement |
echeck_agree | int | Y | The agreement flag. One numeric digit value, valid values are: 1 for I agree, 0 for I do not Agree. |
echeck_bank_name | string | N | Condition: { Only required when using MyEcheck Gateway } Name of bank. |
schedule | node | Y | Schedule Node: Information about the recurring schedule for this transaction |
frequency | string | Y | monthly, weekly, quarterly, yearly |
payment_day | string | Y | Day of the month going forward to process on ( If weekly, will be day of the week; value: 0=Sun, 1=Mon, 2=Tues, 3=Wed, 4=Thur, 5=Friday,6=Sat ) |
start_date | date | Y | Date to start the recurring transaction, e.g. "2015-01-01" (YYYY-MM-DD). |
num_payments | date | Y | Either a specific number of payments or indefinite (will run forever until cancelled) |
enabled | boolean | Y | 1 for enabled, 0 for disabled |
description | string | N | Description of the recurring transaction, e.g. "Monthly Payment for Service". |
amount | int | Y | e.g. "45.67" |
JSON Format Example
{ "charge_type":"ecrecurring", "gateway_id":"[Gateway ID]", "customer": { "internal_id":"174", "first_name":"John", "last_name":"Doe", "company":"John Doe's Bakery", "address_1":"321 Way St.", "address_2":"Suite 400", "city":"San Diego", "state":"CA", "postal_code":"92020", "country":"US", "phone":"619-444-5555", "email":"demo@gmail.com" }, "billto": { "first_name":"John", "last_name":"Doe", "company":"John Doe's Bakery", "address_1":"321 Way St.", "address_2":"Suite 400", "city":"San Diego", "state":"CA", "postal_code":"92020", "country":"US", "phone":"619-444-5555", "email":"demo@gmail.com" }, "schedule": { "frequency":"monthly", "payment_day":"18", "start_date":"2025-06-18", "num_payments":"indefinite", "enabled":"1", "description":"Product Services" }, "echeck": { "echeck_name":"John Doe", "echeck_account_number":"9900000003", "echeck_routing_number":"321174851", "echeck_check_number":"2020", "echeck_account_type":"1", "echeck_holder_type":"0", "echeck_seccode":"PPD", "echeck_agree":"1" }, "amount":"1.00" }
PHP Example Request: (json format)
$data = array( 'charge_type' => 'ecdebit', //eccredit for credit transactions 'gateway_id' => '[Gateway ID]', 'customer' => array( // Customer Job From QB's 'internal_id' => '1375894109', 'first_name' => 'John', 'last_name' => 'Doe', 'company' => 'John Doe\'s Bakery', 'address_1' => '321 Way St.', 'address_2' => 'Suite 400', 'city' => 'San Diego', 'state' => 'CA', 'postal_code' => '92020', 'country' => 'US', 'phone' => '619-444-5555', 'email' => 'example@domain.com' ), 'billto' => array( // AVS billing information 'first_name' => 'John', 'last_name' => 'Doe', 'company' => 'John Doe\'s Bakery', 'address_1' => '321 Way St.', 'address_2' => 'Suite 400', 'city' => 'San Diego', 'state' => 'CA', 'postal_code' => '92020', 'country' => 'US', 'phone' => '619-444-5555', 'email' => 'example@domain.com' ), 'echeck' => array( // ECheck information 'echeck_name' => 'John Doe', 'echeck_account_number' => '9900000003', 'echeck_routing_number' => '321174851', 'echeck_check_number' => '2020', 'echeck_account_type' => '1', 'echeck_holder_type' => '0', 'echeck_seccode' => 'PPD', 'echeck_agree' => '1' ), 'schedule' => array( // Recurring schedule information 'frequency' => 'monthly', 'payment_day' => '18', 'start_date' => '2025-06-18', 'num_payments' => 'indefinite', 'enabled' => '1', 'description' => 'Product Services' ), 'amount' => '1.00' // Total amount to charge ); $data_string = json_encode($data); $ch = curl_init('https://demo.goodfundsgateway.com/api/setuprecurringcharge.json'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string), 'svs-api-id: [SVS API ID]', 'svs-api-key: [SVS API KEY]') ); $result = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $result; }
Response data: (json format)
{ "status": "success", "successMessage": { "response_code": 1, "message": { "charge": { "response_code": 100, "response_text": "Recurring Payment created.", "success": true, "recur_id": [Recurring Id], "raw_data": { [Transaction Response Array] }, "amount": "1.00" } } } }