Settlements API

The API for viewing & querying settlement information


Get a Merchant's Settlements

GET /v1/merchant/{merchantKey}/settlements

Retrieves all settlements that belong to the in scope merchant & which pass the specified filters

Path (URL) Parameters

Name Type Description
merchantKey string

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

Query string (URL) parameters

Name Type Description
orderBy string

Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC'. Valid columns are 'name', 'depositDate', and 'transactions'

isReconciled boolean

Only include settlements which have or have not been reconciled by the user

name string

Only include settlements which contain the following substring, wildcharacters implicitly prepended and appended

type string

Only include settlements which are of the specified type (ACH, CreditCard, DepositedCheck or CashAndRecorded)

depositFrom string

Only include settlements which have been deposited after the specified date (UTC)

depositTo string

Only include settlements which have been deposited before the specified date (UTC)

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
merchant:view_payments View/search payments for in-scope merchants

Retrieve a set of all settlements for a merchant

Request

GET /v1/merchant/MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28/settlements?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
merchantKey MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28 path

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

orderBy query

Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC'. Valid columns are 'name', 'depositDate', and 'transactions'

isReconciled query

Only include settlements which have or have not been reconciled by the user

name query

Only include settlements which contain the following substring, wildcharacters implicitly prepended and appended

type query

Only include settlements which are of the specified type (ACH, CreditCard, DepositedCheck or CashAndRecorded)

depositFrom query

Only include settlements which have been deposited after the specified date (UTC)

depositTo query

Only include settlements which have been deposited before the specified date (UTC)

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": 15, "totalPages": 1, "items": [ { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "totalAmount": { "amount": "0.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 0, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "key": "MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0", "name": "Settlement #1", "totalAmount": { "amount": "10.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 2, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" } } }, { "key": "MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc", "name": "Settlement #2", "totalAmount": { "amount": "20.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 4, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc" } } }, { "key": "MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA", "name": "Settlement #3", "totalAmount": { "amount": "30.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 6, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA" } } }, { "key": "NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M", "name": "Settlement #4", "totalAmount": { "amount": "40.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 8, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M" } } }, { "key": "NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg", "name": "Settlement #5", "totalAmount": { "amount": "50.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 10, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg" } } }, { "key": "NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk", "name": "Settlement #6", "totalAmount": { "amount": "60.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 12, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk" } } }, { "key": "NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0", "name": "Settlement #7", "totalAmount": { "amount": "70.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 14, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0" } } }, { "key": "ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM", "name": "Settlement #8", "totalAmount": { "amount": "80.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 16, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM" } } }, { "key": "OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ", "name": "Settlement #9", "totalAmount": { "amount": "90.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 18, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ" } } }, { "key": "MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13", "name": "Settlement #10", "totalAmount": { "amount": "100.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 20, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13" } } }, { "key": "MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ", "name": "Settlement #11", "totalAmount": { "amount": "110.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 22, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ" } } }, { "key": "MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn", "name": "Settlement #12", "totalAmount": { "amount": "120.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 24, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn" } } }, { "key": "MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V", "name": "Settlement #13", "totalAmount": { "amount": "130.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 26, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V" } } }, { "key": "MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3", "name": "Settlement #14", "totalAmount": { "amount": "140.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 28, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28/settlements" } } }
<?php
/*
	Example 1
	Retrieve a set of all settlements for a merchant
*/
$merchantKey = 'MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/settlements?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
 * Retrieve a set of all settlements for a merchant
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String merchantKey = "MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/settlements?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
# Retrieve a set of all settlements for a merchant
set oAuthToken=%1
set merchantKey="MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/settlements?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>
		///	Retrieve a set of all settlements for a merchant
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var merchantKey = "MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/merchant/{0}/settlements?page={1}&pageSize={2}", merchantKey, 
					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; }
	}
}

Retrieve a set of all settlements which match the specified filters and belong to the specified merchant

Request

GET /v1/merchant/MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28/settlements?isReconciled=True&name=settlementName&orderBy=transactions ASC&page=0&pageSize=25&type=ACH

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
merchantKey MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28 path

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

orderBy transactions ASC query

Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC'. Valid columns are 'name', 'depositDate', and 'transactions'

isReconciled True query

Only include settlements which have or have not been reconciled by the user

name settlementName query

Only include settlements which contain the following substring, wildcharacters implicitly prepended and appended

type ACH query

Only include settlements which are of the specified type (ACH, CreditCard, DepositedCheck or CashAndRecorded)

depositFrom query

Only include settlements which have been deposited after the specified date (UTC)

depositTo query

Only include settlements which have been deposited before the specified date (UTC)

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": 15, "totalPages": 1, "items": [ { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "settlementName", "totalAmount": { "amount": "0.00", "currency": "USD" }, "type": "ACH", "totalPayments": 0, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "key": "MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0", "name": "settlementName", "totalAmount": { "amount": "10.00", "currency": "USD" }, "type": "ACH", "totalPayments": 2, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" } } }, { "key": "MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc", "name": "settlementName", "totalAmount": { "amount": "20.00", "currency": "USD" }, "type": "ACH", "totalPayments": 4, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc" } } }, { "key": "MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA", "name": "settlementName", "totalAmount": { "amount": "30.00", "currency": "USD" }, "type": "ACH", "totalPayments": 6, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA" } } }, { "key": "NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M", "name": "settlementName", "totalAmount": { "amount": "40.00", "currency": "USD" }, "type": "ACH", "totalPayments": 8, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M" } } }, { "key": "NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg", "name": "settlementName", "totalAmount": { "amount": "50.00", "currency": "USD" }, "type": "ACH", "totalPayments": 10, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg" } } }, { "key": "NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk", "name": "settlementName", "totalAmount": { "amount": "60.00", "currency": "USD" }, "type": "ACH", "totalPayments": 12, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk" } } }, { "key": "NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0", "name": "settlementName", "totalAmount": { "amount": "70.00", "currency": "USD" }, "type": "ACH", "totalPayments": 14, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0" } } }, { "key": "ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM", "name": "settlementName", "totalAmount": { "amount": "80.00", "currency": "USD" }, "type": "ACH", "totalPayments": 16, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM" } } }, { "key": "OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ", "name": "settlementName", "totalAmount": { "amount": "90.00", "currency": "USD" }, "type": "ACH", "totalPayments": 18, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ" } } }, { "key": "MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13", "name": "settlementName", "totalAmount": { "amount": "100.00", "currency": "USD" }, "type": "ACH", "totalPayments": 20, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13" } } }, { "key": "MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ", "name": "settlementName", "totalAmount": { "amount": "110.00", "currency": "USD" }, "type": "ACH", "totalPayments": 22, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ" } } }, { "key": "MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn", "name": "settlementName", "totalAmount": { "amount": "120.00", "currency": "USD" }, "type": "ACH", "totalPayments": 24, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn" } } }, { "key": "MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V", "name": "settlementName", "totalAmount": { "amount": "130.00", "currency": "USD" }, "type": "ACH", "totalPayments": 26, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V" } } }, { "key": "MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3", "name": "settlementName", "totalAmount": { "amount": "140.00", "currency": "USD" }, "type": "ACH", "totalPayments": 28, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28/settlements" } } }
<?php
/*
	Example 2
	Retrieve a set of all settlements which match the specified filters and belong to the specified merchant
*/
$merchantKey = 'MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28';
$orderBy = 'transactions ASC';
$isReconciled = $name = 'settlementName';
$type = 'ACH';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/settlements?orderBy=$orderBy&isReconciled=$isReconciled&name=$name&type=$type&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
 * Retrieve a set of all settlements which match the specified filters and belong to the specified merchant
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String merchantKey = "MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28";
		String orderBy = "transactions ASC";
		String name = "settlementName";
		String type = "ACH";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/settlements?orderBy=" + orderBy + "&isReconciled=" + isReconciled + "&name=" + name + "&type=" + type + "&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
# Retrieve a set of all settlements which match the specified filters and belong to the specified merchant
set oAuthToken=%1
set merchantKey="MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28"
set orderBy="transactions ASC"
set isReconciled=True
set name="settlementName"
set type="ACH"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/settlements?orderBy=%orderBy%&isReconciled=%isReconciled%&name=%name%&type=%type%&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>
		///	Retrieve a set of all settlements which match the specified filters and belong to the specified merchant
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var merchantKey = "MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28";
				var orderBy = "transactions ASC";
				var isReconciled = "True";
				var name = "settlementName";
				var type = "ACH";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/merchant/{0}/settlements?orderBy={1}&isReconciled={2}&name={3}&type={4}&page={5}&pageSize={6}", merchantKey, 
					orderBy, isReconciled, name, type, 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; }
	}
}

Attempting to retrieve settlements with an invalid order by column will fail

Request

GET /v1/merchant/MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28/settlements?orderBy=settlementDate DESC&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
merchantKey MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28 path

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

orderBy settlementDate DESC query

Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC'. Valid columns are 'name', 'depositDate', and 'transactions'

isReconciled query

Only include settlements which have or have not been reconciled by the user

name query

Only include settlements which contain the following substring, wildcharacters implicitly prepended and appended

type query

Only include settlements which are of the specified type (ACH, CreditCard, DepositedCheck or CashAndRecorded)

depositFrom query

Only include settlements which have been deposited after the specified date (UTC)

depositTo query

Only include settlements which have been deposited before the specified date (UTC)

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

{ "message": "could not parse orderBy clause, the correct format is 'propertyName (ASC|DESC)'" }
<?php
/*
	Example 3
	Attempting to retrieve settlements with an invalid order by column will fail
*/
$merchantKey = 'MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28';
$orderBy = 'settlementDate DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/settlements?orderBy=$orderBy&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
 * Attempting to retrieve settlements with an invalid order by column will fail
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String merchantKey = "MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28";
		String orderBy = "settlementDate DESC";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/settlements?orderBy=" + orderBy + "&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
# Attempting to retrieve settlements with an invalid order by column will fail
set oAuthToken=%1
set merchantKey="MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28"
set orderBy="settlementDate DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/settlements?orderBy=%orderBy%&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>
		///	Attempting to retrieve settlements with an invalid order by column will fail
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var merchantKey = "MTIzNDphSXNSSE1DWDhMTUh4dkpDQmllcUpIR2FpX28";
				var orderBy = "settlementDate DESC";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/merchant/{0}/settlements?orderBy={1}&page={2}&pageSize={3}", merchantKey, 
					orderBy, 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 an Organization's Settlements

GET /v1/organization/{organizationKey}/settlements

Retrieves all settlements that belong to an organization & which pass the specified filters

Path (URL) Parameters

Name Type Description
organizationKey string

Query string (URL) parameters

Name Type Description
orderBy string

Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC'. Valid columns are 'name', 'depositDate', and 'transactions'

isReconciled boolean

Only include settlements which have or have not been reconciled by the user

name string

Only include settlements which contain the following substring, wildcharacters implicitly prepended and appended

type string

Only include settlements which are of the specified type (ACH, CreditCard, DepositedCheck or CashAndRecorded)

depositFrom string

Only include settlements which have been deposited after the specified date (UTC)

depositTo string

Only include settlements which have been deposited before the specified date (UTC)

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
merchant:view_payments View/search payments for in-scope merchants

Retrieve a set of all settlements for organization

Request

GET /v1/organization/MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k/settlements?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 MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k path
orderBy query

Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC'. Valid columns are 'name', 'depositDate', and 'transactions'

isReconciled query

Only include settlements which have or have not been reconciled by the user

name query

Only include settlements which contain the following substring, wildcharacters implicitly prepended and appended

type query

Only include settlements which are of the specified type (ACH, CreditCard, DepositedCheck or CashAndRecorded)

depositFrom query

Only include settlements which have been deposited after the specified date (UTC)

depositTo query

Only include settlements which have been deposited before the specified date (UTC)

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": 15, "totalPages": 1, "items": [ { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "totalAmount": { "amount": "0.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 0, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "key": "MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0", "name": "Settlement #1", "totalAmount": { "amount": "10.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 2, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" } } }, { "key": "MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc", "name": "Settlement #2", "totalAmount": { "amount": "20.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 4, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc" } } }, { "key": "MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA", "name": "Settlement #3", "totalAmount": { "amount": "30.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 6, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA" } } }, { "key": "NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M", "name": "Settlement #4", "totalAmount": { "amount": "40.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 8, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M" } } }, { "key": "NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg", "name": "Settlement #5", "totalAmount": { "amount": "50.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 10, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg" } } }, { "key": "NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk", "name": "Settlement #6", "totalAmount": { "amount": "60.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 12, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk" } } }, { "key": "NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0", "name": "Settlement #7", "totalAmount": { "amount": "70.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 14, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0" } } }, { "key": "ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM", "name": "Settlement #8", "totalAmount": { "amount": "80.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 16, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM" } } }, { "key": "OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ", "name": "Settlement #9", "totalAmount": { "amount": "90.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 18, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ" } } }, { "key": "MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13", "name": "Settlement #10", "totalAmount": { "amount": "100.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 20, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13" } } }, { "key": "MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ", "name": "Settlement #11", "totalAmount": { "amount": "110.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 22, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ" } } }, { "key": "MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn", "name": "Settlement #12", "totalAmount": { "amount": "120.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 24, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn" } } }, { "key": "MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V", "name": "Settlement #13", "totalAmount": { "amount": "130.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 26, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V" } } }, { "key": "MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3", "name": "Settlement #14", "totalAmount": { "amount": "140.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 28, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization//settlements" } } }
<?php
/*
	Example 1
	Retrieve a set of all settlements for organization
*/
$organizationKey = 'MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/settlements?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
 * Retrieve a set of all settlements for organization
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/settlements?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
# Retrieve a set of all settlements for organization
set oAuthToken=%1
set organizationKey="MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/settlements?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>
		///	Retrieve a set of all settlements for organization
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organization/{0}/settlements?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; }
	}
}

Retrieve a set of all settlements which match the specified filters and belong to organization

Request

GET /v1/organization/MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k/settlements?isReconciled=True&name=settlementName&orderBy=transactions ASC&page=0&pageSize=25&type=ACH

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 MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k path
orderBy transactions ASC query

Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC'. Valid columns are 'name', 'depositDate', and 'transactions'

isReconciled True query

Only include settlements which have or have not been reconciled by the user

name settlementName query

Only include settlements which contain the following substring, wildcharacters implicitly prepended and appended

type ACH query

Only include settlements which are of the specified type (ACH, CreditCard, DepositedCheck or CashAndRecorded)

depositFrom query

Only include settlements which have been deposited after the specified date (UTC)

depositTo query

Only include settlements which have been deposited before the specified date (UTC)

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": 15, "totalPages": 1, "items": [ { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "settlementName", "totalAmount": { "amount": "0.00", "currency": "USD" }, "type": "ACH", "totalPayments": 0, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "key": "MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0", "name": "settlementName", "totalAmount": { "amount": "10.00", "currency": "USD" }, "type": "ACH", "totalPayments": 2, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" } } }, { "key": "MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc", "name": "settlementName", "totalAmount": { "amount": "20.00", "currency": "USD" }, "type": "ACH", "totalPayments": 4, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MjAwMDotSlJ1bTJLTGludHlURjI2TEZJZjk0R050VWc" } } }, { "key": "MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA", "name": "settlementName", "totalAmount": { "amount": "30.00", "currency": "USD" }, "type": "ACH", "totalPayments": 6, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MzAwMDo1RWNiNGhzSjFtTmt0c0lLenNDd2FrbXlYWTA" } } }, { "key": "NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M", "name": "settlementName", "totalAmount": { "amount": "40.00", "currency": "USD" }, "type": "ACH", "totalPayments": 8, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NDAwMDpvTGZOaXN6QWhHbDZ3X0dTRDJyMWhaVWVWc3M" } } }, { "key": "NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg", "name": "settlementName", "totalAmount": { "amount": "50.00", "currency": "USD" }, "type": "ACH", "totalPayments": 10, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NTAwMDpxaGloQVFZV3JDLVBKXzNBdm5pOWltWm9wbjg" } } }, { "key": "NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk", "name": "settlementName", "totalAmount": { "amount": "60.00", "currency": "USD" }, "type": "ACH", "totalPayments": 12, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NjAwMDo5UFJWMlplVWkzY2hURDZBUVpIeEl4NjlWWVk" } } }, { "key": "NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0", "name": "settlementName", "totalAmount": { "amount": "70.00", "currency": "USD" }, "type": "ACH", "totalPayments": 14, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/NzAwMDpUdGVNblQ5R25PTmtZSXRkUk15QWhnbzAzNE0" } } }, { "key": "ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM", "name": "settlementName", "totalAmount": { "amount": "80.00", "currency": "USD" }, "type": "ACH", "totalPayments": 16, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/ODAwMDpEelBMZEtvS19QRl9hWk01by1FQXd1SXFXOXM" } } }, { "key": "OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ", "name": "settlementName", "totalAmount": { "amount": "90.00", "currency": "USD" }, "type": "ACH", "totalPayments": 18, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/OTAwMDo3cHpfX1hTMW5URkF5eXZUWlFPaGxhS0NGMzQ" } } }, { "key": "MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13", "name": "settlementName", "totalAmount": { "amount": "100.00", "currency": "USD" }, "type": "ACH", "totalPayments": 20, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDA6cDV6dloyZ29GMTBtZ3A5dEE4SmFfbjMzRm13" } } }, { "key": "MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ", "name": "settlementName", "totalAmount": { "amount": "110.00", "currency": "USD" }, "type": "ACH", "totalPayments": 22, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTEwMDA6cVozOFJfZ09iMmlvc0pRRWtOaGoxb3hMNjlZ" } } }, { "key": "MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn", "name": "settlementName", "totalAmount": { "amount": "120.00", "currency": "USD" }, "type": "ACH", "totalPayments": 24, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTIwMDA6ZkVaazN2Z2VRSXpnZkM4RU1haU9fSG1sY2tn" } } }, { "key": "MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V", "name": "settlementName", "totalAmount": { "amount": "130.00", "currency": "USD" }, "type": "ACH", "totalPayments": 26, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": false, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTMwMDA6aG9mUHo5OVc4Yk5VYnFiVzdjd2pWSUQtck5V" } } }, { "key": "MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3", "name": "settlementName", "totalAmount": { "amount": "140.00", "currency": "USD" }, "type": "ACH", "totalPayments": 28, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTQwMDA6TlkzbUVqMkwwaXpOaU85U2paYnJMTFBoV1V3" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization//settlements" } } }
<?php
/*
	Example 2
	Retrieve a set of all settlements which match the specified filters and belong to organization
*/
$organizationKey = 'MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k';
$orderBy = 'transactions ASC';
$isReconciled = $name = 'settlementName';
$type = 'ACH';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/settlements?orderBy=$orderBy&isReconciled=$isReconciled&name=$name&type=$type&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
 * Retrieve a set of all settlements which match the specified filters and belong to organization
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k";
		String orderBy = "transactions ASC";
		String name = "settlementName";
		String type = "ACH";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/settlements?orderBy=" + orderBy + "&isReconciled=" + isReconciled + "&name=" + name + "&type=" + type + "&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
# Retrieve a set of all settlements which match the specified filters and belong to organization
set oAuthToken=%1
set organizationKey="MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k"
set orderBy="transactions ASC"
set isReconciled=True
set name="settlementName"
set type="ACH"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/settlements?orderBy=%orderBy%&isReconciled=%isReconciled%&name=%name%&type=%type%&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>
		///	Retrieve a set of all settlements which match the specified filters and belong to organization
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k";
				var orderBy = "transactions ASC";
				var isReconciled = "True";
				var name = "settlementName";
				var type = "ACH";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organization/{0}/settlements?orderBy={1}&isReconciled={2}&name={3}&type={4}&page={5}&pageSize={6}", organizationKey, 
					orderBy, isReconciled, name, type, 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; }
	}
}

Attempting to retrieve settlements with an invalid order by column will fail

Request

GET /v1/organization/MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k/settlements?orderBy=settlementDate DESC&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 MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k path
orderBy settlementDate DESC query

Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC'. Valid columns are 'name', 'depositDate', and 'transactions'

isReconciled query

Only include settlements which have or have not been reconciled by the user

name query

Only include settlements which contain the following substring, wildcharacters implicitly prepended and appended

type query

Only include settlements which are of the specified type (ACH, CreditCard, DepositedCheck or CashAndRecorded)

depositFrom query

Only include settlements which have been deposited after the specified date (UTC)

depositTo query

Only include settlements which have been deposited before the specified date (UTC)

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

{ "message": "could not parse orderBy clause, the correct format is 'propertyName (ASC|DESC)'" }
<?php
/*
	Example 3
	Attempting to retrieve settlements with an invalid order by column will fail
*/
$organizationKey = 'MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k';
$orderBy = 'settlementDate DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/settlements?orderBy=$orderBy&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
 * Attempting to retrieve settlements with an invalid order by column will fail
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String organizationKey = "MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k";
		String orderBy = "settlementDate DESC";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/settlements?orderBy=" + orderBy + "&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
# Attempting to retrieve settlements with an invalid order by column will fail
set oAuthToken=%1
set organizationKey="MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k"
set orderBy="settlementDate DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/settlements?orderBy=%orderBy%&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>
		///	Attempting to retrieve settlements with an invalid order by column will fail
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var organizationKey = "MTIzNDo0WmwxbFo2NjV2SXpBS1VSOTFlTmhtSDlYY1k";
				var orderBy = "settlementDate DESC";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/organization/{0}/settlements?orderBy={1}&page={2}&pageSize={3}", organizationKey, 
					orderBy, 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 a Specific Settlement

GET /v1/settlement/{settlementKey}

Retrieve a single in scope settlement by its key

Path (URL) Parameters

Name Type Description
settlementKey string

Required Scopes

Scope Description
merchant:view_payments View/search payments for in-scope merchants

Retrieve a single settlement by its key

Request

GET /v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg

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
settlementKey MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg path

Response

Status 200 (OK)

Headers

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

Code Samples

Response

{ "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "totalAmount": { "amount": "0.00", "currency": "USD" }, "type": "CreditCard", "totalPayments": 0, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }
<?php
/*
	Example 1
	Retrieve a single settlement by its key
*/
$settlementKey = 'MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg';
$url = "https://api.pushpay.com/v1/settlement/$settlementKey";
$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 a single settlement by its key
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

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

		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 a single settlement by its key
set oAuthToken=%1
set settlementKey="MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg"
set url="https://api.pushpay.com/v1/settlement/%settlementKey%"

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 a single settlement by its key
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var settlementKey = "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg";
				var requestUrl = string.Format("/v1/settlement/{0}", settlementKey);

				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 a deposited check settlement by its key

Request

GET /v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0

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
settlementKey MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0 path

Response

Status 200 (OK)

Headers

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

Code Samples

Response

{ "key": "MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0", "name": "Settlement #1000", "totalAmount": { "amount": "1250.00", "currency": "USD" }, "type": "DepositedCheck", "totalPayments": 2, "estimatedDepositDate": "2015-01-03T07:00:00Z", "isReconciled": true, "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" }, "settlementpayments": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0/payments" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" } } }
<?php
/*
	Example 2
	Retrieve a deposited check settlement by its key
*/
$settlementKey = 'MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0';
$url = "https://api.pushpay.com/v1/settlement/$settlementKey";
$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 a deposited check settlement by its key
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

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

		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 a deposited check settlement by its key
set oAuthToken=%1
set settlementKey="MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0"
set url="https://api.pushpay.com/v1/settlement/%settlementKey%"

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 a deposited check settlement by its key
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var settlementKey = "MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0";
				var requestUrl = string.Format("/v1/settlement/{0}", settlementKey);

				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 a Specific Settlement's Payments

GET /v1/settlement/{settlementKey}/payments

Retrieve the set of in scope payments related to the specified settlement

Path (URL) Parameters

Name Type Description
settlementKey string

Query string (URL) parameters

Name Type Description
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
merchant:view_payments View/search payments for in-scope merchants

Retrieve the payments associated with a settlement, only the page parameter is supported

Request

GET /v1/settlement/MTI0MzpWMXVLQmV4VzVqa1FKY3ZiOVJVOFBRUGUtQU0/payments?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
settlementKey MTI0MzpWMXVLQmV4VzVqa1FKY3ZiOVJVOFBRUGUtQU0 path
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": 10, "totalPages": 1, "items": [ { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "69", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "0.00", "currency": "USD", "details": { "base": "0.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "70", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "71", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "20.00", "currency": "USD", "details": { "base": "20.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "72", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "30.00", "currency": "USD", "details": { "base": "30.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "73", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "40.00", "currency": "USD", "details": { "base": "40.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "74", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "75", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "60.00", "currency": "USD", "details": { "base": "60.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "76", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "70.00", "currency": "USD", "details": { "base": "70.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "77", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "80.00", "currency": "USD", "details": { "base": "80.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } }, { "status": "Success", "settlement": { "key": "MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg", "name": "Settlement #0", "estimatedDepositDate": "2015-01-03T07:00:00Z" }, "transactionId": "78", "paymentToken": "78pRR7S74ke84A5pQdDizQ", "amount": { "amount": "90.00", "currency": "USD", "details": { "base": "90.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddress": "joe@bloggs.com", "emailAddressVerified": false, "mobileNumber": "+12025551234", "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ", "name": "Your Organization", "role": "merchant" }, "fields": [ { "key": "0", "value": "My Memo", "label": "Memo Field" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "ACH", "source": "LoggedInWeb", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Your Organization", "key": "MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payment/78pRR7S74ke84A5pQdDizQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTI0OldXMm5OZGhoYnBLb3dxLTIyVFpXbndTS0tWVQ/transaction/78pRR7S74ke84A5pQdDizQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/78pRR7S74ke84A5pQdDizQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/OTk5OnMwZldENm00b0RZMGxQaTlabVZSckVkQllMZw/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/settlement/MDpkQUFOQ1FzdE1BLVZfVWZFdEZkQ3dvb3YyTDg/payments" } } }
<?php
/*
	Example 1
	Retrieve the payments associated with a settlement, only the page parameter is supported
*/
$settlementKey = 'MTI0MzpWMXVLQmV4VzVqa1FKY3ZiOVJVOFBRUGUtQU0';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/settlement/$settlementKey/payments?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
 * Retrieve the payments associated with a settlement, only the page parameter is supported
 *
 * This example uses the Gson library to parse JSON
 */

public class Example {

	public static void main(String[] args) throws IOException {
		String settlementKey = "MTI0MzpWMXVLQmV4VzVqa1FKY3ZiOVJVOFBRUGUtQU0";
		int page = 0;
		int pageSize = 25;
		String urlString = "https://api.pushpay.com/v1/settlement/" + settlementKey + "/payments?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
# Retrieve the payments associated with a settlement, only the page parameter is supported
set oAuthToken=%1
set settlementKey="MTI0MzpWMXVLQmV4VzVqa1FKY3ZiOVJVOFBRUGUtQU0"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/settlement/%settlementKey%/payments?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>
		///	Retrieve the payments associated with a settlement, only the page parameter is supported
		/// </remarks>
		public async Task<Response> Example(string oAuthToken)
		{
			using (var client = new HttpClient()) {
				var settlementKey = "MTI0MzpWMXVLQmV4VzVqa1FKY3ZiOVJVOFBRUGUtQU0";
				var page = 0;
				var pageSize = 25;
				var requestUrl = string.Format("/v1/settlement/{0}/payments?page={1}&pageSize={2}", settlementKey, 
					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; }
	}
}