FrontStream Docs
FrontStream Payments
FrontStream Payments
  • Introducing our Embedded Form
    • Overview and Features
    • Payment Methods process
    • How to implement
    • Compare Embedded Form and Direct API integration
  • Welcome to our Payment API
    • Overview
    • Quick Start
    • API references
      • Search for a Charity for your Donation
      • Make a Payment
      • Learn how to cover Fees
      • Test Payment API Features
        • CharitySearch
        • Payment
        • Fee
      • Temp - Make a Payment - API specification
      • Temp - Charity Search API specification
      • Payment - Specification
      • Calculate Fees - Specification
    • Specification
    • CharitySearch - Specification
Powered by GitBook
On this page
Export as PDF
  1. Welcome to our Payment API
  2. API references
  3. Test Payment API Features

CharitySearch

PreviousTest Payment API FeaturesNextPayment

Last updated 5 months ago

To try a test and directly interact with the API endpoint click "Test It" and use an embedded API client to send requests with custom headers and variables, then see the live response; essentially letting you test this API directly within this page. When testing please use our Demo URL: https://demo-payments.frontstream.com/api/CharitySearch

Charity Search Example

Take a look at how you may call this method:

using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;

public class CharitySearchParams
{
    public string Name { get; set; }
    public string EIN { get; set; }
    public int? CharitySource { get; set; }
    public string City { get; set; }
    public string State { get; set; }
    public int PageIndex { get; set; } = 1;
    public int PageSize { get; set; } = 10;
    public string SortColumn { get; set; } = "NpoName";
    public bool SortDesc { get; set; } = false;
}

public class CharitySearchResponse
{
    public int TotalResultCount { get; set; }
    public int TotalPages { get; set; }
    public int PageIndex { get; set; }
    public int PageSize { get; set; }
    public object[] SearchResults { get; set; }
}

public class Program
{
    private static async Task Main(string[] args)
    {
        var charitySearchParams = new CharitySearchParams
        {
            Name = "Red Cross",
            EIN = "123456789",
            City = "New York",
            State = "NY",
            PageIndex = 1,
            PageSize = 10
        };

        var url = "https://demo-payments.frontstream.com/api/CharitySearch";

        using (var client = new HttpClient())
        {
            var query = $"?Name={charitySearchParams.Name}&EIN={charitySearchParams.EIN}&City={charitySearchParams.City}&State={charitySearchParams.State}&PageIndex={charitySearchParams.PageIndex}&PageSize={charitySearchParams.PageSize}&SortColumn={charitySearchParams.SortColumn}&SortDesc={charitySearchParams.SortDesc}";
            var response = await client.GetAsync(url + query);

            if (response.IsSuccessStatusCode)
            {
                var data = await response.Content.ReadAsStringAsync();
                var charitySearchResponse = JsonConvert.DeserializeObject<CharitySearchResponse>(data);
                Console.WriteLine($"Total Results: {charitySearchResponse.TotalResultCount}");
            }
            else
            {
                Console.WriteLine("Error: " + response.StatusCode);
            }
        }
    }
}

Postman Example for CharitySearch API:

  1. Method: GET

  2. URL: https://demo-payments.fronstream.com/api/CharitySearch

  3. Params:

    • Name: Red Cross (optional, charity name)

    • EIN: 123456789 (optional, EIN or Tax ID)

    • City: New York (optional, city)

    • State: NY (optional, state code)

    • PageIndex: 1 (optional, default 1)

    • PageSize: 10 (optional, default 10)

    • SortColumn: NpoName (optional, default sorting by name)

    • SortDesc: false (optional, sort order)

After setting these parameters, click Send to view the results.

Page cover image

Nonprofit Charity Search

get
Query parameters
Namestring · max: 70Optional

optional - Charity Name - partial or full name

EINstring · min: 9 · max: 15Optional

optional - Valid US/CA Nonprofit EIN/Tax ID. For US EINs, the dash proceeding the first two numbers is optional; the endpoint will handle it either way (i.e. 12-3456789 and 123456789 are both valid and will result in the same record being returned)

CharitySourceinteger · int32Optional

optional - This should be either 1 (US) or 2 (Canada) - Default to US

Citystring · max: 30Optional

optional - Searches the city name of charity addresses

Statestring · max: 2Optional

optional - Searches the state code of charity addresses - ISO Standard two digit State code. (VA, NY)

PageIndexinteger · int32Optional

Defaults to 1 - The page of results to display (i.e. if there are 100 overall results to your search and you provide this as 3 with a PageSize=10, this will return results #21 through #30)

PageSizeinteger · int32Optional

Defaults to 10 - The number of results to display per page.

SortColumnstringOptional

Default SortColumn NpoName - Indicates which SearchResults field to sort by (see response example for valid values). Only supports sorting by one column.

SortDescbooleanOptional

true/false - Whether or not to order the results by descending values of the selected column (or NpoName if not selected).

Responses
200
Returns Charity Search Data
application/json
400
Bad Request
application/json
404
If Charity Search Data not found
application/json
get
GET /api/CharitySearch HTTP/1.1
Host: 
Accept: */*
{
  "TotalResultCount": 1,
  "TotalPages": 1,
  "PageIndex": 1,
  "PageSize": 1,
  "SearchResults": [
    {
      "CharityId": "text",
      "NpoName": "text",
      "EIN": "text",
      "Address1": "text",
      "Address2": "text",
      "City": "text",
      "State": "text",
      "Zip": "text",
      "Country": "text",
      "NpoEligibilityFlag": true,
      "ParentOrgName": "text",
      "NTEEcode": "text"
    }
  ]
}
  • GETNonprofit Charity Search
  • Charity Search Example