Organizations API

The API for managing organizations and organization-related data in the Pushpay platform


Get Organization

GET /v1/organization/{organizationKey}

Retrieves the details of the organization

Path (URL) Parameters

Name Type Description
organizationKey string

The unique key of the organization - a case-sensitive series of characters

Required Scopes

Scope Description
read Read-only access to resources owned by the subject claim of the token

Retrieve details of organization by its key

Request

GET /v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
organizationKey MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA path

The unique key of the organization - a case-sensitive series of characters

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "key": "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA", "v3OrganizationKey": "df21b3c4e4303167ec70143c8ca1dd78", "name": "Widgets Inc", "status": "Active", "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA" }, "funds": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/funds" }, "batches": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/batches" } } }
<?php
/*
	Example 1
	Retrieve details of organization by its key
*/
$organizationKey = 'MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA';
$url = "https://api.pushpay.com/v1/organization/$organizationKey";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 1
 * Retrieve details of organization by its key
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		httpConnection.disconnect();
	}

	class Response {
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 1
# Retrieve details of organization by its key
set oAuthToken=%1
set organizationKey="MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA"
set url="https://api.pushpay.com/v1/organization/%organizationKey%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example1
	{

		/// <summary>
		///	Example 1
		/// </summary>
		/// <remarks>
		///	Retrieve details of organization by its key
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
				var requestUrl = string.Format("/v1/organization/{0}", organizationKey);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

Retrieve details of a non-existent organization

Request

GET /v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
organizationKey MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA path

The unique key of the organization - a case-sensitive series of characters

Response

Status 404 (Not Found)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "message": "Organization does not exist" }
<?php
/*
	Example 2
	Retrieve details of a non-existent organization
*/
$organizationKey = 'MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA';
$url = "https://api.pushpay.com/v1/organization/$organizationKey";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 2
 * Retrieve details of a non-existent organization
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		httpConnection.disconnect();
	}

	class Response {
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 2
# Retrieve details of a non-existent organization
set oAuthToken=%1
set organizationKey="MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA"
set url="https://api.pushpay.com/v1/organization/%organizationKey%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example2
	{

		/// <summary>
		///	Example 2
		/// </summary>
		/// <remarks>
		///	Retrieve details of a non-existent organization
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
				var requestUrl = string.Format("/v1/organization/{0}", organizationKey);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

Get Organization Campuses

GET /v1/organization/{organizationKey}/campuses

Retrieves the details of the organization's campuses

Path (URL) Parameters

Name Type Description
organizationKey string

The unique key of the organization - a case-sensitive series of characters

Required Scopes

Scope Description
read Read-only access to resources owned by the subject claim of the token

Retrieve details of organization campuses

Request

GET /v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/campuses

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
organizationKey MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA path

The unique key of the organization - a case-sensitive series of characters

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "organizationKey": "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA", "campuses": [ { "name": "North humberbrook", "merchantListings": [ { "campus": { "name": "North humberbrook", "key": "MTM2NTIwOjBoV0h4YktXRVRzSmQwOFR2RzN4R0dzWnJUbw" }, "merchantListing": { "key": "NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ", "handle": "newlife", "name": "Newlife Church", "role": "merchant" } } ] }, { "name": "South timberdowns", "merchantListings": [ { "campus": { "name": "South timberdowns", "key": "MTM2NTMwOlN1TGs0by11amNXLUR5SmdTenhrbVNUMFBLTQ" }, "merchantListing": { "key": "NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ", "handle": "newlife", "name": "Newlife Church", "role": "merchant" } } ] }, { "name": "Central", "merchantListings": [ { "campus": { "name": "Central", "key": "MTM2NTIwOjBoV0h4YktXRVRzSmQwOFR2RzN4R0dzWnJUbw" }, "merchantListing": { "key": "NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ", "handle": "newlife", "name": "Newlife Church", "role": "merchant" } }, { "campus": { "name": "Central", "key": "MTM2NTMwOlN1TGs0by11amNXLUR5SmdTenhrbVNUMFBLTQ" }, "merchantListing": { "key": "Nzg5OlhOUHVVUUlUUXYwTXhFa0FGMmQzTXNMc09fZw", "handle": "nlstaff", "name": "Newlife Staff Support", "role": "merchant" } } ] }, { "name": "Newlife Events", "merchantListings": [ { "campus": { "name": "Newlife Events", "key": "MTIzOkRUclhHb1Jtc24tX3NKMGxjZzJ3cUJqb1ZlTQ" }, "merchantListing": { "key": "MTIzOkRUclhHb1Jtc24tX3NKMGxjZzJ3cUJqb1ZlTQ", "handle": "nlevents", "name": "Newlife Events", "role": "merchant" } } ] } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/campuses" } } }
<?php
/*
	Example 1
	Retrieve details of organization campuses
*/
$organizationKey = 'MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA';
$url = "https://api.pushpay.com/v1/organization/$organizationKey/campuses";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 1
 * Retrieve details of organization campuses
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/campuses";

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		httpConnection.disconnect();
	}

	class Response {
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 1
# Retrieve details of organization campuses
set oAuthToken=%1
set organizationKey="MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA"
set url="https://api.pushpay.com/v1/organization/%organizationKey%/campuses"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example1
	{

		/// <summary>
		///	Example 1
		/// </summary>
		/// <remarks>
		///	Retrieve details of organization campuses
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
				var requestUrl = string.Format("/v1/organization/{0}/campuses", organizationKey);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

Retrieve details of organization campuses for non-existent organization

Request

GET /v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/campuses

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
organizationKey MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA path

The unique key of the organization - a case-sensitive series of characters

Response

Status 404 (Not Found)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "message": "Organization does not exist" }
<?php
/*
	Example 2
	Retrieve details of organization campuses for non-existent organization
*/
$organizationKey = 'MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA';
$url = "https://api.pushpay.com/v1/organization/$organizationKey/campuses";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 2
 * Retrieve details of organization campuses for non-existent organization
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/campuses";

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		httpConnection.disconnect();
	}

	class Response {
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 2
# Retrieve details of organization campuses for non-existent organization
set oAuthToken=%1
set organizationKey="MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA"
set url="https://api.pushpay.com/v1/organization/%organizationKey%/campuses"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example2
	{

		/// <summary>
		///	Example 2
		/// </summary>
		/// <remarks>
		///	Retrieve details of organization campuses for non-existent organization
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
				var requestUrl = string.Format("/v1/organization/{0}/campuses", organizationKey);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

List Organization's Merchant Listings

GET /v1/organization/{organizationKey}/merchantlistings

You can find merchants that belong to a specific organization. You can further filter this list by using one or more parameters for:

  • country (Country, valid values are NZ, AU, CA or US currently).
  • name (Full or partial name)
  • handle (the full handle for a merchant)

Note: Unfiltered requests will return merchants of Status = Active and Visibility = Visible

Path (URL) Parameters

Name Type Description
organizationKey string

The unique key of the organization - a case-sensitive series of characters

Query string (URL) parameters

Name Type Description
name string

One or more terms between spaces which will each be matched partially against the name of the merchant

handle string

The unique text 'handle' assigned to the merchant

country string

The country the Merchant resides within

visibility string

Only include merchant listings matching the specified visibility - Visible/Hidden

status string

Only include merchant listings matching the specified status - Active/Pending/Closed

page integer

The page parameter (Note: page numbering starts at 0)

pageSize integer

The page size parameter (Note: default page size is 25)

Required Scopes

Scope Description
read Read-only access to resources owned by the subject claim of the token

List an organization's merchant listings

Request

GET /v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/merchantlistings?page=0&pageSize=25

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
organizationKey MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA path

The unique key of the organization - a case-sensitive series of characters

name query

One or more terms between spaces which will each be matched partially against the name of the merchant

handle query

The unique text 'handle' assigned to the merchant

country query

The country the Merchant resides within

visibility query

Only include merchant listings matching the specified visibility - Visible/Hidden

status query

Only include merchant listings matching the specified status - Active/Pending/Closed

page 0 query

The page parameter (Note: page numbering starts at 0)

pageSize 25 query

The page size parameter (Note: default page size is 25)

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "homeCountry": "NZ", "visibility": "Visible", "status": "Active", "version": 50, "key": "MTIzOkRUclhHb1Jtc24tX3NKMGxjZzJ3cUJqb1ZlTQ", "handle": "widgetinc", "name": "Widgets Inc", "address": "123 Summer Grove", "location": { "latitude": -36.8567852, "longitude": 174.7583516 }, "paymentParameters": { "currency": "USD", "payButtonLabel": "Pay", "limits": { "min": 10.0, "max": 15000.0 }, "paymentPlaceholder": "e.g. 50.00", "mustBePaidInSafari": false }, "referenceDefinitions": [ { "id": 3, "order": 0, "valueType": "Text", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Full Name", "placeholder": "Full Name", "maxLength": 100 }, { "id": 4, "order": 0, "valueType": "Email", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Email", "placeholder": "Email", "maxLength": 100 }, { "id": 4, "order": 0, "valueType": "Email", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Phone", "placeholder": "Phone Number" }, { "id": 123, "order": 0, "valueType": "SingleSelect", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Widget Color", "choices": [ { "label": "Blue", "value": "bl", "order": 0, "isDefault": false }, { "label": "Green", "value": "grn", "order": 0, "isDefault": false }, { "label": "Black", "value": "blk", "order": 0, "isDefault": true } ] } ], "logo": { "android": { "size": 150, "href": "https://pushpay.com/images/merchantlogo/50/123/1" }, "iOS": { "size": 108, "href": "https://pushpay.com/images/merchantlogo/50/123/0" }, "admin": { "size": 80, "href": "https://pushpay.com/images/merchantlogo/50/123/2" }, "account": { "size": 140, "href": "https://pushpay.com/images/merchantlogo/50/123/3" } }, "colors": { "primary": "#cf150a" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTIzOkRUclhHb1Jtc24tX3NKMGxjZzJ3cUJqb1ZlTQ" }, "merchantsettlements": { "href": "https://api.pushpay.com/v1/merchant/MTIzOkRUclhHb1Jtc24tX3NKMGxjZzJ3cUJqb1ZlTQ/settlements" }, "merchantBatches": { "href": "https://api.pushpay.com/v1/merchant/MTIzOkRUclhHb1Jtc24tX3NKMGxjZzJ3cUJqb1ZlTQ/batches" } } }, { "homeCountry": "US", "visibility": "Visible", "status": "Active", "version": 50, "key": "NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ", "handle": "gadgetinc", "name": "Gadgets Inc", "address": "456 Winter Close", "location": { "latitude": 33.6901439, "longitude": -117.897274 }, "paymentParameters": { "currency": "USD", "payButtonLabel": "Pay", "limits": { "min": 10.0, "max": 15000.0 }, "paymentPlaceholder": "e.g. 50.00", "mustBePaidInSafari": false }, "referenceDefinitions": [ { "id": 3, "order": 0, "valueType": "Text", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Full Name", "placeholder": "Full Name", "maxLength": 100 }, { "id": 4, "order": 0, "valueType": "Email", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Email", "placeholder": "Email", "maxLength": 100 }, { "id": 4, "order": 0, "valueType": "Email", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Phone", "placeholder": "Phone Number" }, { "id": 123, "order": 0, "valueType": "SingleSelect", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Widget Color", "choices": [ { "label": "Blue", "value": "bl", "order": 0, "isDefault": false }, { "label": "Green", "value": "grn", "order": 0, "isDefault": false }, { "label": "Black", "value": "blk", "order": 0, "isDefault": true } ] } ], "logo": { "android": { "size": 150, "href": "https://pushpay.com/images/merchantlogo/50/456/1" }, "iOS": { "size": 108, "href": "https://pushpay.com/images/merchantlogo/50/456/0" }, "admin": { "size": 80, "href": "https://pushpay.com/images/merchantlogo/50/456/2" }, "account": { "size": 140, "href": "https://pushpay.com/images/merchantlogo/50/456/3" } }, "colors": { "primary": "#cf150a" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ" }, "merchantsettlements": { "href": "https://api.pushpay.com/v1/merchant/NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ/settlements" }, "merchantBatches": { "href": "https://api.pushpay.com/v1/merchant/NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ/batches" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/merchantlistings" } } }
<?php
/*
	Example 1
	List an organization's merchant listings
*/
$organizationKey = 'MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/merchantlistings?page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
	$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 1
 * List an organization's merchant listings
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/merchantlistings?page=" + page + "&pageSize=" + pageSize;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		// Store the link to the next page in a variable
		URL nextLink = response._links.next.href;
		httpConnection.disconnect();
	}

	class Response {
		public int page { get; set; }
		public int pageSize { get; set; }
 		public int total { get; set; }
 		public int totalPages { get; set; }
 		public Response[] items { get; set; }
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
		public Link next;
		public Link prev;
		public Link first;
		public Link last;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 1
# List an organization's merchant listings
set oAuthToken=%1
set organizationKey="MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/merchantlistings?page=%page%&pageSize=%pageSize%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example1
	{

		/// <summary>
		///	Example 1
		/// </summary>
		/// <remarks>
		///	List an organization's merchant listings
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organization/{0}/merchantlistings?page={1}&pageSize={2}", organizationKey, 
					page, pageSize);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					var nextLink = response.Links.Next;
					Console.WriteLine(nextLink);
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		public int Page { get; set; }
		public int PageSize { get; set; }
 		public int Total { get; set; }
 		public int TotalPages { get; set; }
 		public Response[] Items { get; set; }
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
		public Link Next { get; set; }
		public Link Prev { get; set; }
		public Link First { get; set; }
		public Link Last { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

List an organization's merchant listings with filters

Request

GET /v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/merchantlistings?country=US&page=0&pageSize=25&status=Active

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
organizationKey MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA path

The unique key of the organization - a case-sensitive series of characters

name query

One or more terms between spaces which will each be matched partially against the name of the merchant

handle query

The unique text 'handle' assigned to the merchant

country US query

The country the Merchant resides within

visibility query

Only include merchant listings matching the specified visibility - Visible/Hidden

status Active query

Only include merchant listings matching the specified status - Active/Pending/Closed

page 0 query

The page parameter (Note: page numbering starts at 0)

pageSize 25 query

The page size parameter (Note: default page size is 25)

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "homeCountry": "US", "visibility": "Visible", "status": "Active", "version": 50, "key": "NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ", "handle": "gadgetinc", "name": "Gadgets Inc", "address": "456 Winter Close", "location": { "latitude": 33.6901439, "longitude": -117.897274 }, "paymentParameters": { "currency": "USD", "payButtonLabel": "Pay", "limits": { "min": 10.0, "max": 15000.0 }, "paymentPlaceholder": "e.g. 50.00", "mustBePaidInSafari": false }, "referenceDefinitions": [ { "id": 3, "order": 0, "valueType": "Text", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Full Name", "placeholder": "Full Name", "maxLength": 100 }, { "id": 4, "order": 0, "valueType": "Email", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Email", "placeholder": "Email", "maxLength": 100 }, { "id": 4, "order": 0, "valueType": "Email", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Phone", "placeholder": "Phone Number" }, { "id": 123, "order": 0, "valueType": "SingleSelect", "hasChoices": false, "isHidden": false, "isRequired": true, "label": "Widget Color", "choices": [ { "label": "Blue", "value": "bl", "order": 0, "isDefault": false }, { "label": "Green", "value": "grn", "order": 0, "isDefault": false }, { "label": "Black", "value": "blk", "order": 0, "isDefault": true } ] } ], "logo": { "android": { "size": 150, "href": "https://pushpay.com/images/merchantlogo/50/456/1" }, "iOS": { "size": 108, "href": "https://pushpay.com/images/merchantlogo/50/456/0" }, "admin": { "size": 80, "href": "https://pushpay.com/images/merchantlogo/50/456/2" }, "account": { "size": 140, "href": "https://pushpay.com/images/merchantlogo/50/456/3" } }, "colors": { "primary": "#cf150a" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ" }, "merchantsettlements": { "href": "https://api.pushpay.com/v1/merchant/NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ/settlements" }, "merchantBatches": { "href": "https://api.pushpay.com/v1/merchant/NDU2OkQwWXNvVzJZVmVHNE5PdUw5Ym0xWGRBLU9HQQ/batches" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/merchantlistings" } } }
<?php
/*
	Example 2
	List an organization's merchant listings with filters
*/
$organizationKey = 'MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA';
$country = 'US';
$status = 'Active';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/merchantlistings?country=$country&status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
	$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 2
 * List an organization's merchant listings with filters
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
		String country = "US";
		String status = "Active";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/merchantlistings?country=" + country + "&status=" + status + "&page=" + page + "&pageSize=" + pageSize;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		// Store the link to the next page in a variable
		URL nextLink = response._links.next.href;
		httpConnection.disconnect();
	}

	class Response {
		public int page { get; set; }
		public int pageSize { get; set; }
 		public int total { get; set; }
 		public int totalPages { get; set; }
 		public Response[] items { get; set; }
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
		public Link next;
		public Link prev;
		public Link first;
		public Link last;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 2
# List an organization's merchant listings with filters
set oAuthToken=%1
set organizationKey="MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA"
set country="US"
set status="Active"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/merchantlistings?country=%country%&status=%status%&page=%page%&pageSize=%pageSize%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example2
	{

		/// <summary>
		///	Example 2
		/// </summary>
		/// <remarks>
		///	List an organization's merchant listings with filters
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
				var country = "US";
				var status = "Active";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organization/{0}/merchantlistings?country={1}&status={2}&page={3}&pageSize={4}", organizationKey, 
					country, status, page, pageSize);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					var nextLink = response.Links.Next;
					Console.WriteLine(nextLink);
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		public int Page { get; set; }
		public int PageSize { get; set; }
 		public int Total { get; set; }
 		public int TotalPages { get; set; }
 		public Response[] Items { get; set; }
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
		public Link Next { get; set; }
		public Link Prev { get; set; }
		public Link First { get; set; }
		public Link Last { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

List an organization's merchant listings with no match on filters

Request

GET /v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/merchantlistings?country=US&name=church&page=0&pageSize=25&status=Active&visibility=Hidden

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
organizationKey MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA path

The unique key of the organization - a case-sensitive series of characters

name church query

One or more terms between spaces which will each be matched partially against the name of the merchant

handle query

The unique text 'handle' assigned to the merchant

country US query

The country the Merchant resides within

visibility Hidden query

Only include merchant listings matching the specified visibility - Visible/Hidden

status Active query

Only include merchant listings matching the specified status - Active/Pending/Closed

page 0 query

The page parameter (Note: page numbering starts at 0)

pageSize 25 query

The page size parameter (Note: default page size is 25)

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/merchantlistings" } } }
<?php
/*
	Example 3
	List an organization's merchant listings with no match on filters
*/
$organizationKey = 'MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA';
$name = 'church';
$country = 'US';
$visibility = 'Hidden';
$status = 'Active';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/merchantlistings?name=$name&country=$country&visibility=$visibility&status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
	$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 3
 * List an organization's merchant listings with no match on filters
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
		String name = "church";
		String country = "US";
		String visibility = "Hidden";
		String status = "Active";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/merchantlistings?name=" + name + "&country=" + country + "&visibility=" + visibility + "&status=" + status + "&page=" + page + "&pageSize=" + pageSize;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		// Store the link to the next page in a variable
		URL nextLink = response._links.next.href;
		httpConnection.disconnect();
	}

	class Response {
		public int page { get; set; }
		public int pageSize { get; set; }
 		public int total { get; set; }
 		public int totalPages { get; set; }
 		public Response[] items { get; set; }
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
		public Link next;
		public Link prev;
		public Link first;
		public Link last;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 3
# List an organization's merchant listings with no match on filters
set oAuthToken=%1
set organizationKey="MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA"
set name="church"
set country="US"
set visibility="Hidden"
set status="Active"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/merchantlistings?name=%name%&country=%country%&visibility=%visibility%&status=%status%&page=%page%&pageSize=%pageSize%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example3
	{

		/// <summary>
		///	Example 3
		/// </summary>
		/// <remarks>
		///	List an organization's merchant listings with no match on filters
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA";
				var name = "church";
				var country = "US";
				var visibility = "Hidden";
				var status = "Active";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organization/{0}/merchantlistings?name={1}&country={2}&visibility={3}&status={4}&page={5}&pageSize={6}", organizationKey, 
					name, country, visibility, status, page, pageSize);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					var nextLink = response.Links.Next;
					Console.WriteLine(nextLink);
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		public int Page { get; set; }
		public int PageSize { get; set; }
 		public int Total { get; set; }
 		public int TotalPages { get; set; }
 		public Response[] Items { get; set; }
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
		public Link Next { get; set; }
		public Link Prev { get; set; }
		public Link First { get; set; }
		public Link Last { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

Search for Organizations

GET /v1/organizations

You can find organizations matching one or more parameters for:

  • name (Full or partial name of an organization)
  • status (if organizations are 'Active' or 'Closed')

Note: Unfiltered requests will return both Active and Closed organizations. Results are ordered by name ascending.

Query string (URL) parameters

Name Type Description
name string

One or more terms between spaces which will each be matched partially against the name of the merchant

status string

Only include organizations matching the specified status - Active/Closed

page integer

The page parameter (Note: page numbering starts at 0)

pageSize integer

The page size parameter (Note: default page size is 25)

Required Scopes

Scope Description
read Read-only access to resources owned by the subject claim of the token

Search all organizations

Request

GET /v1/organizations?page=0&pageSize=25

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
name query

One or more terms between spaces which will each be matched partially against the name of the merchant

status query

Only include organizations matching the specified status - Active/Closed

page 0 query

The page parameter (Note: page numbering starts at 0)

pageSize 25 query

The page size parameter (Note: default page size is 25)

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "page": 0, "pageSize": 25, "total": 2, "totalPages": 1, "items": [ { "key": "NDU2Olkwd0F6NmhDVXdkV1p2M0JxT1VFYURKS1lISQ", "v3OrganizationKey": "cc21b3c4e4303167ec70143c8ca1dd78", "name": "Gadgets LLC", "status": "Closed", "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/NDU2Olkwd0F6NmhDVXdkV1p2M0JxT1VFYURKS1lISQ" }, "funds": { "href": "https://api.pushpay.com/v1/organization/NDU2Olkwd0F6NmhDVXdkV1p2M0JxT1VFYURKS1lISQ/funds" }, "batches": { "href": "https://api.pushpay.com/v1/organization/NDU2Olkwd0F6NmhDVXdkV1p2M0JxT1VFYURKS1lISQ/batches" } } }, { "key": "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA", "v3OrganizationKey": "df21b3c4e4303167ec70143c8ca1dd78", "name": "Widgets Inc", "status": "Active", "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA" }, "funds": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/funds" }, "batches": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/batches" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organizations" } } }
<?php
/*
	Example 1
	Search all organizations
*/
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organizations?page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
	$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 1
 * Search all organizations
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organizations?page=" + page + "&pageSize=" + pageSize;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		// Store the link to the next page in a variable
		URL nextLink = response._links.next.href;
		httpConnection.disconnect();
	}

	class Response {
		public int page { get; set; }
		public int pageSize { get; set; }
 		public int total { get; set; }
 		public int totalPages { get; set; }
 		public Response[] items { get; set; }
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
		public Link next;
		public Link prev;
		public Link first;
		public Link last;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 1
# Search all organizations
set oAuthToken=%1
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organizations?page=%page%&pageSize=%pageSize%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example1
	{

		/// <summary>
		///	Example 1
		/// </summary>
		/// <remarks>
		///	Search all organizations
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organizations?page={0}&pageSize={1}", page, pageSize);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					var nextLink = response.Links.Next;
					Console.WriteLine(nextLink);
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		public int Page { get; set; }
		public int PageSize { get; set; }
 		public int Total { get; set; }
 		public int TotalPages { get; set; }
 		public Response[] Items { get; set; }
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
		public Link Next { get; set; }
		public Link Prev { get; set; }
		public Link First { get; set; }
		public Link Last { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

Search for active organizations matching a name

Request

GET /v1/organizations?name=widget&page=0&pageSize=25&status=Active

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
name widget query

One or more terms between spaces which will each be matched partially against the name of the merchant

status Active query

Only include organizations matching the specified status - Active/Closed

page 0 query

The page parameter (Note: page numbering starts at 0)

pageSize 25 query

The page size parameter (Note: default page size is 25)

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "key": "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA", "v3OrganizationKey": "df21b3c4e4303167ec70143c8ca1dd78", "name": "Widgets Inc", "status": "Active", "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA" }, "funds": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/funds" }, "batches": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/batches" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organizations?status=Active&name=widget" } } }
<?php
/*
	Example 2
	Search for active organizations matching a name
*/
$name = 'widget';
$status = 'Active';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organizations?name=$name&status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
	$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 2
 * Search for active organizations matching a name
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String name = "widget";
		String status = "Active";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organizations?name=" + name + "&status=" + status + "&page=" + page + "&pageSize=" + pageSize;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		// Store the link to the next page in a variable
		URL nextLink = response._links.next.href;
		httpConnection.disconnect();
	}

	class Response {
		public int page { get; set; }
		public int pageSize { get; set; }
 		public int total { get; set; }
 		public int totalPages { get; set; }
 		public Response[] items { get; set; }
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
		public Link next;
		public Link prev;
		public Link first;
		public Link last;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 2
# Search for active organizations matching a name
set oAuthToken=%1
set name="widget"
set status="Active"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organizations?name=%name%&status=%status%&page=%page%&pageSize=%pageSize%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example2
	{

		/// <summary>
		///	Example 2
		/// </summary>
		/// <remarks>
		///	Search for active organizations matching a name
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var name = "widget";
				var status = "Active";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organizations?name={0}&status={1}&page={2}&pageSize={3}", 
					name, status, page, pageSize);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					var nextLink = response.Links.Next;
					Console.WriteLine(nextLink);
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		public int Page { get; set; }
		public int PageSize { get; set; }
 		public int Total { get; set; }
 		public int TotalPages { get; set; }
 		public Response[] Items { get; set; }
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
		public Link Next { get; set; }
		public Link Prev { get; set; }
		public Link First { get; set; }
		public Link Last { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

List In-Scope Organizations

GET /v1/organizations/in-scope

You can find organizations the client's scope applies to - you can further filter this list by using one or more parameters for:

  • name (Full or partial name of an organization)
  • status (if organizations are 'Active' or 'Closed')

Note: Unfiltered requests will return both Active and Closed organizations. Results are ordered by name ascending.

Query string (URL) parameters

Name Type Description
name string

One or more terms between spaces which will each be matched partially against the name of the merchant

status string

Only include organizations matching the specified status - Active/Closed

page integer

The page parameter (Note: page numbering starts at 0)

pageSize integer

The page size parameter (Note: default page size is 25)

Required Scopes

Scope Description
read Read-only access to resources owned by the subject claim of the token

Get all in-scope organizations

Request

GET /v1/organizations/in-scope?page=0&pageSize=25

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
name query

One or more terms between spaces which will each be matched partially against the name of the merchant

status query

Only include organizations matching the specified status - Active/Closed

page 0 query

The page parameter (Note: page numbering starts at 0)

pageSize 25 query

The page size parameter (Note: default page size is 25)

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "page": 0, "pageSize": 25, "total": 2, "totalPages": 1, "items": [ { "key": "NDU2Olkwd0F6NmhDVXdkV1p2M0JxT1VFYURKS1lISQ", "v3OrganizationKey": "cc21b3c4e4303167ec70143c8ca1dd78", "name": "Gadgets LLC", "status": "Closed", "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/NDU2Olkwd0F6NmhDVXdkV1p2M0JxT1VFYURKS1lISQ" }, "funds": { "href": "https://api.pushpay.com/v1/organization/NDU2Olkwd0F6NmhDVXdkV1p2M0JxT1VFYURKS1lISQ/funds" }, "batches": { "href": "https://api.pushpay.com/v1/organization/NDU2Olkwd0F6NmhDVXdkV1p2M0JxT1VFYURKS1lISQ/batches" } } }, { "key": "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA", "v3OrganizationKey": "df21b3c4e4303167ec70143c8ca1dd78", "name": "Widgets Inc", "status": "Active", "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA" }, "funds": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/funds" }, "batches": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/batches" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organizations/in-scope" } } }
<?php
/*
	Example 1
	Get all in-scope organizations
*/
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organizations/in-scope?page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
	$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 1
 * Get all in-scope organizations
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organizations/in-scope?page=" + page + "&pageSize=" + pageSize;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		// Store the link to the next page in a variable
		URL nextLink = response._links.next.href;
		httpConnection.disconnect();
	}

	class Response {
		public int page { get; set; }
		public int pageSize { get; set; }
 		public int total { get; set; }
 		public int totalPages { get; set; }
 		public Response[] items { get; set; }
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
		public Link next;
		public Link prev;
		public Link first;
		public Link last;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 1
# Get all in-scope organizations
set oAuthToken=%1
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organizations/in-scope?page=%page%&pageSize=%pageSize%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example1
	{

		/// <summary>
		///	Example 1
		/// </summary>
		/// <remarks>
		///	Get all in-scope organizations
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organizations/in-scope?page={0}&pageSize={1}", page, pageSize);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					var nextLink = response.Links.Next;
					Console.WriteLine(nextLink);
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		public int Page { get; set; }
		public int PageSize { get; set; }
 		public int Total { get; set; }
 		public int TotalPages { get; set; }
 		public Response[] Items { get; set; }
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
		public Link Next { get; set; }
		public Link Prev { get; set; }
		public Link First { get; set; }
		public Link Last { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}

Get in-scope organizations matching name and status

Request

GET /v1/organizations/in-scope?name=widget&page=0&pageSize=25&status=Active

Headers

Name Value Description
Accept application/hal+json
Authorization Bearer XXXXXXXXX

The bearer token being used to authenticate this request

Parameters

Name Value Type Description
name widget query

One or more terms between spaces which will each be matched partially against the name of the merchant

status Active query

Only include organizations matching the specified status - Active/Closed

page 0 query

The page parameter (Note: page numbering starts at 0)

pageSize 25 query

The page size parameter (Note: default page size is 25)

Response

Status 200 (OK)

Headers

Name Value Description
Content-Type application/hal+json; charset=utf-8

Code Samples

Response

{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "key": "MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA", "v3OrganizationKey": "df21b3c4e4303167ec70143c8ca1dd78", "name": "Widgets Inc", "status": "Active", "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA" }, "funds": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/funds" }, "batches": { "href": "https://api.pushpay.com/v1/organization/MTIzOi1Yb1ByLWxtakFoMVdEaUlrWFpIdnhfODd0NA/batches" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organizations/in-scope?status=Active&name=widget" } } }
<?php
/*
	Example 2
	Get in-scope organizations matching name and status
*/
$name = 'widget';
$status = 'Active';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organizations/in-scope?name=$name&status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";

$curl = curl_init($url);
$curlHeaderData = [
	"Accept: application/hal+json",
	"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
    $message = "$httpCode Error";
    if ($jsonResponse['message']) {
        $message = "$message: " . $jsonResponse['message'];
    }
    throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
	$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;

/**
 * Example 2
 * Get in-scope organizations matching name and status
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String name = "widget";
		String status = "Active";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organizations/in-scope?name=" + name + "&status=" + status + "&page=" + page + "&pageSize=" + pageSize;

		HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
		if (httpConnection.getResponseCode() >= 400) {
			System.out.println(httpConnection.getResponseCode() +
				" Error: " + httpConnection.getResponseMessage());
		}
		InputStream inputStream = httpConnection.getInputStream();
		// Store the JSON response as a Java object
		Response response = getJsonResponse(inputStream);
		inputStream.close();
		// Store the link to the next page in a variable
		URL nextLink = response._links.next.href;
		httpConnection.disconnect();
	}

	class Response {
		public int page { get; set; }
		public int pageSize { get; set; }
 		public int total { get; set; }
 		public int totalPages { get; set; }
 		public Response[] items { get; set; }
		// The JSON properties you require should be added here as fields
		public _links _links = new _links();
	}

	class _links {
		public Link self;
		public Link next;
		public Link prev;
		public Link first;
		public Link last;
	}

	class Link {
		public URL href;
	}

	private static Response getJsonResponse(InputStream inputStream) throws IOException {
		BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
		String jsonString = "";
		while (streamReader.ready()) {
			jsonString += streamReader.readLine();
		}
		return (new Gson()).fromJson(jsonString, Response.class);
	}

	private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
		String oAuthToken="TOKEN";
		HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
		httpConnection.setRequestProperty("Accept", "application/hal+json");
		httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
		return httpConnection;
	}
}
# Example 2
# Get in-scope organizations matching name and status
set oAuthToken=%1
set name="widget"
set status="Active"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organizations/in-scope?name=%name%&status=%status%&page=%page%&pageSize=%pageSize%"

curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Examples
{
	public class Example2
	{

		/// <summary>
		///	Example 2
		/// </summary>
		/// <remarks>
		///	Get in-scope organizations matching name and status
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var name = "widget";
				var status = "Active";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organizations/in-scope?name={0}&status={1}&page={2}&pageSize={3}", 
					name, status, page, pageSize);

				client.BaseAddress = new Uri("https://api.pushpay.com");
				client.DefaultRequestHeaders.Accept.Clear();
				client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
				client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);

				var httpResponse = await client.GetAsync(requestUrl);
				if (httpResponse.IsSuccessStatusCode) {
					var content = await httpResponse.Content.ReadAsStringAsync();
					var response = JsonConvert.DeserializeObject<Response>(
						content, new JsonSerializerSettings {
							ContractResolver = new CamelCasePropertyNamesContractResolver()
					});
					var nextLink = response.Links.Next;
					Console.WriteLine(nextLink);
					return response;
				} else {
					var message = httpResponse.StatusCode + " Error";
					throw new Exception(message);
				}
			}
		}
	}

	public class Response
	{
		public int Page { get; set; }
		public int PageSize { get; set; }
 		public int Total { get; set; }
 		public int TotalPages { get; set; }
 		public Response[] Items { get; set; }
		[JsonProperty(PropertyName = "_links")]
		public Links Links { get; set; }
		// The JSON properties you require should be added here as properties
	}

	public class Links
	{
		public Link Self { get; set; }
		public Link Next { get; set; }
		public Link Prev { get; set; }
		public Link First { get; set; }
		public Link Last { get; set; }
	}

	public class Link {
		public Uri Href { get; set; }
	}
}