GoodFunds Gateway - RESTful API Documentation

Clients

Clients are the companies which will have access to the RESTful API once a User has been created with their associating X-API-KEY configured in the Secure Vault System.

GET clients

List all clients associated with your account.

    Resource Information

  • Method: GET
  • URL: https://demo.goodfundsgateway.com/demoapi/clients.json
  • Requires authentication? Yes

Method Parameters

N/A

Query Parameters

Parameter Type Required Description
salescode string N Returns all clients that are listed under the specific Sales Code
status string N (default) : No status will show all clients
"active" : Will Show all active clients
"suspended" : Show all suspended clients
"closed" : Show all deleted clients
filter node N Filter Node for setting the following: sort, sort_dir, & limit
sort string N Sort by either of the following values:
first_name, last_name, email, username, or client_id
Default: client_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 Sample Request: (json format)

      $data = array(
        'salescode' =>  'examplecode',
        'status' =>  'active',
        'filter' => array(
          'sort'      =>  'client_id',
          'limit'     =>  '5',
          'sort_dir'  =>  'ASC'
          )
      );

      if(isset($data))
      {
        $url = 'https://demo.goodfundsgateway.com/demoapi/clients.json?' . http_build_query($data);
      }
      else
      {
        $url = 'https://demo.goodfundsgateway.com/demoapi/clients.json';
      }

      $ch = curl_init($url);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
      curl_setopt($ch, CURLOPT_SSLVERSION, 6);
      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": 305,
          "message": {
            "clients": [
              {
                "id": "[Client ID]",
                "client_type_id": "[Client Type ID]",
                "client_type": "[Client Type]",
                "parent_id": "[Parent Client ID]",
                "first_name": "[First Name]",
                "last_name": "[Last Name]",
                "company": "[Company Name]",
                "address_1": "[Street Address]",
                "address_2": [Address Line 2],
                "city": "[City]",
                "state": "[State]",
                "postal_code": "[Postal Code]",
                "country": "[Country]",
                "timezone": "[Timezone]",
                "phone": "[Phone Number]",
                "email": "[Email Address]",
                "api_id": "[API ID]",
                "default_gateway_cc_id": "[Default Credit Card Gateway Account]",
                "default_gateway_echeck_id": "[Default eCheck Gateway Account]",
                "default_gateway_goodfunds_id": "[Default GoodFunds Gateway Account]",
                "softwareversion":"[Your software version]",
                "external_software_version":"QuickBooks Pro 2015",
                "vaultversion":"[Secure Vault System Version]",
                "osversion":"Microsoft Windows NT 6.1.7601 Service Pack 1",
                "brandid": "[Brand ID]",
                "created_date": "[Created Date]",
                "updated_date": "[Last Updated Date]",
                "suspended_date": "[Suspended Date]",
                "closed_date": "[Deleted Date]",
                "status": "[Status]"
              },
              {
                "id": "[Client ID]",
                "client_type_id": "[Client Type ID]",
                "client_type": "[Client Type]",
                "parent_id": "[Parent Client ID]",
                "first_name": "[First Name]",
                "last_name": "[Last Name]",
                "company": "[Company Name]",
                "address_1": "[Street Address]",
                "address_2": [Address Line 2],
                "city": "[City]",
                "state": "[State]",
                "postal_code": "[Postal Code]",
                "country": "[Country]",
                "timezone": "[Timezone]",
                "phone": "[Phone Number]",
                "email": "[Email Address]",
                "api_id": "[API ID]",
                "default_gateway_cc_id": "[Default Credit Card Gateway Account]",
                "default_gateway_echeck_id": "[Default eCheck Gateway Account]",
                "default_gateway_goodfunds_id": "[Default GoodFunds Gateway Account]",
                "softwareversion":"[Your software version]",
                "external_software_version":"QuickBooks Pro 2015",
                "vaultversion":"[Secure Vault System Version]",
                "osversion":"Microsoft Windows NT 6.1.7601 Service Pack 1",
                "brandid": "[Brand ID]",
                "created_date": "[Created Date]",
                "updated_date": "[Last Updated Date]",
                "suspended_date": "[Suspended Date]",
                "closed_date": "[Deleted Date]",
                "status": "[Status]"
              }
            ]
          }
        }
      }
      

POST client

Creates a client under your associated account.

    Resource Information

  • Method: POST
  • URL: https://demo.goodfundsgateway.com/demoapi/client.json
  • Requires authentication? Yes

Method Parameters

N/A

Query Parameters

Parameter Type Required Description
client node Y Client Node: Sets up the client's Company Information for our system.
first_name string Y Joe
last_name string Y Smith
company string Y John Smith's Body Shop
address_1 string Y 12345 Simulated St.
address_2 string N For apartment/unit/suite #'s, eg. "Unit 2".
city string Y San Diego
state string Y The state/province/region of the client. For the US and Canada, this must be supplied as the two letter abbreviation, eg. "CA"
postal_code string Y The zip or postal code of the user, e.g. "A1B2C3", "90210".
country string Y The ISO 3166-1 alpha-2 or alpha-3 code of the client's country, e.g. "US", "USA".
gmt_offset string Y The time zone offset of the user (e.g., "UM12"). Available options: UM12 (-12 GMT) to UM1, UTC (GMT), and UP1 to UP12 (+12 GMT).
phone string Y 1-555-555-0000 | (555) 555-5555 | 555-555-5555 | 555.555.5555
email string Y A valid email address for the client.
salescode string Y Provided to you by ReceivePay to associate your clients with your account.
create_admin_user int N Will create a admin user based off the client information
"1" : Will generate an admin user based off the current client information
"0" : Will not generate an admin user

PHP Sample Request: (json format)

      $data = array(
          'client'  => array(
            'email'       => 'example@domain.com',
            'first_name'  => 'John',
            'last_name'   => 'Doe',
            'phone'       => '619-333-3333',
            'company'     => 'Test Company',
            'address_1'   => '321 Way St.',
            'city'        => 'San Diego',
            'state'       => 'CA',
            'postal_code' => '92020',
            'country'     => 'US',
            'gmt_offset'  => 'UM8',
            'salescode'   => 'examplecode'
          ),
          'create_admin_user' =>  1
        );

      $data_string = json_encode($data);

      $url = 'https://demo.goodfundsgateway.com/demoapi/client.json';

      $ch = curl_init($url);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($ch, CURLOPT_SSLVERSION, 6);
      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": 300,
          "message": {
            "client": {
              "client_id": [The ID of the new client.],
              "api_id": "[The auto-generated RESTful API Identifier of the client.]"
            }
          }
        }
      }
    

GET client/{clientId}

Get details of a specific client by ID.

    Resource Information

  • Method: GET
  • URL: https://demo.goodfundsgateway.com/demoapi/client.json/{clientId}
  • Requires authentication? Yes

Method Parameters

Parameter Type Required Description
clientId int Y Specific client by ID that is being requested.

Query Parameters

Parameter Type Required Description
status string N (default) : Will show the specific client regardless of status
"active" : Will show only if client is active
"suspended" : Will show only if client is suspended
"closed" : Will show only if client is deleted

PHP Sample Request: (json format)

      $client_id = '[Client ID]';

      $url = 'https://demo.goodfundsgateway.com/demoapi/client.json/'. $client_id;

      $ch = curl_init($url);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
      curl_setopt($ch, CURLOPT_SSLVERSION, 6);
      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": 305,
          "message": {
            "client": {
              "id": "[Client ID]",
              "client_type_id": "2",
              "client_type": "End User",
              "parent_id": "[Parent Client ID]",
              "first_name": "[First Name]",
              "last_name": "[Last Name]",
              "company": "[Company Name]",
              "address_1": "[Street Address]",
              "address_2": [Address Line 2],
              "city": "[City]",
              "state": "[State]",
              "postal_code": "[Postal Code]",
              "country": "[Country]",
              "timezone": "[Timezone]",
              "phone": "[Phone Number]",
              "email": "[Email Address]",
              "api_id": "[API ID]",
              "default_gateway_id": "[Default Credit Card Gateway Account]",
              "default_echeck_gateway_id": "[Default eCheck Gateway Account]",
              "softwareversion":"[Your software version]",
              "external_software_version":"QuickBooks Pro 2015",
              "vaultversion":"[Secure Vault System Version]",
              "osversion":"Microsoft Windows NT 6.1.7601 Service Pack 1",
              "brandid": "[Brand ID]",
              "created_date": "[Created Date]",
              "updated_date": "[Last Updated Date]",
              "suspended_date": "[Suspended Date]",
              "closed_date": "[Deleted Date]",
              "status": "[Status]"
            }
          }
        }
      }
    

POST client/{clientId}/update

Update details of a specific client by ID.

    Resource Information

  • Method: POST
  • URL: https://demo.goodfundsgateway.com/demoapi/client.json/{clientId}/update
  • Requires authentication? Yes

Method Parameters

Parameter Type Required Description
clientId int Y Specific client by ID to be updated.

Query Parameters

Parameter Type Required Description
client node Y Client Node: Updates the client's Company Information for our system.
first_name string N Joe
last_name string N Smith
company string N John Smith's Body Shop
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 client. 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-2 or alpha-3 code of the client's country, e.g. "US", "USA".
gmt_offset string N The time zone offset of the user (e.g., "UM12"). Available options: UM12 (-12 GMT) to UM1, UTC (GMT), and UP1 to UP12 (+12 GMT).
phone string N 1-555-555-0000 | (555) 555-5555 | 555-555-5555 | 555.555.5555
email string N A valid email address for the client.
default_gateway_id integer N Default Credit Card Gateway ID.
default_echeck_gateway_id integer N Default ECheck Gateway ID.

PHP Sample Request: (json format)

    $data = array(
      'client'  => array(
        'email'       => 'example@domain.com',
        'first_name'  => 'John',
        'last_name'   => 'Doe',
        'phone'       => '619-333-3333',
        'company'     => 'Test Company Update',
        'address_1'   => '321 Way St.',
        'city'        => 'San Diego',
        'state'       => 'CA',
        'postal_code' => '92020',
        'country'     => 'US',
        'gmt_offset'  => 'UM8',
        'salescode'   => 'examplecode'
      )
    );

    $client_id = '[Client ID]';

    $url = 'https://demo.goodfundsgateway.com/demoapi/client.json/'. $client_id .'/update';

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_SSLVERSION, 6);
    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": 301,
          "message": "Updated"
        }
      }
    

POST client/{clientId}/suspend

Suspend a specific client by ID.

    Resource Information

  • Method: POST
  • URL: https://demo.goodfundsgateway.com/demoapi/client.json/{clientId}/suspend
  • Requires authentication? Yes

Method Parameters

Parameter Type Required Description
clientId int Y Specific client by ID to be suspended.

Query Parameters

Parameter Type Required Description
suspended_notes string N Reason for suspending account.

PHP Sample Request: (json format)

      $data = array(
        'suspended_notes'   =>  '[Reason for suspending]'
      );

      $data_string = json_encode($data);

      $client_id = '[Client ID]';

      $url = 'https://demo.goodfundsgateway.com/demoapi/client.json/'. $client_id .'/suspend';;

      $ch = curl_init($url);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($ch, CURLOPT_SSLVERSION, 6);
      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": 302,
          "message": "Suspended"
        }
      }
    

POST client/{clientId}/unsuspend

Un-Suspend a specific client by ID.

    Resource Information

  • Method: POST
  • URL: https://demo.goodfundsgateway.com/demoapi/client.json/{clientId}/unsuspend
  • Requires authentication? Yes

Method Parameters

Parameter Type Required Description
clientId int Y Specific client by ID to be suspended.

Query Parameters

N/A

PHP Sample Request: (json format)

      $client_id = '[Client ID]';

      $url = 'https://demo.goodfundsgateway.com/demoapi/client.json/'. $client_id .'/unsuspend';;

      $ch = curl_init($url);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($ch, CURLOPT_SSLVERSION, 6);
      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": 303,
          "message": "Un-Suspended"
        }
      }
    

POST client/{clientId}/delete

Deletes or removes a specific client.

    Resource Information

  • Method: POST
  • URL: https://demo.goodfundsgateway.com/demoapi/client.json/{clientId}/delete
  • Requires authentication? Yes

Method Parameters

Parameter Type Required Description
clientId int Y Specific client which will be set to a closed account.

Query Parameters

Parameter Type Required Description
closed_notes string N Reason for closing account.

PHP Sample Request: (json format)

      $data = array(
        'closed_notes'   =>  '[Reason for closing]'
      );

      $data_string = json_encode($data);

      $client_id = '[Client ID]';

      $url = 'https://demo.goodfundsgateway.com/demoapi/client.json/'. $client_id .'/delete';;

      $ch = curl_init($url);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($ch, CURLOPT_SSLVERSION, 6);
      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": 304,
            "message": "Deleted"
          }
        }