GoodFunds Gateway - RESTful API Documentation

Customers

When posting a one-time or recurring charge to GoodFunds Gateway, you have the option of linking the payment to a customer record. If you do not supply either an existing customer_id, internal_id, a new customer record will automatically create a customer record and return the new customer_id upon a successful transaction response.

Customer records can be created, update, and deleted via the API. Furthermore, you can request data about certain customers or search all customers using search filters.

GET customers

List all customers of a specific client.

    Resource Information

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

Method Parameters

N/A

Query Parameters

Parameter Type Required Description
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, date_created
Default: last_name
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
deleted string N (default) : Will show all customers
"1" : Will Show all non deleted or removed customers
"0" : Show all deleted or removed customers

PHP Sample Request: (json format)

      $data = array(
        'filter' => array(
          'limit' =>  5
        )
      );

      if(isset($data))
      {
        $url = 'https://demo.goodfundsgateway.com/api/customers.json?' . http_build_query($data);
      }
      else
      {
        $url = 'https://demo.goodfundsgateway.com/api/customers.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": 203,
          "message": {
            "customers": [
              {
                "id": "[customer id]",
                "client_id": "[client id]",
                "internal_id": "[Internal id]",
                "first_name": "[First Name]",
                "last_name": "[Last Name]",
                "company": "[Company]",
                "address_1": "[Address 1]",
                "address_2": "[Address 2]",
                "city": "[City]",
                "state": "[State]",
                "postal_code": "[Postal Code]",
                "country": "[Country]",
                "email": "[Email]",
                "phone": "[Phone]",
                "date_created": "[Created Date]",
                "status": "[Status]"
              },
              {
                "id": "[customer id]",
                "client_id": "[client id]",
                "internal_id": "[Internal id]",
                "first_name": "[First Name]",
                "last_name": "[Last Name]",
                "company": "[Company]",
                "address_1": "[Address 1]",
                "address_2": "[Address 2]",
                "city": "[City]",
                "state": "[State]",
                "postal_code": "[Postal Code]",
                "country": "[Country]",
                "email": "[Email]",
                "phone": "[Phone]",
                "date_created": "[Created Date]",
                "status": "[Status]"
              }
            ]
          }
        }
      }
    

POST customer

Creates a customer under a specific associated client.

    Resource Information

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

Method Parameters

N/A

Query Parameters

Parameter Type Required Description
customer node Y Customer Node: Add the clients customer information into our system.
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".
email 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

PHP Sample Request: (json format)

      $data = array(
          'customer'  => array(
            'internal_id' =>  '1234567890',
            'first_name'  => 'John',
            'last_name'   => 'Doe',
            'company'     => 'Test Company',
            'address_1'   => '321 Way St.',
            'address_2'   => 'Suite 100',
            'city'        => 'San Diego',
            'state'       => 'CA',
            'postal_code' => '92020',
            'country'     => 'US',
            'email'       => 'example@domain.com',
            'phone'       => '619-333-3333'
          )
        );

      $data_string = json_encode($data);

      $url = 'https://demo.goodfundsgateway.com/api/customer.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": 200,
          "message": {
            "customer": {
              "customer_id": [Customer ID]
            }
          }
        }
      }
    

GET customer

Get details of a specific customer by either Customer ID or Internal ID. One value must be sent which could be either the Customer ID or your unique ID that you have sent to us for this customer as the Internal ID.

    Resource Information

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

Method Parameters

N/A

Query Parameters

Parameter Type Required Description
customer_id int N Required Condition: { If no internal id is sent Y }
Specific customer by Customer ID that is being requested.
internal_id string N Required Condition: { If no customer id is sent Y }
Specific customer by Internal ID that is being requested.

PHP Sample Request: (json format)

        $data = array(
          'internal_id' => [internal Id]
        );

        $url = 'https://demo.goodfundsgateway.com/api/customer.json?' . http_build_query($data);

        $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": 203,
            "message": {
              "customer": {
                "id": "[Customer ID]",
                "client_id": "[Client ID]",
                "internal_id": "[Internal ID]",
                "first_name": "[First Name]",
                "last_name": "[Last Name]",
                "company": "[Company]",
                "address_1": "[Address 1]",
                "address_2": "[Address 2]",
                "city": "[City]",
                "state": "[State]",
                "postal_code": "[Postal Code]",
                "country": "[Country]",
                "email": "[Email]",
                "phone": "[Phone Number]",
                "date_created": "[Created Date]",
                "status": "[Status]"
              }
            }
          }
        }
      

POST customer/{customerId}/update

Or

POST customer/{internalId}/update

Update details of a specific customer by either Customer ID or Internal ID.

    Resource Information

  • Method: POST
  • URL: https://demo.goodfundsgateway.com/api/customer.json/{customerId}/update
  • URL: https://demo.goodfundsgateway.com/api/customer.json/{internalId}/update
  • Requires authentication? Yes

Method Parameters

Parameter Type Required Description
customerId int N Required Condition: { If no internal id is sent Y }
Specific customer by Customer ID that is being requested.
internalId string N Required Condition: { If no customer id is sent Y }
Specific customer by Internal ID that is being requested.

Query Parameters

Parameter Type Required Description
customer node Y Customer Node: Add the clients customer information into our system.
customer_id string N Required Condition: { If no internal id is sent Y }
Specific customer by Customer ID that is being requested.
internal_id string N Required Condition: { If no customer id is sent Y }
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".
email 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

PHP Sample Request: (json format)

    $data = array(
      'customer'  => array(
        'internal_id' =>  '1234567890',
        'first_name'  => 'John',
        'last_name'   => 'Doe',
        'company'     => 'Test Company',
        'address_1'   => '321 Way St.',
        'address_2'   => 'Suite 100',
        'city'        => 'San Diego',
        'state'       => 'CA',
        'postal_code' => '92020',
        'country'     => 'US',
        'email'       => 'spencer@secureqbplugin.com',
        'phone'       => '619-333-3333'
      )
    );

    $data_string = json_encode($data);

    $customer_id = '[customer id]';

    $url = 'https://demo.goodfundsgateway.com/api/customer.json/'. $customer_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": 201,
          "message": "Updated"
        }
      }
    

POST customer/{customerId}/delete

or

POST customer/{internalId}/delete

Deletes or removes a specific customer.

    Resource Information

  • Method: POST
  • URL: https://demo.goodfundsgateway.com/api.json/customer/{customerId}/delete
  • Requires authentication? Yes

Method Parameters

Parameter Type Required Description
customerId int N Required Condition: { If no internal id is sent Y }
Specific customer by Customer ID that is being requested.

Query Parameters

N/A

PHP Sample Request: (json format)

        $data = array(
          'customer'  =>  array(
            'internal_id'   =>  '1234567890'
          )
        );

        $data_string = json_encode($data);

        $customer_id = '[customer id]';

        $url = 'https://demo.goodfundsgateway.com/api/customer.json/'. $customer_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": 202,
            "message": "Deleted"
          }
        }