The API for managing payments in the Pushpay platform
Name | Type | Description |
---|---|---|
merchantKey | string | The unique key of the merchant - a case-sensitive series of characters |
token | string | The token is a unique identifier for this resource - a case-sensitive series of characters |
Scope | Description |
---|---|
merchant:view_payments | View/search payments for in-scope merchants |
read | Read-only access to resources owned by the subject claim of the token |
Get a single payment made to a merchant
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | HgHeIQ-Ui0yJPHtavtS2uQ | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }
<?php
/*
Example 1
Get a single payment made to a merchant
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'HgHeIQ-Ui0yJPHtavtS2uQ';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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
* Get a single payment made to a merchant
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "HgHeIQ-Ui0yJPHtavtS2uQ";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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
# Get a single payment made to a merchant
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="HgHeIQ-Ui0yJPHtavtS2uQ"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example1
{
/// <summary>
/// Example 1
/// </summary>
/// <remarks>
/// Get a single payment made to a merchant
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "HgHeIQ-Ui0yJPHtavtS2uQ";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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 single payment made to a merchant, which has additional custom data stored against it (which was included in the POST request when the payment was made)
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | HgHeIQ-Ui0yJPHtavtS2uQ | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "VirtualTerminal", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "data": { "tx_id": "123123", "funds": [ "bits", "bobs" ] }, "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }
<?php
/*
Example 2
Get a single payment made to a merchant, which has additional custom data stored against it (which was included in the POST request when the payment was made)
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'HgHeIQ-Ui0yJPHtavtS2uQ';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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
* Get a single payment made to a merchant, which has additional custom data stored against it (which was included in the POST request when the payment was made)
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "HgHeIQ-Ui0yJPHtavtS2uQ";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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
# Get a single payment made to a merchant, which has additional custom data stored against it (which was included in the POST request when the payment was made)
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="HgHeIQ-Ui0yJPHtavtS2uQ"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example2
{
/// <summary>
/// Example 2
/// </summary>
/// <remarks>
/// Get a single payment made to a merchant, which has additional custom data stored against it (which was included in the POST request when the payment was made)
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "HgHeIQ-Ui0yJPHtavtS2uQ";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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 single payment made to a merchant where payer covered transaction fee
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | HgHeIQ-Ui0yJPHtavtS2uQ | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "47.00", "fee": "3.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }
<?php
/*
Example 3
Get a single payment made to a merchant where payer covered transaction fee
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'HgHeIQ-Ui0yJPHtavtS2uQ';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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 3
* Get a single payment made to a merchant where payer covered transaction fee
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "HgHeIQ-Ui0yJPHtavtS2uQ";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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 3
# Get a single payment made to a merchant where payer covered transaction fee
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="HgHeIQ-Ui0yJPHtavtS2uQ"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
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>
/// Get a single payment made to a merchant where payer covered transaction fee
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "HgHeIQ-Ui0yJPHtavtS2uQ";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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 single payment made to a merchant, which was made by cash at the virtual terminal
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | HgHeIQ-Ui0yJPHtavtS2uQ | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg", "emailAddressVerified": false, "mobileNumberVerified": false, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "role": "individual", "payerType": "Guest", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MDoxWWpVN2dpTjNzeDdfMTdCcXk1bnZjOUJ5Qzg" } } }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "Cash", "source": "VirtualTerminal", "ipAddress": "69.30.43.180", "givenOn": "2016-08-02", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }
<?php
/*
Example 4
Get a single payment made to a merchant, which was made by cash at the virtual terminal
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'HgHeIQ-Ui0yJPHtavtS2uQ';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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 4
* Get a single payment made to a merchant, which was made by cash at the virtual terminal
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "HgHeIQ-Ui0yJPHtavtS2uQ";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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 4
# Get a single payment made to a merchant, which was made by cash at the virtual terminal
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="HgHeIQ-Ui0yJPHtavtS2uQ"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
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 Example4
{
/// <summary>
/// Example 4
/// </summary>
/// <remarks>
/// Get a single payment made to a merchant, which was made by cash at the virtual terminal
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "HgHeIQ-Ui0yJPHtavtS2uQ";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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 refunded payment made to a merchant
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | HgHeIQ-Ui0yJPHtavtS2uQ | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Success", "transactionId": "69", "refundedBy": { "transactionId": "70", "paymentToken": "xgJHFPJUQUOlucVDjsJ5Ow" }, "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "refundedBy": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/xgJHFPJUQUOlucVDjsJ5Ow" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }
<?php
/*
Example 5
Get a refunded payment made to a merchant
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'HgHeIQ-Ui0yJPHtavtS2uQ';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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 5
* Get a refunded payment made to a merchant
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "HgHeIQ-Ui0yJPHtavtS2uQ";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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 5
# Get a refunded payment made to a merchant
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="HgHeIQ-Ui0yJPHtavtS2uQ"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
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 Example5
{
/// <summary>
/// Example 5
/// </summary>
/// <remarks>
/// Get a refunded payment made to a merchant
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "HgHeIQ-Ui0yJPHtavtS2uQ";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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 refund payment made to a merchant
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | xgJHFPJUQUOlucVDjsJ5Ow | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Success", "transactionId": "70", "refundFor": { "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ" }, "paymentToken": "xgJHFPJUQUOlucVDjsJ5Ow", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/xgJHFPJUQUOlucVDjsJ5Ow" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "refundFor": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/xgJHFPJUQUOlucVDjsJ5Ow" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/xgJHFPJUQUOlucVDjsJ5Ow" } } }
<?php
/*
Example 6
Get a refund payment made to a merchant
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'xgJHFPJUQUOlucVDjsJ5Ow';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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 6
* Get a refund payment made to a merchant
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "xgJHFPJUQUOlucVDjsJ5Ow";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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 6
# Get a refund payment made to a merchant
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="xgJHFPJUQUOlucVDjsJ5Ow"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
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 Example6
{
/// <summary>
/// Example 6
/// </summary>
/// <remarks>
/// Get a refund payment made to a merchant
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "xgJHFPJUQUOlucVDjsJ5Ow";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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 details of a failed payment (Bank Declined)
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | HgHeIQ-Ui0yJPHtavtS2uQ | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Failed", "transactionId": "69", "error": { "message": "Sorry, your card was declined. Please contact your bank.", "resultCode": { "code": 11, "key": "BankDeclined", "description": "Declined" } }, "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }
<?php
/*
Example 7
Get details of a failed payment (Bank Declined)
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'HgHeIQ-Ui0yJPHtavtS2uQ';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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 7
* Get details of a failed payment (Bank Declined)
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "HgHeIQ-Ui0yJPHtavtS2uQ";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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 7
# Get details of a failed payment (Bank Declined)
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="HgHeIQ-Ui0yJPHtavtS2uQ"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
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 Example7
{
/// <summary>
/// Example 7
/// </summary>
/// <remarks>
/// Get details of a failed payment (Bank Declined)
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "HgHeIQ-Ui0yJPHtavtS2uQ";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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 single payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_payments scope
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | xgJHFPJUQUOlucVDjsJ5Ow | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Success", "transactionId": "70", "refundFor": { "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ" }, "paymentToken": "xgJHFPJUQUOlucVDjsJ5Ow", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "externalLinks": [ { "application": { "name": "ChurchCommunityBuilder", "type": "ChurchManagementSystem" }, "relationship": "fund_id", "value": "5675" } ], "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/xgJHFPJUQUOlucVDjsJ5Ow" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "refundFor": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/xgJHFPJUQUOlucVDjsJ5Ow" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/xgJHFPJUQUOlucVDjsJ5Ow" } } }
<?php
/*
Example 8
Get a single payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_payments scope
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'xgJHFPJUQUOlucVDjsJ5Ow';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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 8
* Get a single payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_payments scope
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "xgJHFPJUQUOlucVDjsJ5Ow";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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 8
# Get a single payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_payments scope
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="xgJHFPJUQUOlucVDjsJ5Ow"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
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 Example8
{
/// <summary>
/// Example 8
/// </summary>
/// <remarks>
/// Get a single payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_payments scope
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "xgJHFPJUQUOlucVDjsJ5Ow";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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 single non cash payment
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
token | xgJHFPJUQUOlucVDjsJ5Ow | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "status": "Success", "assetType": "Property", "descriptionForDonor": "Mothers's house", "descriptionForMerchant": "2 storey, semi detached building", "paymentToken": "iJxO8DJp6k__95TAVadGwg", "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "Charity mission" }, { "key": "2", "value": "7863", "label": "Southern Campus" } ], "createdOn": "2019-04-30T18:21:00Z", "updatedOn": "2019-04-30T18:28:00Z", "paymentMethodType": "NonCash", "source": "VirtualTerminal", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes", "code": "101", "taxDeductible": true }, "campus": { "name": "Southern Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/iJxO8DJp6k__95TAVadGwg" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/iJxO8DJp6k__95TAVadGwg" } } }
<?php
/*
Example 9
Get a single non cash payment
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$token = 'xgJHFPJUQUOlucVDjsJ5Ow';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payment/$token";
$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 9
* Get a single non cash payment
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String token = "xgJHFPJUQUOlucVDjsJ5Ow";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payment/" + token;
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 9
# Get a single non cash payment
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set token="xgJHFPJUQUOlucVDjsJ5Ow"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payment/%token%"
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 Example9
{
/// <summary>
/// Example 9
/// </summary>
/// <remarks>
/// Get a single non cash payment
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var token = "xgJHFPJUQUOlucVDjsJ5Ow";
var requestUrl = string.Format("/v1/merchant/{0}/payment/{1}", merchantKey, token);
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; }
}
}
Name | Type | Description |
---|---|---|
merchantKey | string | The unique key of the merchant - a case-sensitive series of characters |
Name | Type | Description |
---|---|---|
from | string | Only include payments after a date/time (UTC) |
to | string | Only include payments before a date/time (UTC) |
createdFrom | string | Only include payments after a date/time (UTC) |
createdTo | string | Only include payments before a date/time (UTC) |
updatedFrom | string | Only include payments changed after a date/time (UTC) |
updatedTo | string | Only include payments changed before a date/time (UTC) |
orderby | string | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
type | string | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
status | string | Only include payments with the specified status (Success, Failed, or Processing) |
source | string | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
page | integer | The page parameter (Note: page numbering starts at 0) |
pageSize | integer | The page size parameter (Note: default page size is 25) |
Scope | Description |
---|---|
merchant:view_payments | View/search payments for in-scope merchants |
Get a list of payments belonging to the merchant
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" } } }
<?php
/*
Example 1
Get a list of payments belonging to the merchant
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/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
* Get a list of payments belonging to the merchant
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/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
# Get a list of payments belonging to the merchant
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/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>
/// Get a list of payments belonging to the merchant
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?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; }
}
}
Get third page of a list of payments belonging to the merchant
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
page | 2 | query | The page parameter (Note: page numbering starts at 0) |
pageSize | 25 | query | The page size parameter (Note: default page size is 25) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 2, "pageSize": 25, "total": 51, "totalPages": 3, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?page=2" }, "prev": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?page=1" }, "first": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?page=0" } } }
<?php
/*
Example 2
Get third page of a list of payments belonging to the merchant
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$page = 2;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/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 2
* Get third page of a list of payments belonging to the merchant
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 2;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/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 2
# Get third page of a list of payments belonging to the merchant
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set page=2
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/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 Example2
{
/// <summary>
/// Example 2
/// </summary>
/// <remarks>
/// Get third page of a list of payments belonging to the merchant
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var page = 2;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?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; }
}
}
Get a list of payments within a date range, using obsolete from & to
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | 2014-08-20T00:00:00Z | query | Only include payments after a date/time (UTC) |
to | 2014-08-22T00:00:00Z | query | Only include payments before a date/time (UTC) |
createdFrom | 2014-08-20T00:00:00Z | query | Only include payments after a date/time (UTC) |
createdTo | 2014-08-22T00:00:00Z | query | Only include payments before a date/time (UTC) |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?from=2014-08-20T00:00:00Z&to=2014-08-22T00:00:00Z" } } }
<?php
/*
Example 3
Get a list of payments within a date range, using obsolete from & to
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$from = date_format(new DateTime('2014-08-20T00:00:00Z'), DATE_ISO8601);
$to = date_format(new DateTime('2014-08-22T00:00:00Z'), DATE_ISO8601);
$createdFrom = date_format(new DateTime('2014-08-20T00:00:00Z'), DATE_ISO8601);
$createdTo = date_format(new DateTime('2014-08-22T00:00:00Z'), DATE_ISO8601);
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payments?from=$from&to=$to&createdFrom=$createdFrom&createdTo=$createdTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 3
* Get a list of payments within a date range, using obsolete from & to
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String from = dateFormatter.format(dateFormatter.parse("2014-08-20T00:00:00Z"));
String to = dateFormatter.format(dateFormatter.parse("2014-08-22T00:00:00Z"));
String createdFrom = dateFormatter.format(dateFormatter.parse("2014-08-20T00:00:00Z"));
String createdTo = dateFormatter.format(dateFormatter.parse("2014-08-22T00:00:00Z"));
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payments?from=" + from + "&to=" + to + "&createdFrom=" + createdFrom + "&createdTo=" + createdTo + "&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
# Get a list of payments within a date range, using obsolete from & to
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set from="2014-08-20T00:00:00Z"
set to="2014-08-22T00:00:00Z"
set createdFrom="2014-08-20T00:00:00Z"
set createdTo="2014-08-22T00:00:00Z"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payments?from=%from%&to=%to%&createdFrom=%createdFrom%&createdTo=%createdTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example3
{
/// <summary>
/// Example 3
/// </summary>
/// <remarks>
/// Get a list of payments within a date range, using obsolete from & to
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var from = InstantPattern.ExtendedIso.Parse("2014-08-20T00:00:00Z").Value.ToString();
var to = InstantPattern.ExtendedIso.Parse("2014-08-22T00:00:00Z").Value.ToString();
var createdFrom = InstantPattern.ExtendedIso.Parse("2014-08-20T00:00:00Z").Value.ToString();
var createdTo = InstantPattern.ExtendedIso.Parse("2014-08-22T00:00:00Z").Value.ToString();
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?from={1}&to={2}&createdFrom={3}&createdTo={4}&page={5}&pageSize={6}", merchantKey,
from, to, createdFrom, createdTo, 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 list of payments modified within a date range
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | 2014-08-20T00:00:00Z | query | Only include payments after a date/time (UTC) |
to | 2014-08-22T00:00:00Z | query | Only include payments before a date/time (UTC) |
createdFrom | 2014-08-20T00:00:00Z | query | Only include payments after a date/time (UTC) |
createdTo | 2014-08-22T00:00:00Z | query | Only include payments before a date/time (UTC) |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?createdFrom=2014-08-20T00:00:00Z&createdTo=2014-08-22T00:00:00Z" } } }
<?php
/*
Example 4
Get a list of payments modified within a date range
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$from = date_format(new DateTime('2014-08-20T00:00:00Z'), DATE_ISO8601);
$to = date_format(new DateTime('2014-08-22T00:00:00Z'), DATE_ISO8601);
$createdFrom = date_format(new DateTime('2014-08-20T00:00:00Z'), DATE_ISO8601);
$createdTo = date_format(new DateTime('2014-08-22T00:00:00Z'), DATE_ISO8601);
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payments?from=$from&to=$to&createdFrom=$createdFrom&createdTo=$createdTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 4
* Get a list of payments modified within a date range
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String from = dateFormatter.format(dateFormatter.parse("2014-08-20T00:00:00Z"));
String to = dateFormatter.format(dateFormatter.parse("2014-08-22T00:00:00Z"));
String createdFrom = dateFormatter.format(dateFormatter.parse("2014-08-20T00:00:00Z"));
String createdTo = dateFormatter.format(dateFormatter.parse("2014-08-22T00:00:00Z"));
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payments?from=" + from + "&to=" + to + "&createdFrom=" + createdFrom + "&createdTo=" + createdTo + "&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 4
# Get a list of payments modified within a date range
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set from="2014-08-20T00:00:00Z"
set to="2014-08-22T00:00:00Z"
set createdFrom="2014-08-20T00:00:00Z"
set createdTo="2014-08-22T00:00:00Z"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payments?from=%from%&to=%to%&createdFrom=%createdFrom%&createdTo=%createdTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example4
{
/// <summary>
/// Example 4
/// </summary>
/// <remarks>
/// Get a list of payments modified within a date range
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var from = InstantPattern.ExtendedIso.Parse("2014-08-20T00:00:00Z").Value.ToString();
var to = InstantPattern.ExtendedIso.Parse("2014-08-22T00:00:00Z").Value.ToString();
var createdFrom = InstantPattern.ExtendedIso.Parse("2014-08-20T00:00:00Z").Value.ToString();
var createdTo = InstantPattern.ExtendedIso.Parse("2014-08-22T00:00:00Z").Value.ToString();
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?from={1}&to={2}&createdFrom={3}&createdTo={4}&page={5}&pageSize={6}", merchantKey,
from, to, createdFrom, createdTo, 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 list of payments within a date range, using the preferred syntax
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | 2014-08-19T00:00:00Z | query | Only include payments changed after a date/time (UTC) |
updatedTo | 2014-08-22T00:00:00Z | query | Only include payments changed before a date/time (UTC) |
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?updatedFrom=2014-08-19T00:00:00Z&updatedTo=2014-08-22T00:00:00Z" } } }
<?php
/*
Example 5
Get a list of payments within a date range, using the preferred syntax
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$updatedFrom = date_format(new DateTime('2014-08-19T00:00:00Z'), DATE_ISO8601);
$updatedTo = date_format(new DateTime('2014-08-22T00:00:00Z'), DATE_ISO8601);
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payments?updatedFrom=$updatedFrom&updatedTo=$updatedTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 5
* Get a list of payments within a date range, using the preferred syntax
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String updatedFrom = dateFormatter.format(dateFormatter.parse("2014-08-19T00:00:00Z"));
String updatedTo = dateFormatter.format(dateFormatter.parse("2014-08-22T00:00:00Z"));
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payments?updatedFrom=" + updatedFrom + "&updatedTo=" + updatedTo + "&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 5
# Get a list of payments within a date range, using the preferred syntax
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set updatedFrom="2014-08-19T00:00:00Z"
set updatedTo="2014-08-22T00:00:00Z"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payments?updatedFrom=%updatedFrom%&updatedTo=%updatedTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example5
{
/// <summary>
/// Example 5
/// </summary>
/// <remarks>
/// Get a list of payments within a date range, using the preferred syntax
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var updatedFrom = InstantPattern.ExtendedIso.Parse("2014-08-19T00:00:00Z").Value.ToString();
var updatedTo = InstantPattern.ExtendedIso.Parse("2014-08-22T00:00:00Z").Value.ToString();
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?updatedFrom={1}&updatedTo={2}&page={3}&pageSize={4}", merchantKey,
updatedFrom, updatedTo, 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 list of payments with a specified pagesize (max 100)
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
page | 0 | query | The page parameter (Note: page numbering starts at 0) |
pageSize | 100 | query | The page size parameter (Note: default page size is 25) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?pageSize=100" } } }
<?php
/*
Example 6
Get a list of payments with a specified pagesize (max 100)
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$page = 0;
$pageSize = 100;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/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 6
* Get a list of payments with a specified pagesize (max 100)
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 100;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/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 6
# Get a list of payments with a specified pagesize (max 100)
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set page=0
set pageSize=100
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/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 Example6
{
/// <summary>
/// Example 6
/// </summary>
/// <remarks>
/// Get a list of payments with a specified pagesize (max 100)
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var page = 0;
var pageSize = 100;
var requestUrl = string.Format("/v1/merchant/{0}/payments?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; }
}
}
Get all payments that have succeeded
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | Success | query | Only include payments with the specified status (Success, Failed, or Processing) |
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?status=success" } } }
<?php
/*
Example 7
Get all payments that have succeeded
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$status = 'Success';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payments?status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";
$curl = curl_init($url);
$curlHeaderData = [
"Accept: application/hal+json",
"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
$message = "$httpCode Error";
if ($jsonResponse['message']) {
$message = "$message: " . $jsonResponse['message'];
}
throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* Example 7
* Get all payments that have succeeded
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String status = "Success";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payments?status=" + status + "&page=" + page + "&pageSize=" + pageSize;
HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
if (httpConnection.getResponseCode() >= 400) {
System.out.println(httpConnection.getResponseCode() +
" Error: " + httpConnection.getResponseMessage());
}
InputStream inputStream = httpConnection.getInputStream();
// Store the JSON response as a Java object
Response response = getJsonResponse(inputStream);
inputStream.close();
// Store the link to the next page in a variable
URL nextLink = response._links.next.href;
httpConnection.disconnect();
}
class Response {
public int page { get; set; }
public int pageSize { get; set; }
public int total { get; set; }
public int totalPages { get; set; }
public Response[] items { get; set; }
// The JSON properties you require should be added here as fields
public _links _links = new _links();
}
class _links {
public Link self;
public Link next;
public Link prev;
public Link first;
public Link last;
}
class Link {
public URL href;
}
private static Response getJsonResponse(InputStream inputStream) throws IOException {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
String jsonString = "";
while (streamReader.ready()) {
jsonString += streamReader.readLine();
}
return (new Gson()).fromJson(jsonString, Response.class);
}
private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
String oAuthToken="TOKEN";
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("Accept", "application/hal+json");
httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
return httpConnection;
}
}
# Example 7
# Get all payments that have succeeded
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set status="Success"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payments?status=%status%&page=%page%&pageSize=%pageSize%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example7
{
/// <summary>
/// Example 7
/// </summary>
/// <remarks>
/// Get all payments that have succeeded
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var status = "Success";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?status={1}&page={2}&pageSize={3}", merchantKey,
status, page, pageSize);
client.BaseAddress = new Uri("https://api.pushpay.com");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);
var httpResponse = await client.GetAsync(requestUrl);
if (httpResponse.IsSuccessStatusCode) {
var content = await httpResponse.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<Response>(
content, new JsonSerializerSettings {
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var nextLink = response.Links.Next;
Console.WriteLine(nextLink);
return response;
} else {
var message = httpResponse.StatusCode + " Error";
throw new Exception(message);
}
}
}
}
public class Response
{
public int Page { get; set; }
public int PageSize { get; set; }
public int Total { get; set; }
public int TotalPages { get; set; }
public Response[] Items { get; set; }
[JsonProperty(PropertyName = "_links")]
public Links Links { get; set; }
// The JSON properties you require should be added here as properties
}
public class Links
{
public Link Self { get; set; }
public Link Next { get; set; }
public Link Prev { get; set; }
public Link First { get; set; }
public Link Last { get; set; }
}
public class Link {
public Uri Href { get; set; }
}
}
Get all payments of a particular type
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | ACH | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?type=credit+card" } } }
<?php
/*
Example 8
Get all payments of a particular type
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$type = 'ACH';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payments?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 8
* Get all payments of a particular type
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String type = "ACH";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payments?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 8
# Get all payments of a particular type
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set type="ACH"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payments?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 Example8
{
/// <summary>
/// Example 8
/// </summary>
/// <remarks>
/// Get all payments of a particular type
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var type = "ACH";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?type={1}&page={2}&pageSize={3}", merchantKey,
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; }
}
}
Get all types of payments, including non cash payments
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | All | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 2, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }, { "status": "Success", "assetType": "Property", "descriptionForDonor": "Mothers's house", "descriptionForMerchant": "2 storey, semi detached building", "paymentToken": "iJxO8DJp6k__95TAVadGwg", "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "Charity mission" }, { "key": "2", "value": "7863", "label": "Southern Campus" } ], "createdOn": "2019-04-30T18:21:00Z", "updatedOn": "2019-04-30T18:28:00Z", "paymentMethodType": "NonCash", "source": "VirtualTerminal", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes", "code": "101", "taxDeductible": true }, "campus": { "name": "Southern Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/iJxO8DJp6k__95TAVadGwg" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/iJxO8DJp6k__95TAVadGwg" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments?type=all" } } }
<?php
/*
Example 9
Get all types of payments, including non cash payments
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$type = 'All';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/payments?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 9
* Get all types of payments, including non cash payments
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String type = "All";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/payments?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 9
# Get all types of payments, including non cash payments
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set type="All"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/payments?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 Example9
{
/// <summary>
/// Example 9
/// </summary>
/// <remarks>
/// Get all types of payments, including non cash payments
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var type = "All";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?type={1}&page={2}&pageSize={3}", merchantKey,
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; }
}
}
Get payments with settlement data included
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "settlement": { "key": "MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0", "name": "Settlement #1000", "estimatedDepositDate": "2014-08-21T07:00:00Z" }, "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" } } }
<?php
/*
Example 10
Get payments with settlement data included
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/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 10
* Get payments with settlement data included
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/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 10
# Get payments with settlement data included
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/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 Example10
{
/// <summary>
/// Example 10
/// </summary>
/// <remarks>
/// Get payments with settlement data included
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/payments?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; }
}
}
Name | Type | Description |
---|---|---|
merchantKey | string | The unique key of the merchant - a case-sensitive series of characters |
paymentToken | string |
Name | Type | Description |
---|---|---|
from | string | Only include payments after a date/time (UTC) |
to | string | Only include payments before a date/time (UTC) |
createdFrom | string | Only include payments after a date/time (UTC) |
createdTo | string | Only include payments before a date/time (UTC) |
updatedFrom | string | Only include payments changed after a date/time (UTC) |
updatedTo | string | Only include payments changed before a date/time (UTC) |
orderby | string | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
type | string | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
status | string | Only include payments with the specified status (Success, Failed, or Processing) |
source | string | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
page | integer | The page parameter (Note: page numbering starts at 0) |
pageSize | integer | The page size parameter (Note: default page size is 25) |
Scope | Description |
---|---|
merchant:view_recurring_payments | View/search recurring payments for in-scope merchants |
read | Read-only access to resources owned by the subject claim of the token |
Get a list of payments belonging to a recurring payment
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
paymentToken | VMZqPmcWY0qfsxoE38ja3w | path | The unique token of the payment - a case-sensitive series of characters |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "recurringPaymentToken": "VMZqPmcWY0qfsxoE38ja3w", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "ScheduledPayment", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "recurringpayment": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/VMZqPmcWY0qfsxoE38ja3w" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/VMZqPmcWY0qfsxoE38ja3w" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/VMZqPmcWY0qfsxoE38ja3w" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" } } }
<?php
/*
Example 1
Get a list of payments belonging to a recurring payment
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$paymentToken = 'VMZqPmcWY0qfsxoE38ja3w';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayment/$paymentToken/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
* Get a list of payments belonging to a recurring payment
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String paymentToken = "VMZqPmcWY0qfsxoE38ja3w";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayment/" + paymentToken + "/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
# Get a list of payments belonging to a recurring payment
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set paymentToken="VMZqPmcWY0qfsxoE38ja3w"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayment/%paymentToken%/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>
/// Get a list of payments belonging to a recurring payment
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var paymentToken = "VMZqPmcWY0qfsxoE38ja3w";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayment/{1}/payments?page={2}&pageSize={3}", merchantKey, paymentToken,
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; }
}
}
Retrieves a single recurring payment record, given the keys for the merchant and the payment
Name | Type | Description |
---|---|---|
merchantKey | string | The unique key of the merchant - a case-sensitive series of characters |
token | string | The token is a unique identifier for this resource - a case-sensitive series of characters |
Scope | Description |
---|---|
merchant:view_recurring_payments | View/search recurring payments for in-scope merchants |
read | Read-only access to resources owned by the subject claim of the token |
Retrieve a single recurring payment schedule
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the merchant - a case-sensitive series of characters |
token | BQM1lWLcM0uKc1y4a8RHUw | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } }
<?php
/*
Example 1
Retrieve a single recurring payment schedule
*/
$merchantKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$token = 'BQM1lWLcM0uKc1y4a8RHUw';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayment/$token";
$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 recurring payment schedule
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
String token = "BQM1lWLcM0uKc1y4a8RHUw";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayment/" + token;
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 recurring payment schedule
set oAuthToken=%1
set merchantKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set token="BQM1lWLcM0uKc1y4a8RHUw"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayment/%token%"
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 recurring payment schedule
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var token = "BQM1lWLcM0uKc1y4a8RHUw";
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayment/{1}", merchantKey, token);
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 non-existant recurring payment schedule
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the merchant - a case-sensitive series of characters |
token | AAAAAAAAAAAAAAAAAAAAAA | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "message": "The specified recurring payment key is unknown" }
<?php
/*
Example 2
Retrieve a non-existant recurring payment schedule
*/
$merchantKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$token = 'AAAAAAAAAAAAAAAAAAAAAA';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayment/$token";
$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 non-existant recurring payment schedule
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
String token = "AAAAAAAAAAAAAAAAAAAAAA";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayment/" + token;
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 non-existant recurring payment schedule
set oAuthToken=%1
set merchantKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set token="AAAAAAAAAAAAAAAAAAAAAA"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayment/%token%"
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 non-existant recurring payment schedule
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var token = "AAAAAAAAAAAAAAAAAAAAAA";
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayment/{1}", merchantKey, token);
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 recurring payment schedule against a non-existant payer
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk | path | The unique key of the merchant - a case-sensitive series of characters |
token | BQM1lWLcM0uKc1y4a8RHUw | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "message": "The specified payer key is unknown" }
<?php
/*
Example 3
Retrieve a recurring payment schedule against a non-existant payer
*/
$merchantKey = 'NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk';
$token = 'BQM1lWLcM0uKc1y4a8RHUw';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayment/$token";
$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 3
* Retrieve a recurring payment schedule against a non-existant payer
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk";
String token = "BQM1lWLcM0uKc1y4a8RHUw";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayment/" + token;
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 3
# Retrieve a recurring payment schedule against a non-existant payer
set oAuthToken=%1
set merchantKey="NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk"
set token="BQM1lWLcM0uKc1y4a8RHUw"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayment/%token%"
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>
/// Retrieve a recurring payment schedule against a non-existant payer
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk";
var token = "BQM1lWLcM0uKc1y4a8RHUw";
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayment/{1}", merchantKey, token);
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 recurring payment schedule that doesn't belong to the specified payer
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | NDpOUlJfakxTWWx3VktnWVpvM3VaWDR3NDBMcDQ | path | The unique key of the merchant - a case-sensitive series of characters |
token | BQM1lWLcM0uKc1y4a8RHUw | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "message": "That recurring payment does not belong to the specified payer" }
<?php
/*
Example 4
Retrieve a recurring payment schedule that doesn't belong to the specified payer
*/
$merchantKey = 'NDpOUlJfakxTWWx3VktnWVpvM3VaWDR3NDBMcDQ';
$token = 'BQM1lWLcM0uKc1y4a8RHUw';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayment/$token";
$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 4
* Retrieve a recurring payment schedule that doesn't belong to the specified payer
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "NDpOUlJfakxTWWx3VktnWVpvM3VaWDR3NDBMcDQ";
String token = "BQM1lWLcM0uKc1y4a8RHUw";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayment/" + token;
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 4
# Retrieve a recurring payment schedule that doesn't belong to the specified payer
set oAuthToken=%1
set merchantKey="NDpOUlJfakxTWWx3VktnWVpvM3VaWDR3NDBMcDQ"
set token="BQM1lWLcM0uKc1y4a8RHUw"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayment/%token%"
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 Example4
{
/// <summary>
/// Example 4
/// </summary>
/// <remarks>
/// Retrieve a recurring payment schedule that doesn't belong to the specified payer
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "NDpOUlJfakxTWWx3VktnWVpvM3VaWDR3NDBMcDQ";
var token = "BQM1lWLcM0uKc1y4a8RHUw";
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayment/{1}", merchantKey, token);
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 recurring payment schedule, which has additional custom data stored against it (which was included in the POST/PUT request when the recurring payment was made or updated)
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the merchant - a case-sensitive series of characters |
token | BQM1lWLcM0uKc1y4a8RHUw | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "data": { "tx_id": "123123", "funds": [ "bits", "bobs" ] }, "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } }
<?php
/*
Example 5
Retrieve a recurring payment schedule, which has additional custom data stored against it (which was included in the POST/PUT request when the recurring payment was made or updated)
*/
$merchantKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$token = 'BQM1lWLcM0uKc1y4a8RHUw';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayment/$token";
$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 5
* Retrieve a recurring payment schedule, which has additional custom data stored against it (which was included in the POST/PUT request when the recurring payment was made or updated)
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
String token = "BQM1lWLcM0uKc1y4a8RHUw";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayment/" + token;
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 5
# Retrieve a recurring payment schedule, which has additional custom data stored against it (which was included in the POST/PUT request when the recurring payment was made or updated)
set oAuthToken=%1
set merchantKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set token="BQM1lWLcM0uKc1y4a8RHUw"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayment/%token%"
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 Example5
{
/// <summary>
/// Example 5
/// </summary>
/// <remarks>
/// Retrieve a recurring payment schedule, which has additional custom data stored against it (which was included in the POST/PUT request when the recurring payment was made or updated)
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var token = "BQM1lWLcM0uKc1y4a8RHUw";
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayment/{1}", merchantKey, token);
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 single recurring payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_recurring_payments scope
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the merchant - a case-sensitive series of characters |
token | BQM1lWLcM0uKc1y4a8RHUw | path | The token is a unique identifier for this resource - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "data": { "tx_id": "123123", "funds": [ "bits", "bobs" ] }, "externalLinks": [ { "application": { "name": "ChurchCommunityBuilder", "type": "ChurchManagementSystem" }, "relationship": "fund_id", "value": "5675" } ], "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } }
<?php
/*
Example 6
Get a single recurring payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_recurring_payments scope
*/
$merchantKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$token = 'BQM1lWLcM0uKc1y4a8RHUw';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayment/$token";
$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 6
* Get a single recurring payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_recurring_payments scope
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
String token = "BQM1lWLcM0uKc1y4a8RHUw";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayment/" + token;
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 6
# Get a single recurring payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_recurring_payments scope
set oAuthToken=%1
set merchantKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set token="BQM1lWLcM0uKc1y4a8RHUw"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayment/%token%"
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 Example6
{
/// <summary>
/// Example 6
/// </summary>
/// <remarks>
/// Get a single recurring payment which has an integration's fund_id included in the set of externalLinks. The external link is only included when the client has the merchant:view_recurring_payments scope
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var token = "BQM1lWLcM0uKc1y4a8RHUw";
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayment/{1}", merchantKey, token);
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; }
}
}
Retrieves all recurring payment records associated with a merchant
Name | Type | Description |
---|---|---|
merchantKey | string | The unique key of the merchant - a case-sensitive series of characters |
Name | Type | Description |
---|---|---|
updatedFrom | string | Only include payments changed after a date/time (UTC) |
updatedTo | string | Only include payments changed before a date/time (UTC) |
createdFrom | string | Only include payments after a date/time (UTC) |
createdTo | string | Only include payments before a date/time (UTC) |
status | array | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | string | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
page | integer | The page parameter (Note: page numbering starts at 0) |
pageSize | integer | The page size parameter (Note: default page size is 25) |
Scope | Description |
---|---|
merchant:view_recurring_payments | View/search recurring payments for in-scope merchants |
Retrieve all recurring payments associated with a recipient, with a default status of active
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 1
Retrieve all recurring payments associated with a recipient, with a default status of active
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?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 all recurring payments associated with a recipient, with a default status of active
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?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 all recurring payments associated with a recipient, with a default status of active
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?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 all recurring payments associated with a recipient, with a default status of active
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?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 all recurring payments associated with a recipient, with the specified status
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | Paused | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Paused", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 2
Retrieve all recurring payments associated with a recipient, with the specified status
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$status = $page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";
$curl = curl_init($url);
$curlHeaderData = [
"Accept: application/hal+json",
"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
$message = "$httpCode Error";
if ($jsonResponse['message']) {
$message = "$message: " . $jsonResponse['message'];
}
throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* Example 2
* Retrieve all recurring payments associated with a recipient, with the specified status
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?status=" + status + "&page=" + page + "&pageSize=" + pageSize;
HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
if (httpConnection.getResponseCode() >= 400) {
System.out.println(httpConnection.getResponseCode() +
" Error: " + httpConnection.getResponseMessage());
}
InputStream inputStream = httpConnection.getInputStream();
// Store the JSON response as a Java object
Response response = getJsonResponse(inputStream);
inputStream.close();
// Store the link to the next page in a variable
URL nextLink = response._links.next.href;
httpConnection.disconnect();
}
class Response {
public int page { get; set; }
public int pageSize { get; set; }
public int total { get; set; }
public int totalPages { get; set; }
public Response[] items { get; set; }
// The JSON properties you require should be added here as fields
public _links _links = new _links();
}
class _links {
public Link self;
public Link next;
public Link prev;
public Link first;
public Link last;
}
class Link {
public URL href;
}
private static Response getJsonResponse(InputStream inputStream) throws IOException {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
String jsonString = "";
while (streamReader.ready()) {
jsonString += streamReader.readLine();
}
return (new Gson()).fromJson(jsonString, Response.class);
}
private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
String oAuthToken="TOKEN";
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("Accept", "application/hal+json");
httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
return httpConnection;
}
}
# Example 2
# Retrieve all recurring payments associated with a recipient, with the specified status
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set status=Paused
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?status=%status%&page=%page%&pageSize=%pageSize%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example2
{
/// <summary>
/// Example 2
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, with the specified status
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var status = "Paused";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?status={1}&page={2}&pageSize={3}", merchantKey,
status, page, pageSize);
client.BaseAddress = new Uri("https://api.pushpay.com");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);
var httpResponse = await client.GetAsync(requestUrl);
if (httpResponse.IsSuccessStatusCode) {
var content = await httpResponse.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<Response>(
content, new JsonSerializerSettings {
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var nextLink = response.Links.Next;
Console.WriteLine(nextLink);
return response;
} else {
var message = httpResponse.StatusCode + " Error";
throw new Exception(message);
}
}
}
}
public class Response
{
public int Page { get; set; }
public int PageSize { get; set; }
public int Total { get; set; }
public int TotalPages { get; set; }
public Response[] Items { get; set; }
[JsonProperty(PropertyName = "_links")]
public Links Links { get; set; }
// The JSON properties you require should be added here as properties
}
public class Links
{
public Link Self { get; set; }
public Link Next { get; set; }
public Link Prev { get; set; }
public Link First { get; set; }
public Link Last { get; set; }
}
public class Link {
public Uri Href { get; set; }
}
}
Retrieve all recurring payments associated with a recipient, with any of the specified statues
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | Paused | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
status | Cancelled | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Paused", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 3
Retrieve all recurring payments associated with a recipient, with any of the specified statues
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$status = $status = $page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?status=$status&status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";
$curl = curl_init($url);
$curlHeaderData = [
"Accept: application/hal+json",
"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
$message = "$httpCode Error";
if ($jsonResponse['message']) {
$message = "$message: " . $jsonResponse['message'];
}
throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* Example 3
* Retrieve all recurring payments associated with a recipient, with any of the specified statues
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?status=" + status + "&status=" + status + "&page=" + page + "&pageSize=" + pageSize;
HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
if (httpConnection.getResponseCode() >= 400) {
System.out.println(httpConnection.getResponseCode() +
" Error: " + httpConnection.getResponseMessage());
}
InputStream inputStream = httpConnection.getInputStream();
// Store the JSON response as a Java object
Response response = getJsonResponse(inputStream);
inputStream.close();
// Store the link to the next page in a variable
URL nextLink = response._links.next.href;
httpConnection.disconnect();
}
class Response {
public int page { get; set; }
public int pageSize { get; set; }
public int total { get; set; }
public int totalPages { get; set; }
public Response[] items { get; set; }
// The JSON properties you require should be added here as fields
public _links _links = new _links();
}
class _links {
public Link self;
public Link next;
public Link prev;
public Link first;
public Link last;
}
class Link {
public URL href;
}
private static Response getJsonResponse(InputStream inputStream) throws IOException {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
String jsonString = "";
while (streamReader.ready()) {
jsonString += streamReader.readLine();
}
return (new Gson()).fromJson(jsonString, Response.class);
}
private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
String oAuthToken="TOKEN";
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("Accept", "application/hal+json");
httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
return httpConnection;
}
}
# Example 3
# Retrieve all recurring payments associated with a recipient, with any of the specified statues
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set status=Paused
set status=Cancelled
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?status=%status%&status=%status%&page=%page%&pageSize=%pageSize%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example3
{
/// <summary>
/// Example 3
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, with any of the specified statues
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var status = "Paused";
var status = "Cancelled";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?status={1}&status={2}&page={3}&pageSize={4}", merchantKey,
status, status, page, pageSize);
client.BaseAddress = new Uri("https://api.pushpay.com");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);
var httpResponse = await client.GetAsync(requestUrl);
if (httpResponse.IsSuccessStatusCode) {
var content = await httpResponse.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<Response>(
content, new JsonSerializerSettings {
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var nextLink = response.Links.Next;
Console.WriteLine(nextLink);
return response;
} else {
var message = httpResponse.StatusCode + " Error";
throw new Exception(message);
}
}
}
}
public class Response
{
public int Page { get; set; }
public int PageSize { get; set; }
public int Total { get; set; }
public int TotalPages { get; set; }
public Response[] Items { get; set; }
[JsonProperty(PropertyName = "_links")]
public Links Links { get; set; }
// The JSON properties you require should be added here as properties
}
public class Links
{
public Link Self { get; set; }
public Link Next { get; set; }
public Link Prev { get; set; }
public Link First { get; set; }
public Link Last { get; set; }
}
public class Link {
public Uri Href { get; set; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by creation date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | createdOn ASC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 4
Retrieve all recurring payments associated with a recipient, ordered by creation date
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'createdOn ASC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?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 4
* Retrieve all recurring payments associated with a recipient, ordered by creation date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "createdOn ASC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?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 4
# Retrieve all recurring payments associated with a recipient, ordered by creation date
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="createdOn ASC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?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 Example4
{
/// <summary>
/// Example 4
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by creation date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "createdOn ASC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by update date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | updatedOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 5
Retrieve all recurring payments associated with a recipient, ordered by update date
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'updatedOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?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 5
* Retrieve all recurring payments associated with a recipient, ordered by update date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "updatedOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?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 5
# Retrieve all recurring payments associated with a recipient, ordered by update date
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="updatedOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?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 Example5
{
/// <summary>
/// Example 5
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by update date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "updatedOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by start date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | startDate ASC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 6
Retrieve all recurring payments associated with a recipient, ordered by start date
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'startDate ASC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?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 6
* Retrieve all recurring payments associated with a recipient, ordered by start date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "startDate ASC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?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 6
# Retrieve all recurring payments associated with a recipient, ordered by start date
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="startDate ASC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?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 Example6
{
/// <summary>
/// Example 6
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by start date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "startDate ASC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by next payment date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | nextPaymentDate ASC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 7
Retrieve all recurring payments associated with a recipient, ordered by next payment date
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'nextPaymentDate ASC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?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 7
* Retrieve all recurring payments associated with a recipient, ordered by next payment date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "nextPaymentDate ASC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?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 7
# Retrieve all recurring payments associated with a recipient, ordered by next payment date
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="nextPaymentDate ASC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?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 Example7
{
/// <summary>
/// Example 7
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by next payment date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "nextPaymentDate ASC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | updatedOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 8
Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'updatedOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?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 8
* Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "updatedOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?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 8
# Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="updatedOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?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 Example8
{
/// <summary>
/// Example 8
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "updatedOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments created within a date range
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | 2015-01-01T00:00:00Z | query | Only include payments after a date/time (UTC) |
createdTo | 2015-02-01T00:00:00Z | query | Only include payments before a date/time (UTC) |
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | createdOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 9
Retrieve all recurring payments created within a date range
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$createdFrom = date_format(new DateTime('2015-01-01T00:00:00Z'), DATE_ISO8601);
$createdTo = date_format(new DateTime('2015-02-01T00:00:00Z'), DATE_ISO8601);
$orderBy = 'createdOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?createdFrom=$createdFrom&createdTo=$createdTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 9
* Retrieve all recurring payments created within a date range
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String createdFrom = dateFormatter.format(dateFormatter.parse("2015-01-01T00:00:00Z"));
String createdTo = dateFormatter.format(dateFormatter.parse("2015-02-01T00:00:00Z"));
String orderBy = "createdOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?createdFrom=" + createdFrom + "&createdTo=" + createdTo + "&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 9
# Retrieve all recurring payments created within a date range
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set createdFrom="2015-01-01T00:00:00Z"
set createdTo="2015-02-01T00:00:00Z"
set orderBy="createdOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?createdFrom=%createdFrom%&createdTo=%createdTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example9
{
/// <summary>
/// Example 9
/// </summary>
/// <remarks>
/// Retrieve all recurring payments created within a date range
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var createdFrom = InstantPattern.ExtendedIso.Parse("2015-01-01T00:00:00Z").Value.ToString();
var createdTo = InstantPattern.ExtendedIso.Parse("2015-02-01T00:00:00Z").Value.ToString();
var orderBy = "createdOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?createdFrom={1}&createdTo={2}&orderBy={3}&page={4}&pageSize={5}", merchantKey,
createdFrom, createdTo, 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; }
}
}
Retrieve all recurring payments updated within a date range
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | 2015-06-01T00:00:00Z | query | Only include payments changed after a date/time (UTC) |
updatedTo | 2015-06-15T00:00:00Z | query | Only include payments changed before a date/time (UTC) |
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | updatedOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 10
Retrieve all recurring payments updated within a date range
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$updatedFrom = date_format(new DateTime('2015-06-01T00:00:00Z'), DATE_ISO8601);
$updatedTo = date_format(new DateTime('2015-06-15T00:00:00Z'), DATE_ISO8601);
$orderBy = 'updatedOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?updatedFrom=$updatedFrom&updatedTo=$updatedTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 10
* Retrieve all recurring payments updated within a date range
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String updatedFrom = dateFormatter.format(dateFormatter.parse("2015-06-01T00:00:00Z"));
String updatedTo = dateFormatter.format(dateFormatter.parse("2015-06-15T00:00:00Z"));
String orderBy = "updatedOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?updatedFrom=" + updatedFrom + "&updatedTo=" + updatedTo + "&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 10
# Retrieve all recurring payments updated within a date range
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set updatedFrom="2015-06-01T00:00:00Z"
set updatedTo="2015-06-15T00:00:00Z"
set orderBy="updatedOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?updatedFrom=%updatedFrom%&updatedTo=%updatedTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example10
{
/// <summary>
/// Example 10
/// </summary>
/// <remarks>
/// Retrieve all recurring payments updated within a date range
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var updatedFrom = InstantPattern.ExtendedIso.Parse("2015-06-01T00:00:00Z").Value.ToString();
var updatedTo = InstantPattern.ExtendedIso.Parse("2015-06-15T00:00:00Z").Value.ToString();
var orderBy = "updatedOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?updatedFrom={1}&updatedTo={2}&orderBy={3}&page={4}&pageSize={5}", merchantKey,
updatedFrom, updatedTo, 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; }
}
}
Retrieve all recurring payments with a specified pagesize (max 100)
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | The unique key of the merchant - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
page | 0 | query | The page parameter (Note: page numbering starts at 0) |
pageSize | 100 | query | The page size parameter (Note: default page size is 25) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 11
Retrieve all recurring payments with a specified pagesize (max 100)
*/
$merchantKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$page = 0;
$pageSize = 100;
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/recurringpayments?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 11
* Retrieve all recurring payments with a specified pagesize (max 100)
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 100;
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/recurringpayments?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 11
# Retrieve all recurring payments with a specified pagesize (max 100)
set oAuthToken=%1
set merchantKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set page=0
set pageSize=100
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/recurringpayments?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 Example11
{
/// <summary>
/// Example 11
/// </summary>
/// <remarks>
/// Retrieve all recurring payments with a specified pagesize (max 100)
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var page = 0;
var pageSize = 100;
var requestUrl = string.Format("/v1/merchant/{0}/recurringpayments?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; }
}
}
Name | Type | Description |
---|---|---|
merchantKey | string | The unique key of the merchant - a case-sensitive series of characters |
splitPaymentKey | string | The unique key of the split payment - a case-sensitive series of characters |
Scope | Description |
---|---|
merchant:view_payments | View/search payments for in-scope merchants |
read | Read-only access to resources owned by the subject claim of the token |
Retrieve a single split payment
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA | path | The unique key of the merchant - a case-sensitive series of characters |
splitPaymentKey | MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw | path | The unique key of the split payment - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "key": "MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw", "totalAmount": { "amount": "150.00", "currency": "USD" }, "items": [ { "status": "Success", "transactionId": "1", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/community/NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "23456", "value": "For last week", "label": "Message" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "DepositedCheck", "source": "CheckDeposit", "depositedCheck": { "routingNumber": "123456789", "reference": "123456789 ●●●●12", "bankName": "Unknown", "checkNumber": "111111111" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }, { "status": "Success", "transactionId": "2", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/community/NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "23456", "value": "For last week", "label": "Message" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "DepositedCheck", "source": "CheckDeposit", "depositedCheck": { "routingNumber": "123456789", "reference": "123456789 ●●●●12", "bankName": "Unknown", "checkNumber": "111111111" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } }, { "status": "Success", "transactionId": "3", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/community/NToyWlFWbUhKNF9qa2JzZDFDckxQUVRaSlZkNlk" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "23456", "value": "For last week", "label": "Message" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "DepositedCheck", "source": "CheckDeposit", "depositedCheck": { "routingNumber": "123456789", "reference": "123456789 ●●●●12", "bankName": "Unknown", "checkNumber": "111111111" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA/splitpayment/MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw" } } }
<?php
/*
Example 1
Retrieve a single split payment
*/
$merchantKey = 'NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA';
$splitPaymentKey = 'MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/splitpayment/$splitPaymentKey";
$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 split payment
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA";
String splitPaymentKey = "MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/splitpayment/" + splitPaymentKey;
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 split payment
set oAuthToken=%1
set merchantKey="NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA"
set splitPaymentKey="MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/splitpayment/%splitPaymentKey%"
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 split payment
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA";
var splitPaymentKey = "MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw";
var requestUrl = string.Format("/v1/merchant/{0}/splitpayment/{1}", merchantKey, splitPaymentKey);
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 non-existent split payment
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA | path | The unique key of the merchant - a case-sensitive series of characters |
splitPaymentKey | MDpHVVduREJhUU5XeFJzdGdpYWRaOHgyUzJxaFE | path | The unique key of the split payment - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "message": "The specified split payment key is unknown" }
<?php
/*
Example 2
Retrieve a non-existent split payment
*/
$merchantKey = 'NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA';
$splitPaymentKey = 'MDpHVVduREJhUU5XeFJzdGdpYWRaOHgyUzJxaFE';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/splitpayment/$splitPaymentKey";
$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 non-existent split payment
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA";
String splitPaymentKey = "MDpHVVduREJhUU5XeFJzdGdpYWRaOHgyUzJxaFE";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/splitpayment/" + splitPaymentKey;
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 non-existent split payment
set oAuthToken=%1
set merchantKey="NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA"
set splitPaymentKey="MDpHVVduREJhUU5XeFJzdGdpYWRaOHgyUzJxaFE"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/splitpayment/%splitPaymentKey%"
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 non-existent split payment
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "NDpkdDUydTFYUXBER3ctLUVfbHVlb2p1QnFvNjA";
var splitPaymentKey = "MDpHVVduREJhUU5XeFJzdGdpYWRaOHgyUzJxaFE";
var requestUrl = string.Format("/v1/merchant/{0}/splitpayment/{1}", merchantKey, splitPaymentKey);
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 split payment against a non-existent merchant
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MDpMYWd4QzRrNHhlZXl4Zmg5bjA2UkswTS0wblU | path | The unique key of the merchant - a case-sensitive series of characters |
splitPaymentKey | MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw | path | The unique key of the split payment - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "message": "The specified merchant key is unknown" }
<?php
/*
Example 3
Retrieve a split payment against a non-existent merchant
*/
$merchantKey = 'MDpMYWd4QzRrNHhlZXl4Zmg5bjA2UkswTS0wblU';
$splitPaymentKey = 'MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/splitpayment/$splitPaymentKey";
$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 3
* Retrieve a split payment against a non-existent merchant
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String merchantKey = "MDpMYWd4QzRrNHhlZXl4Zmg5bjA2UkswTS0wblU";
String splitPaymentKey = "MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/splitpayment/" + splitPaymentKey;
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 3
# Retrieve a split payment against a non-existent merchant
set oAuthToken=%1
set merchantKey="MDpMYWd4QzRrNHhlZXl4Zmg5bjA2UkswTS0wblU"
set splitPaymentKey="MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/splitpayment/%splitPaymentKey%"
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>
/// Retrieve a split payment against a non-existent merchant
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MDpMYWd4QzRrNHhlZXl4Zmg5bjA2UkswTS0wblU";
var splitPaymentKey = "MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw";
var requestUrl = string.Format("/v1/merchant/{0}/splitpayment/{1}", merchantKey, splitPaymentKey);
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 split payment that doesn't belong to the specified merchant
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
merchantKey | MjpIbFlXZFRwRzRSWG5aSlhIbFZLTkdGalBsSDg | path | The unique key of the merchant - a case-sensitive series of characters |
splitPaymentKey | MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw | path | The unique key of the split payment - a case-sensitive series of characters |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "message": "That split payment does not belong to the specified merchant" }
<?php
/*
Example 4
Retrieve a split payment that doesn't belong to the specified merchant
*/
$merchantKey = 'MjpIbFlXZFRwRzRSWG5aSlhIbFZLTkdGalBsSDg';
$splitPaymentKey = 'MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw';
$url = "https://api.pushpay.com/v1/merchant/$merchantKey/splitpayment/$splitPaymentKey";
$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 4
* Retrieve a split payment that doesn't 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 = "MjpIbFlXZFRwRzRSWG5aSlhIbFZLTkdGalBsSDg";
String splitPaymentKey = "MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw";
String urlString = "https://api.pushpay.com/v1/merchant/" + merchantKey + "/splitpayment/" + splitPaymentKey;
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 4
# Retrieve a split payment that doesn't belong to the specified merchant
set oAuthToken=%1
set merchantKey="MjpIbFlXZFRwRzRSWG5aSlhIbFZLTkdGalBsSDg"
set splitPaymentKey="MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw"
set url="https://api.pushpay.com/v1/merchant/%merchantKey%/splitpayment/%splitPaymentKey%"
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 Example4
{
/// <summary>
/// Example 4
/// </summary>
/// <remarks>
/// Retrieve a split payment that doesn't belong to the specified merchant
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var merchantKey = "MjpIbFlXZFRwRzRSWG5aSlhIbFZLTkdGalBsSDg";
var splitPaymentKey = "MTIzOjlrd1o0Sjl4a2FzQVdkQXRZS0VoWjJwSFI4bw";
var requestUrl = string.Format("/v1/merchant/{0}/splitpayment/{1}", merchantKey, splitPaymentKey);
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; }
}
}
Name | Type | Description |
---|---|---|
organizationKey | string |
Name | Type | Description |
---|---|---|
from | string | Only include payments after a date/time (UTC) |
to | string | Only include payments before a date/time (UTC) |
createdFrom | string | Only include payments after a date/time (UTC) |
createdTo | string | Only include payments before a date/time (UTC) |
updatedFrom | string | Only include payments changed after a date/time (UTC) |
updatedTo | string | Only include payments changed before a date/time (UTC) |
orderby | string | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
type | string | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
status | string | Only include payments with the specified status (Success, Failed, or Processing) |
source | string | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
page | integer | The page parameter (Note: page numbering starts at 0) |
pageSize | integer | The page size parameter (Note: default page size is 25) |
Scope | Description |
---|---|
merchant:view_payments | View/search payments for in-scope merchants |
Get a list of payments belonging to the organization
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA | path | |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments" } } }
<?php
/*
Example 1
Get a list of payments belonging to the organization
*/
$organizationKey = 'MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/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
* Get a list of payments belonging to the organization
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/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
# Get a list of payments belonging to the organization
set oAuthToken=%1
set organizationKey="MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/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>
/// Get a list of payments belonging to the organization
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/payments?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; }
}
}
Get third page of a list of payments belonging to the organization
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA | path | |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
page | 2 | query | The page parameter (Note: page numbering starts at 0) |
pageSize | 25 | query | The page size parameter (Note: default page size is 25) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA", "page": 2, "pageSize": 25, "total": 51, "totalPages": 3, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments?page=2" }, "prev": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments?page=1" }, "first": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments?page=0" } } }
<?php
/*
Example 2
Get third page of a list of payments belonging to the organization
*/
$organizationKey = 'MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA';
$page = 2;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/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 2
* Get third page of a list of payments belonging to the organization
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
int page = 2;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/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 2
# Get third page of a list of payments belonging to the organization
set oAuthToken=%1
set organizationKey="MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA"
set page=2
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/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 Example2
{
/// <summary>
/// Example 2
/// </summary>
/// <remarks>
/// Get third page of a list of payments belonging to the organization
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
var page = 2;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/payments?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; }
}
}
Get a list of payments modified within a date range
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA | path | |
from | 2014-08-20T00:00:00Z | query | Only include payments after a date/time (UTC) |
to | 2014-08-22T00:00:00Z | query | Only include payments before a date/time (UTC) |
createdFrom | 2014-08-20T00:00:00Z | query | Only include payments after a date/time (UTC) |
createdTo | 2014-08-22T00:00:00Z | query | Only include payments before a date/time (UTC) |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments" } } }
<?php
/*
Example 3
Get a list of payments modified within a date range
*/
$organizationKey = 'MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA';
$from = date_format(new DateTime('2014-08-20T00:00:00Z'), DATE_ISO8601);
$to = date_format(new DateTime('2014-08-22T00:00:00Z'), DATE_ISO8601);
$createdFrom = date_format(new DateTime('2014-08-20T00:00:00Z'), DATE_ISO8601);
$createdTo = date_format(new DateTime('2014-08-22T00:00:00Z'), DATE_ISO8601);
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/payments?from=$from&to=$to&createdFrom=$createdFrom&createdTo=$createdTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 3
* Get a list of payments modified within a date range
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
String from = dateFormatter.format(dateFormatter.parse("2014-08-20T00:00:00Z"));
String to = dateFormatter.format(dateFormatter.parse("2014-08-22T00:00:00Z"));
String createdFrom = dateFormatter.format(dateFormatter.parse("2014-08-20T00:00:00Z"));
String createdTo = dateFormatter.format(dateFormatter.parse("2014-08-22T00:00:00Z"));
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/payments?from=" + from + "&to=" + to + "&createdFrom=" + createdFrom + "&createdTo=" + createdTo + "&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
# Get a list of payments modified within a date range
set oAuthToken=%1
set organizationKey="MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA"
set from="2014-08-20T00:00:00Z"
set to="2014-08-22T00:00:00Z"
set createdFrom="2014-08-20T00:00:00Z"
set createdTo="2014-08-22T00:00:00Z"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/payments?from=%from%&to=%to%&createdFrom=%createdFrom%&createdTo=%createdTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example3
{
/// <summary>
/// Example 3
/// </summary>
/// <remarks>
/// Get a list of payments modified within a date range
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
var from = InstantPattern.ExtendedIso.Parse("2014-08-20T00:00:00Z").Value.ToString();
var to = InstantPattern.ExtendedIso.Parse("2014-08-22T00:00:00Z").Value.ToString();
var createdFrom = InstantPattern.ExtendedIso.Parse("2014-08-20T00:00:00Z").Value.ToString();
var createdTo = InstantPattern.ExtendedIso.Parse("2014-08-22T00:00:00Z").Value.ToString();
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/payments?from={1}&to={2}&createdFrom={3}&createdTo={4}&page={5}&pageSize={6}", organizationKey,
from, to, createdFrom, createdTo, 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 list of payments within a date range, using the preferred syntax
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA | path | |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | 2014-08-19T00:00:00Z | query | Only include payments changed after a date/time (UTC) |
updatedTo | 2014-08-22T00:00:00Z | query | Only include payments changed before a date/time (UTC) |
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments" } } }
<?php
/*
Example 4
Get a list of payments within a date range, using the preferred syntax
*/
$organizationKey = 'MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA';
$updatedFrom = date_format(new DateTime('2014-08-19T00:00:00Z'), DATE_ISO8601);
$updatedTo = date_format(new DateTime('2014-08-22T00:00:00Z'), DATE_ISO8601);
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/payments?updatedFrom=$updatedFrom&updatedTo=$updatedTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 4
* Get a list of payments within a date range, using the preferred syntax
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
String updatedFrom = dateFormatter.format(dateFormatter.parse("2014-08-19T00:00:00Z"));
String updatedTo = dateFormatter.format(dateFormatter.parse("2014-08-22T00:00:00Z"));
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/payments?updatedFrom=" + updatedFrom + "&updatedTo=" + updatedTo + "&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 4
# Get a list of payments within a date range, using the preferred syntax
set oAuthToken=%1
set organizationKey="MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA"
set updatedFrom="2014-08-19T00:00:00Z"
set updatedTo="2014-08-22T00:00:00Z"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/payments?updatedFrom=%updatedFrom%&updatedTo=%updatedTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example4
{
/// <summary>
/// Example 4
/// </summary>
/// <remarks>
/// Get a list of payments within a date range, using the preferred syntax
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
var updatedFrom = InstantPattern.ExtendedIso.Parse("2014-08-19T00:00:00Z").Value.ToString();
var updatedTo = InstantPattern.ExtendedIso.Parse("2014-08-22T00:00:00Z").Value.ToString();
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/payments?updatedFrom={1}&updatedTo={2}&page={3}&pageSize={4}", organizationKey,
updatedFrom, updatedTo, 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 list of payments with a specified pagesize (max 100)
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA | path | |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
page | 0 | query | The page parameter (Note: page numbering starts at 0) |
pageSize | 100 | query | The page size parameter (Note: default page size is 25) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments" } } }
<?php
/*
Example 5
Get a list of payments with a specified pagesize (max 100)
*/
$organizationKey = 'MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA';
$page = 0;
$pageSize = 100;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/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 5
* Get a list of payments with a specified pagesize (max 100)
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
int page = 0;
int pageSize = 100;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/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 5
# Get a list of payments with a specified pagesize (max 100)
set oAuthToken=%1
set organizationKey="MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA"
set page=0
set pageSize=100
set url="https://api.pushpay.com/v1/organization/%organizationKey%/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 Example5
{
/// <summary>
/// Example 5
/// </summary>
/// <remarks>
/// Get a list of payments with a specified pagesize (max 100)
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
var page = 0;
var pageSize = 100;
var requestUrl = string.Format("/v1/organization/{0}/payments?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; }
}
}
Get all payments that have succeeded
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA | path | |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | Success | query | Only include payments with the specified status (Success, Failed, or Processing) |
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments" } } }
<?php
/*
Example 6
Get all payments that have succeeded
*/
$organizationKey = 'MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA';
$status = 'Success';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/payments?status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";
$curl = curl_init($url);
$curlHeaderData = [
"Accept: application/hal+json",
"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
$message = "$httpCode Error";
if ($jsonResponse['message']) {
$message = "$message: " . $jsonResponse['message'];
}
throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* Example 6
* Get all payments that have succeeded
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
String status = "Success";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/payments?status=" + status + "&page=" + page + "&pageSize=" + pageSize;
HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
if (httpConnection.getResponseCode() >= 400) {
System.out.println(httpConnection.getResponseCode() +
" Error: " + httpConnection.getResponseMessage());
}
InputStream inputStream = httpConnection.getInputStream();
// Store the JSON response as a Java object
Response response = getJsonResponse(inputStream);
inputStream.close();
// Store the link to the next page in a variable
URL nextLink = response._links.next.href;
httpConnection.disconnect();
}
class Response {
public int page { get; set; }
public int pageSize { get; set; }
public int total { get; set; }
public int totalPages { get; set; }
public Response[] items { get; set; }
// The JSON properties you require should be added here as fields
public _links _links = new _links();
}
class _links {
public Link self;
public Link next;
public Link prev;
public Link first;
public Link last;
}
class Link {
public URL href;
}
private static Response getJsonResponse(InputStream inputStream) throws IOException {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
String jsonString = "";
while (streamReader.ready()) {
jsonString += streamReader.readLine();
}
return (new Gson()).fromJson(jsonString, Response.class);
}
private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
String oAuthToken="TOKEN";
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("Accept", "application/hal+json");
httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
return httpConnection;
}
}
# Example 6
# Get all payments that have succeeded
set oAuthToken=%1
set organizationKey="MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA"
set status="Success"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/payments?status=%status%&page=%page%&pageSize=%pageSize%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example6
{
/// <summary>
/// Example 6
/// </summary>
/// <remarks>
/// Get all payments that have succeeded
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
var status = "Success";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/payments?status={1}&page={2}&pageSize={3}", organizationKey,
status, page, pageSize);
client.BaseAddress = new Uri("https://api.pushpay.com");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);
var httpResponse = await client.GetAsync(requestUrl);
if (httpResponse.IsSuccessStatusCode) {
var content = await httpResponse.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<Response>(
content, new JsonSerializerSettings {
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var nextLink = response.Links.Next;
Console.WriteLine(nextLink);
return response;
} else {
var message = httpResponse.StatusCode + " Error";
throw new Exception(message);
}
}
}
}
public class Response
{
public int Page { get; set; }
public int PageSize { get; set; }
public int Total { get; set; }
public int TotalPages { get; set; }
public Response[] Items { get; set; }
[JsonProperty(PropertyName = "_links")]
public Links Links { get; set; }
// The JSON properties you require should be added here as properties
}
public class Links
{
public Link Self { get; set; }
public Link Next { get; set; }
public Link Prev { get; set; }
public Link First { get; set; }
public Link Last { get; set; }
}
public class Link {
public Uri Href { get; set; }
}
}
Get all payments of a particular type
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA | path | |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | ACH | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments" } } }
<?php
/*
Example 7
Get all payments of a particular type
*/
$organizationKey = 'MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA';
$type = 'ACH';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/payments?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 7
* Get all payments of a particular type
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
String type = "ACH";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/payments?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 7
# Get all payments of a particular type
set oAuthToken=%1
set organizationKey="MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA"
set type="ACH"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/payments?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 Example7
{
/// <summary>
/// Example 7
/// </summary>
/// <remarks>
/// Get all payments of a particular type
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
var type = "ACH";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/payments?type={1}&page={2}&pageSize={3}", organizationKey,
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; }
}
}
Get payments with settlement data included
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA | path | |
from | query | Only include payments after a date/time (UTC) |
|
to | query | Only include payments before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
orderby | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
type | query | Only include payments made with the specified type of payment method (ACH, CreditCard, DepositedCheck, or NzBankAccount). If payment type is not explicitly set then all payments except for non cash gifts will be returned. To get all types of payments use All value. |
|
status | query | Only include payments with the specified status (Success, Failed, or Processing) |
|
source | query | Only include payment sources of (Mobile, Web, Recurring, Kiosk, VirtualTerminal, TextGiving, CheckDeposit, TransactionImport or BatchEntry). If payment source is not explicitly set then all payments except for TransactionImport payments will be returned. |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "status": "Success", "settlement": { "key": "MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0", "name": "Settlement #1000", "estimatedDepositDate": "2014-08-21T07:00:00Z" }, "transactionId": "69", "paymentToken": "HgHeIQ-Ui0yJPHtavtS2uQ", "amount": { "amount": "50.00", "currency": "USD", "details": { "base": "50.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+15555555555", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1", "value": "For last week", "label": "Message" }, { "key": "2", "value": "123", "label": "Campus" } ], "createdOn": "2014-08-21T10:45:00Z", "updatedOn": "2014-08-21T10:46:00Z", "paymentMethodType": "CreditCard", "source": "MobileApp", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Eastbrook Campus", "key": "MTY0NTgwOlk4ZnY4ZDUzWE1mOGt2RGxXTEM4MzdaTUUxTQ" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payment/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "settlement": { "href": "https://api.pushpay.com/v1/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/payments" }, "merchantviewpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "donorviewpayment": { "href": "https://pushpay.com/pushpay/transaction/HgHeIQ-Ui0yJPHtavtS2uQ" }, "merchantviewsettlement": { "href": "https://pushpay.com/pushpay/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/settlement/MTAwMDotM0FlZC1qR0ZLWld0WF9yNWhjVFVNam9oOE0" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/organization/MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA/payments" } } }
<?php
/*
Example 8
Get payments with settlement data included
*/
$organizationKey = 'MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/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 8
* Get payments with settlement data included
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/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 8
# Get payments with settlement data included
set oAuthToken=%1
set organizationKey="MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/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 Example8
{
/// <summary>
/// Example 8
/// </summary>
/// <remarks>
/// Get payments with settlement data included
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTkxOndYQWtNOFBfbjltR2VZWXdFbk54U05pR2o5MA";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/payments?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; }
}
}
Retrieves all recurring payment records associated with an organization
Name | Type | Description |
---|---|---|
organizationKey | string |
Name | Type | Description |
---|---|---|
updatedFrom | string | Only include payments changed after a date/time (UTC) |
updatedTo | string | Only include payments changed before a date/time (UTC) |
createdFrom | string | Only include payments after a date/time (UTC) |
createdTo | string | Only include payments before a date/time (UTC) |
status | array | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | string | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
page | integer | The page parameter (Note: page numbering starts at 0) |
pageSize | integer | The page size parameter (Note: default page size is 25) |
Scope | Description |
---|---|
merchant:view_recurring_payments | View/search recurring payments for in-scope merchants |
Retrieve all recurring payments associated with a recipient, with a default status of active
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 1
Retrieve all recurring payments associated with a recipient, with a default status of active
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?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 all recurring payments associated with a recipient, with a default status of active
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?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 all recurring payments associated with a recipient, with a default status of active
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?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 all recurring payments associated with a recipient, with a default status of active
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?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 all recurring payments associated with a recipient, with the specified status
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | Paused | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Paused", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 2
Retrieve all recurring payments associated with a recipient, with the specified status
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$status = $page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";
$curl = curl_init($url);
$curlHeaderData = [
"Accept: application/hal+json",
"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
$message = "$httpCode Error";
if ($jsonResponse['message']) {
$message = "$message: " . $jsonResponse['message'];
}
throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* Example 2
* Retrieve all recurring payments associated with a recipient, with the specified status
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?status=" + status + "&page=" + page + "&pageSize=" + pageSize;
HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
if (httpConnection.getResponseCode() >= 400) {
System.out.println(httpConnection.getResponseCode() +
" Error: " + httpConnection.getResponseMessage());
}
InputStream inputStream = httpConnection.getInputStream();
// Store the JSON response as a Java object
Response response = getJsonResponse(inputStream);
inputStream.close();
// Store the link to the next page in a variable
URL nextLink = response._links.next.href;
httpConnection.disconnect();
}
class Response {
public int page { get; set; }
public int pageSize { get; set; }
public int total { get; set; }
public int totalPages { get; set; }
public Response[] items { get; set; }
// The JSON properties you require should be added here as fields
public _links _links = new _links();
}
class _links {
public Link self;
public Link next;
public Link prev;
public Link first;
public Link last;
}
class Link {
public URL href;
}
private static Response getJsonResponse(InputStream inputStream) throws IOException {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
String jsonString = "";
while (streamReader.ready()) {
jsonString += streamReader.readLine();
}
return (new Gson()).fromJson(jsonString, Response.class);
}
private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
String oAuthToken="TOKEN";
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("Accept", "application/hal+json");
httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
return httpConnection;
}
}
# Example 2
# Retrieve all recurring payments associated with a recipient, with the specified status
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set status=Paused
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?status=%status%&page=%page%&pageSize=%pageSize%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example2
{
/// <summary>
/// Example 2
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, with the specified status
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var status = "Paused";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?status={1}&page={2}&pageSize={3}", organizationKey,
status, page, pageSize);
client.BaseAddress = new Uri("https://api.pushpay.com");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);
var httpResponse = await client.GetAsync(requestUrl);
if (httpResponse.IsSuccessStatusCode) {
var content = await httpResponse.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<Response>(
content, new JsonSerializerSettings {
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var nextLink = response.Links.Next;
Console.WriteLine(nextLink);
return response;
} else {
var message = httpResponse.StatusCode + " Error";
throw new Exception(message);
}
}
}
}
public class Response
{
public int Page { get; set; }
public int PageSize { get; set; }
public int Total { get; set; }
public int TotalPages { get; set; }
public Response[] Items { get; set; }
[JsonProperty(PropertyName = "_links")]
public Links Links { get; set; }
// The JSON properties you require should be added here as properties
}
public class Links
{
public Link Self { get; set; }
public Link Next { get; set; }
public Link Prev { get; set; }
public Link First { get; set; }
public Link Last { get; set; }
}
public class Link {
public Uri Href { get; set; }
}
}
Retrieve all recurring payments associated with a recipient, with any of the specified statues
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | Paused | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
status | Cancelled | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Paused", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 3
Retrieve all recurring payments associated with a recipient, with any of the specified statues
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$status = $status = $page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?status=$status&status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";
$curl = curl_init($url);
$curlHeaderData = [
"Accept: application/hal+json",
"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
$message = "$httpCode Error";
if ($jsonResponse['message']) {
$message = "$message: " . $jsonResponse['message'];
}
throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* Example 3
* Retrieve all recurring payments associated with a recipient, with any of the specified statues
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?status=" + status + "&status=" + status + "&page=" + page + "&pageSize=" + pageSize;
HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
if (httpConnection.getResponseCode() >= 400) {
System.out.println(httpConnection.getResponseCode() +
" Error: " + httpConnection.getResponseMessage());
}
InputStream inputStream = httpConnection.getInputStream();
// Store the JSON response as a Java object
Response response = getJsonResponse(inputStream);
inputStream.close();
// Store the link to the next page in a variable
URL nextLink = response._links.next.href;
httpConnection.disconnect();
}
class Response {
public int page { get; set; }
public int pageSize { get; set; }
public int total { get; set; }
public int totalPages { get; set; }
public Response[] items { get; set; }
// The JSON properties you require should be added here as fields
public _links _links = new _links();
}
class _links {
public Link self;
public Link next;
public Link prev;
public Link first;
public Link last;
}
class Link {
public URL href;
}
private static Response getJsonResponse(InputStream inputStream) throws IOException {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
String jsonString = "";
while (streamReader.ready()) {
jsonString += streamReader.readLine();
}
return (new Gson()).fromJson(jsonString, Response.class);
}
private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
String oAuthToken="TOKEN";
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("Accept", "application/hal+json");
httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
return httpConnection;
}
}
# Example 3
# Retrieve all recurring payments associated with a recipient, with any of the specified statues
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set status=Paused
set status=Cancelled
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?status=%status%&status=%status%&page=%page%&pageSize=%pageSize%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example3
{
/// <summary>
/// Example 3
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, with any of the specified statues
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var status = "Paused";
var status = "Cancelled";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?status={1}&status={2}&page={3}&pageSize={4}", organizationKey,
status, status, page, pageSize);
client.BaseAddress = new Uri("https://api.pushpay.com");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);
var httpResponse = await client.GetAsync(requestUrl);
if (httpResponse.IsSuccessStatusCode) {
var content = await httpResponse.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<Response>(
content, new JsonSerializerSettings {
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var nextLink = response.Links.Next;
Console.WriteLine(nextLink);
return response;
} else {
var message = httpResponse.StatusCode + " Error";
throw new Exception(message);
}
}
}
}
public class Response
{
public int Page { get; set; }
public int PageSize { get; set; }
public int Total { get; set; }
public int TotalPages { get; set; }
public Response[] Items { get; set; }
[JsonProperty(PropertyName = "_links")]
public Links Links { get; set; }
// The JSON properties you require should be added here as properties
}
public class Links
{
public Link Self { get; set; }
public Link Next { get; set; }
public Link Prev { get; set; }
public Link First { get; set; }
public Link Last { get; set; }
}
public class Link {
public Uri Href { get; set; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by creation date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | createdOn ASC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 4
Retrieve all recurring payments associated with a recipient, ordered by creation date
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'createdOn ASC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?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 4
* Retrieve all recurring payments associated with a recipient, ordered by creation date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "createdOn ASC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?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 4
# Retrieve all recurring payments associated with a recipient, ordered by creation date
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="createdOn ASC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?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 Example4
{
/// <summary>
/// Example 4
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by creation date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "createdOn ASC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by update date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | updatedOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 5
Retrieve all recurring payments associated with a recipient, ordered by update date
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'updatedOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?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 5
* Retrieve all recurring payments associated with a recipient, ordered by update date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "updatedOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?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 5
# Retrieve all recurring payments associated with a recipient, ordered by update date
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="updatedOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?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 Example5
{
/// <summary>
/// Example 5
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by update date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "updatedOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by start date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | startDate ASC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 6
Retrieve all recurring payments associated with a recipient, ordered by start date
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'startDate ASC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?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 6
* Retrieve all recurring payments associated with a recipient, ordered by start date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "startDate ASC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?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 6
# Retrieve all recurring payments associated with a recipient, ordered by start date
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="startDate ASC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?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 Example6
{
/// <summary>
/// Example 6
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by start date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "startDate ASC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by next payment date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | nextPaymentDate ASC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 7
Retrieve all recurring payments associated with a recipient, ordered by next payment date
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'nextPaymentDate ASC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?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 7
* Retrieve all recurring payments associated with a recipient, ordered by next payment date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "nextPaymentDate ASC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?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 7
# Retrieve all recurring payments associated with a recipient, ordered by next payment date
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="nextPaymentDate ASC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?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 Example7
{
/// <summary>
/// Example 7
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by next payment date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "nextPaymentDate ASC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | updatedOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 8
Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$orderBy = 'updatedOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?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 8
* Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String orderBy = "updatedOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?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 8
# Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set orderBy="updatedOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?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 Example8
{
/// <summary>
/// Example 8
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a recipient, ordered by when they were last updated
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var orderBy = "updatedOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?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; }
}
}
Retrieve all recurring payments created within a date range
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | 2015-01-01T00:00:00Z | query | Only include payments after a date/time (UTC) |
createdTo | 2015-02-01T00:00:00Z | query | Only include payments before a date/time (UTC) |
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | createdOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 9
Retrieve all recurring payments created within a date range
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$createdFrom = date_format(new DateTime('2015-01-01T00:00:00Z'), DATE_ISO8601);
$createdTo = date_format(new DateTime('2015-02-01T00:00:00Z'), DATE_ISO8601);
$orderBy = 'createdOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?createdFrom=$createdFrom&createdTo=$createdTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 9
* Retrieve all recurring payments created within a date range
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String createdFrom = dateFormatter.format(dateFormatter.parse("2015-01-01T00:00:00Z"));
String createdTo = dateFormatter.format(dateFormatter.parse("2015-02-01T00:00:00Z"));
String orderBy = "createdOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?createdFrom=" + createdFrom + "&createdTo=" + createdTo + "&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 9
# Retrieve all recurring payments created within a date range
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set createdFrom="2015-01-01T00:00:00Z"
set createdTo="2015-02-01T00:00:00Z"
set orderBy="createdOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?createdFrom=%createdFrom%&createdTo=%createdTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example9
{
/// <summary>
/// Example 9
/// </summary>
/// <remarks>
/// Retrieve all recurring payments created within a date range
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var createdFrom = InstantPattern.ExtendedIso.Parse("2015-01-01T00:00:00Z").Value.ToString();
var createdTo = InstantPattern.ExtendedIso.Parse("2015-02-01T00:00:00Z").Value.ToString();
var orderBy = "createdOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?createdFrom={1}&createdTo={2}&orderBy={3}&page={4}&pageSize={5}", organizationKey,
createdFrom, createdTo, 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; }
}
}
Retrieve all recurring payments updated within a date range
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | 2015-06-01T00:00:00Z | query | Only include payments changed after a date/time (UTC) |
updatedTo | 2015-06-15T00:00:00Z | query | Only include payments changed before a date/time (UTC) |
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | updatedOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 10
Retrieve all recurring payments updated within a date range
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$updatedFrom = date_format(new DateTime('2015-06-01T00:00:00Z'), DATE_ISO8601);
$updatedTo = date_format(new DateTime('2015-06-15T00:00:00Z'), DATE_ISO8601);
$orderBy = 'updatedOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?updatedFrom=$updatedFrom&updatedTo=$updatedTo&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.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Example 10
* Retrieve all recurring payments updated within a date range
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException, ParseException {
// Dates must be in ISO 8601 format
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
String updatedFrom = dateFormatter.format(dateFormatter.parse("2015-06-01T00:00:00Z"));
String updatedTo = dateFormatter.format(dateFormatter.parse("2015-06-15T00:00:00Z"));
String orderBy = "updatedOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?updatedFrom=" + updatedFrom + "&updatedTo=" + updatedTo + "&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 10
# Retrieve all recurring payments updated within a date range
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set updatedFrom="2015-06-01T00:00:00Z"
set updatedTo="2015-06-15T00:00:00Z"
set orderBy="updatedOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?updatedFrom=%updatedFrom%&updatedTo=%updatedTo%&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;
using NodaTime.Text;
namespace Examples
{
public class Example10
{
/// <summary>
/// Example 10
/// </summary>
/// <remarks>
/// Retrieve all recurring payments updated within a date range
/// Uses the Noda Time package to parse ISO8601 dates.
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var updatedFrom = InstantPattern.ExtendedIso.Parse("2015-06-01T00:00:00Z").Value.ToString();
var updatedTo = InstantPattern.ExtendedIso.Parse("2015-06-15T00:00:00Z").Value.ToString();
var orderBy = "updatedOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?updatedFrom={1}&updatedTo={2}&orderBy={3}&page={4}&pageSize={5}", organizationKey,
updatedFrom, updatedTo, 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; }
}
}
Retrieve all recurring payments with a specified pagesize (max 100)
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
organizationKey | MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M | path | |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
page | 0 | query | The page parameter (Note: page numbering starts at 0) |
pageSize | 100 | query | The page size parameter (Note: default page size is 25) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "organizationKey": "organizationKey", "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 11
Retrieve all recurring payments with a specified pagesize (max 100)
*/
$organizationKey = 'MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M';
$page = 0;
$pageSize = 100;
$url = "https://api.pushpay.com/v1/organization/$organizationKey/recurringpayments?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 11
* Retrieve all recurring payments with a specified pagesize (max 100)
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
int page = 0;
int pageSize = 100;
String urlString = "https://api.pushpay.com/v1/organization/" + organizationKey + "/recurringpayments?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 11
# Retrieve all recurring payments with a specified pagesize (max 100)
set oAuthToken=%1
set organizationKey="MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M"
set page=0
set pageSize=100
set url="https://api.pushpay.com/v1/organization/%organizationKey%/recurringpayments?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 Example11
{
/// <summary>
/// Example 11
/// </summary>
/// <remarks>
/// Retrieve all recurring payments with a specified pagesize (max 100)
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var organizationKey = "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M";
var page = 0;
var pageSize = 100;
var requestUrl = string.Format("/v1/organization/{0}/recurringpayments?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; }
}
}
This operation requires that the OAuth2 bearer token include a 'sub' (subject) claim.
Name | Type | Description |
---|---|---|
key | integer | The unique index of the payment method (Note: payment method indexes are only unique per pushpayer) |
Scope | Description |
---|---|
read | Read-only access to resources owned by the subject claim of the token |
Get single payment method of the current user identified by its payment method key
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
key | 1 | path | The unique index of the payment method (Note: payment method indexes are only unique per pushpayer) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "key": 1, "nickname": "Family Visa", "type": 1, "reference": "●●●● ●●●● ●●●● 6543", "isPreferred": true, "icon": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png", "_links": { "self": { "href": "https://api.pushpay.com/v1/paymentmethod/1" } } }
<?php
/*
Example 1
Get single payment method of the current user identified by its payment method key
*/
$key = 1;
$url = "https://api.pushpay.com/v1/paymentmethod/$key";
$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
* Get single payment method of the current user identified by its payment method key
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
int key = 1;
String urlString = "https://api.pushpay.com/v1/paymentmethod/" + key;
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
# Get single payment method of the current user identified by its payment method key
set oAuthToken=%1
set key=1
set url="https://api.pushpay.com/v1/paymentmethod/%key%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example1
{
/// <summary>
/// Example 1
/// </summary>
/// <remarks>
/// Get single payment method of the current user identified by its payment method key
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var key = 1;
var requestUrl = string.Format("/v1/paymentmethod/{0}", key);
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; }
}
}
This operation requires that the OAuth2 bearer token include a 'sub' (subject) claim.
Scope | Description |
---|---|
read | Read-only access to resources owned by the subject claim of the token |
Get payment methods for current user
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "items": [ { "key": 1, "nickname": "Family Visa", "type": 1, "reference": "●●●● ●●●● ●●●● 6543", "isPreferred": true, "icon": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png", "_links": { "self": { "href": "https://api.pushpay.com/v1/paymentmethod/1" } } }, { "key": 2, "nickname": "Work Mastercard", "type": 1, "reference": "●●●● ●●●● ●●●● 1234", "icon": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/mastercard.png", "_links": { "self": { "href": "https://api.pushpay.com/v1/paymentmethod/2" } } } ], "_links": { "self": { "href": "https://api.pushpay.com/v1/paymentmethods" } } }
<?php
/*
Example 1
Get payment methods for current user
*/
$url = "https://api.pushpay.com/v1/paymentmethods";
$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
* Get payment methods for current user
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String urlString = "https://api.pushpay.com/v1/paymentmethods";
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
# Get payment methods for current user
set oAuthToken=%1
set url="https://api.pushpay.com/v1/paymentmethods"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example1
{
/// <summary>
/// Example 1
/// </summary>
/// <remarks>
/// Get payment methods for current user
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var requestUrl = "/v1/paymentmethods";
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; }
}
}
Retrieves all recurring payment records associated with a payer
Name | Type | Description |
---|---|---|
memberKey | string | The unique key of the community member - a case-sensitive series of characters |
Name | Type | Description |
---|---|---|
updatedFrom | string | Only include payments changed after a date/time (UTC) |
updatedTo | string | Only include payments changed before a date/time (UTC) |
createdFrom | string | Only include payments after a date/time (UTC) |
createdTo | string | Only include payments before a date/time (UTC) |
status | array | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | string | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
page | integer | The page parameter (Note: page numbering starts at 0) |
pageSize | integer | The page size parameter (Note: default page size is 25) |
Scope | Description |
---|---|
merchant:view_recurring_payments | View/search recurring payments for in-scope merchants |
read | Read-only access to resources owned by the subject claim of the token |
Retrieve all recurring payments associated with a payer, with a default status of active
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
memberKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the community member - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 1
Retrieve all recurring payments associated with a payer, with a default status of active
*/
$memberKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/person/$memberKey/recurringpayments?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 all recurring payments associated with a payer, with a default status of active
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/person/" + memberKey + "/recurringpayments?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 all recurring payments associated with a payer, with a default status of active
set oAuthToken=%1
set memberKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/person/%memberKey%/recurringpayments?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 all recurring payments associated with a payer, with a default status of active
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/person/{0}/recurringpayments?page={1}&pageSize={2}", memberKey,
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 all recurring payments associated with a payer, with the specified status
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
memberKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the community member - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | Paused | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Paused", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 2
Retrieve all recurring payments associated with a payer, with the specified status
*/
$memberKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$status = $page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/person/$memberKey/recurringpayments?status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";
$curl = curl_init($url);
$curlHeaderData = [
"Accept: application/hal+json",
"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
$message = "$httpCode Error";
if ($jsonResponse['message']) {
$message = "$message: " . $jsonResponse['message'];
}
throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* Example 2
* Retrieve all recurring payments associated with a payer, with the specified status
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/person/" + memberKey + "/recurringpayments?status=" + status + "&page=" + page + "&pageSize=" + pageSize;
HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
if (httpConnection.getResponseCode() >= 400) {
System.out.println(httpConnection.getResponseCode() +
" Error: " + httpConnection.getResponseMessage());
}
InputStream inputStream = httpConnection.getInputStream();
// Store the JSON response as a Java object
Response response = getJsonResponse(inputStream);
inputStream.close();
// Store the link to the next page in a variable
URL nextLink = response._links.next.href;
httpConnection.disconnect();
}
class Response {
public int page { get; set; }
public int pageSize { get; set; }
public int total { get; set; }
public int totalPages { get; set; }
public Response[] items { get; set; }
// The JSON properties you require should be added here as fields
public _links _links = new _links();
}
class _links {
public Link self;
public Link next;
public Link prev;
public Link first;
public Link last;
}
class Link {
public URL href;
}
private static Response getJsonResponse(InputStream inputStream) throws IOException {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
String jsonString = "";
while (streamReader.ready()) {
jsonString += streamReader.readLine();
}
return (new Gson()).fromJson(jsonString, Response.class);
}
private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
String oAuthToken="TOKEN";
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("Accept", "application/hal+json");
httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
return httpConnection;
}
}
# Example 2
# Retrieve all recurring payments associated with a payer, with the specified status
set oAuthToken=%1
set memberKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set status=Paused
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/person/%memberKey%/recurringpayments?status=%status%&page=%page%&pageSize=%pageSize%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example2
{
/// <summary>
/// Example 2
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a payer, with the specified status
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var status = "Paused";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/person/{0}/recurringpayments?status={1}&page={2}&pageSize={3}", memberKey,
status, page, pageSize);
client.BaseAddress = new Uri("https://api.pushpay.com");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);
var httpResponse = await client.GetAsync(requestUrl);
if (httpResponse.IsSuccessStatusCode) {
var content = await httpResponse.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<Response>(
content, new JsonSerializerSettings {
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var nextLink = response.Links.Next;
Console.WriteLine(nextLink);
return response;
} else {
var message = httpResponse.StatusCode + " Error";
throw new Exception(message);
}
}
}
}
public class Response
{
public int Page { get; set; }
public int PageSize { get; set; }
public int Total { get; set; }
public int TotalPages { get; set; }
public Response[] Items { get; set; }
[JsonProperty(PropertyName = "_links")]
public Links Links { get; set; }
// The JSON properties you require should be added here as properties
}
public class Links
{
public Link Self { get; set; }
public Link Next { get; set; }
public Link Prev { get; set; }
public Link First { get; set; }
public Link Last { get; set; }
}
public class Link {
public Uri Href { get; set; }
}
}
Retrieve all recurring payments associated with a payer, with any of the specified statues
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
memberKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the community member - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | Paused | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
status | Cancelled | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
orderBy | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
|
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Paused", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 3
Retrieve all recurring payments associated with a payer, with any of the specified statues
*/
$memberKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$status = $status = $page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/person/$memberKey/recurringpayments?status=$status&status=$status&page=$page&pageSize=$pageSize";
$oAuthToken = "OAuth TOKEN GOES HERE";
$curl = curl_init($url);
$curlHeaderData = [
"Accept: application/hal+json",
"Authorization: Bearer $oAuthToken"
];
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaderData);
$jsonResponse = json_decode(curl_exec($curl), true);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) {
$message = "$httpCode Error";
if ($jsonResponse['message']) {
$message = "$message: " . $jsonResponse['message'];
}
throw new Exception($message);
}
// If there is a next page, store the link to it in a variable
if (array_key_exists('next', $jsonResponse['_links'])) {
$nextLink = $jsonResponse['_links']['next']['href'];
}
curl_close($curl);
import com.google.gson.Gson;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* Example 3
* Retrieve all recurring payments associated with a payer, with any of the specified statues
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/person/" + memberKey + "/recurringpayments?status=" + status + "&status=" + status + "&page=" + page + "&pageSize=" + pageSize;
HttpURLConnection httpConnection = setUpHttpConnection(new URL(urlString));
if (httpConnection.getResponseCode() >= 400) {
System.out.println(httpConnection.getResponseCode() +
" Error: " + httpConnection.getResponseMessage());
}
InputStream inputStream = httpConnection.getInputStream();
// Store the JSON response as a Java object
Response response = getJsonResponse(inputStream);
inputStream.close();
// Store the link to the next page in a variable
URL nextLink = response._links.next.href;
httpConnection.disconnect();
}
class Response {
public int page { get; set; }
public int pageSize { get; set; }
public int total { get; set; }
public int totalPages { get; set; }
public Response[] items { get; set; }
// The JSON properties you require should be added here as fields
public _links _links = new _links();
}
class _links {
public Link self;
public Link next;
public Link prev;
public Link first;
public Link last;
}
class Link {
public URL href;
}
private static Response getJsonResponse(InputStream inputStream) throws IOException {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream));
String jsonString = "";
while (streamReader.ready()) {
jsonString += streamReader.readLine();
}
return (new Gson()).fromJson(jsonString, Response.class);
}
private static HttpURLConnection setUpHttpConnection(URL url) throws IOException {
String oAuthToken="TOKEN";
HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("Accept", "application/hal+json");
httpConnection.setRequestProperty("Authorization", "Bearer " + oAuthToken);
return httpConnection;
}
}
# Example 3
# Retrieve all recurring payments associated with a payer, with any of the specified statues
set oAuthToken=%1
set memberKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set status=Paused
set status=Cancelled
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/person/%memberKey%/recurringpayments?status=%status%&status=%status%&page=%page%&pageSize=%pageSize%"
curl -i -H "Accept: application/hal+json" -H "Authorization: Bearer %oAuthToken%" %url%
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Examples
{
public class Example3
{
/// <summary>
/// Example 3
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a payer, with any of the specified statues
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var status = "Paused";
var status = "Cancelled";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/person/{0}/recurringpayments?status={1}&status={2}&page={3}&pageSize={4}", memberKey,
status, status, page, pageSize);
client.BaseAddress = new Uri("https://api.pushpay.com");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oAuthToken);
var httpResponse = await client.GetAsync(requestUrl);
if (httpResponse.IsSuccessStatusCode) {
var content = await httpResponse.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<Response>(
content, new JsonSerializerSettings {
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var nextLink = response.Links.Next;
Console.WriteLine(nextLink);
return response;
} else {
var message = httpResponse.StatusCode + " Error";
throw new Exception(message);
}
}
}
}
public class Response
{
public int Page { get; set; }
public int PageSize { get; set; }
public int Total { get; set; }
public int TotalPages { get; set; }
public Response[] Items { get; set; }
[JsonProperty(PropertyName = "_links")]
public Links Links { get; set; }
// The JSON properties you require should be added here as properties
}
public class Links
{
public Link Self { get; set; }
public Link Next { get; set; }
public Link Prev { get; set; }
public Link First { get; set; }
public Link Last { get; set; }
}
public class Link {
public Uri Href { get; set; }
}
}
Retrieve all recurring payments associated with a payer, ordered by creation date
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
memberKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the community member - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | createdOn ASC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 4
Retrieve all recurring payments associated with a payer, ordered by creation date
*/
$memberKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$orderBy = 'createdOn ASC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/person/$memberKey/recurringpayments?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 4
* Retrieve all recurring payments associated with a payer, ordered by creation date
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
String orderBy = "createdOn ASC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/person/" + memberKey + "/recurringpayments?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 4
# Retrieve all recurring payments associated with a payer, ordered by creation date
set oAuthToken=%1
set memberKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set orderBy="createdOn ASC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/person/%memberKey%/recurringpayments?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 Example4
{
/// <summary>
/// Example 4
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a payer, ordered by creation date
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var orderBy = "createdOn ASC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/person/{0}/recurringpayments?orderBy={1}&page={2}&pageSize={3}", memberKey,
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; }
}
}
Retrieve all recurring payments associated with a payer, ordered by when they were last updated
Name | Value | Description |
---|---|---|
Accept | application/hal+json | |
Authorization | Bearer XXXXXXXXX | The bearer token being used to authenticate this request |
Name | Value | Type | Description |
---|---|---|---|
memberKey | MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0 | path | The unique key of the community member - a case-sensitive series of characters |
updatedFrom | query | Only include payments changed after a date/time (UTC) |
|
updatedTo | query | Only include payments changed before a date/time (UTC) |
|
createdFrom | query | Only include payments after a date/time (UTC) |
|
createdTo | query | Only include payments before a date/time (UTC) |
|
status | query | Filter recurring payments by status, acceptable values are any combination of (Active, Cancelled, Paused) |
|
orderBy | updatedOn DESC | query | Order data by a particular property in ascending or descending order. Uses format 'PropertyName ASC' or 'PropertyName DESC' |
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) |
Status 200 (OK)
Name | Value | Description |
---|---|---|
Content-Type | application/hal+json; charset=utf-8 |
Response
{ "page": 0, "pageSize": 25, "total": 1, "totalPages": 1, "items": [ { "schedule": { "frequency": "Monthly", "startDate": "2015-06-22T00:00:00-08:00", "endType": "Never", "nextPaymentDate": "2015-07-22T00:00:00Z" }, "status": "Active", "paymentToken": "BQM1lWLcM0uKc1y4a8RHUw", "amount": { "amount": "10.00", "currency": "USD", "details": { "base": "10.00" } }, "payer": { "key": "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0", "emailAddress": "joe.bloggs@test.com", "emailAddressVerified": true, "mobileNumber": "+6421555666", "mobileNumberVerified": true, "fullName": "Joe Bloggs", "firstName": "Joe", "lastName": "Bloggs", "address": { "country": "NZ" }, "updatedOn": "0001-01-01T00:00:00Z", "role": "individual", "payerType": "Registered", "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/community/MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0" } } }, "communityMember": { "key": "bc21b3c4e4303167ec70143c8ca1ddd6" }, "recipient": { "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M", "name": "Widgets inc.", "role": "merchant" }, "fields": [ { "key": "1235", "value": "Smooth processes", "label": "Smoothly Labeled" }, { "key": "1234", "value": "Interesting things", "label": "Interesting Label" } ], "createdOn": "0001-01-01T00:00:00Z", "updatedOn": "0001-01-01T00:00:00Z", "paymentMethodType": "CreditCard", "source": "LoggedInWeb", "card": { "reference": "4111-11....1111", "brand": "VISA", "logo": "https://pushpay.com/Content/PushpayWeb/Images/Interface/@2x/PaymentMethods/visa.png" }, "ipAddress": "69.30.43.180", "fund": { "key": "zzzzAA234zbZ8fgfLcM0uKc1y4a8RHUw", "name": "Tithes & Offerings", "code": "100", "taxDeductible": true }, "campus": { "name": "Widgets inc.", "key": "MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "_links": { "self": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw" }, "merchant": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M" }, "payments": { "href": "https://api.pushpay.com/v1/merchant/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringpayment/BQM1lWLcM0uKc1y4a8RHUw/payments" }, "merchantviewrecurringpayment": { "href": "https://pushpay.com/pushpay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurringtransaction/BQM1lWLcM0uKc1y4a8RHUw" }, "donorviewrecurringpayment": { "href": "https://pushpay.com/pushpay/pay/MTpZc2M4M3hOM05KMmdxOHpDQklvYkxqQWpfY2M/recurring/view/BQM1lWLcM0uKc1y4a8RHUw" } } } ], "_links": { "self": null } }
<?php
/*
Example 5
Retrieve all recurring payments associated with a payer, ordered by when they were last updated
*/
$memberKey = 'MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0';
$orderBy = 'updatedOn DESC';
$page = 0;
$pageSize = 25;
$url = "https://api.pushpay.com/v1/person/$memberKey/recurringpayments?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 5
* Retrieve all recurring payments associated with a payer, ordered by when they were last updated
*
* This example uses the Gson library to parse JSON
*/
public class Example {
public static void main(String[] args) throws IOException {
String memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
String orderBy = "updatedOn DESC";
int page = 0;
int pageSize = 25;
String urlString = "https://api.pushpay.com/v1/person/" + memberKey + "/recurringpayments?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 5
# Retrieve all recurring payments associated with a payer, ordered by when they were last updated
set oAuthToken=%1
set memberKey="MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0"
set orderBy="updatedOn DESC"
set page=0
set pageSize=25
set url="https://api.pushpay.com/v1/person/%memberKey%/recurringpayments?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 Example5
{
/// <summary>
/// Example 5
/// </summary>
/// <remarks>
/// Retrieve all recurring payments associated with a payer, ordered by when they were last updated
/// </remarks>
public async Task<Response> Example(string oAuthToken)
{
using (var client = new HttpClient()) {
var memberKey = "MzpMNU9YSTIwSmt4REN5ZWluUlhSbGNvLV9lUk0";
var orderBy = "updatedOn DESC";
var page = 0;
var pageSize = 25;
var requestUrl = string.Format("/v1/person/{0}/recurringpayments?orderBy={1}&page={2}&pageSize={3}", memberKey,
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; }
}
}