NAV
shell ruby python csharp php

OnlinePayment

The OnlinePayment object

The OnlinePayment object looks like this in JSON:

{
    "object": "online_payment",
    "id": 6,
    "status": "construction",
    "type": "credit_card",
    "link_type": null,
    "link_id": null,
    "person_id": null,
    "contact_organization_id": null,
    "sponsor_id": null,
    "sponsor_type": null,
    "amount": 0,
    "net_amount": null,
    "preset_amount": null,
    "first_name": "Jon",
    "last_name": "Doe",
    "street": "1000 1st Av",
    "city": "Moscow",
    "state": "ID",
    "postal": "10101",
    "country": "US",
    "email": "jon@hotmail.org",
    "phone": "777-888-7777",
    "cc_status": null,
    "cc_last_digits": "1111",
    "cc_bin": null,
    "cc_is_international": false,
    "cc_expiration_month": 2,
    "cc_expiration_year": 2010,
    "cc_transaction_id": "A050B0F28A084EF1B9E445D2792A85B6",
    "cc_approval_code": "17360",
    "cc_processing_fee": null,
    "cc_status_code": "APPROVED",
    "cc_status_msg": "APPROVED",
    "bank_name": null,
    "bank_account_last_four": null,
    "last_settlement_check_at": null,
    "ach_status": null,
    "ach_return_id": null,
    "ach_settled_response": null,
    "ach_return_message": null,
    "ach_transaction_id": null,
    "paypal_order_id": null,
    "paypal_payer_id": null,
    "paypal_authorization_id": null,
    "paypal_status": null,
    "reference_number": null,
    "organization_name": null,
    "payment_gateway_id": null,
    "payment_gateway_processing_fee": null,
    "payment_gateway_transaction_id": null,
    "payment_gateway_trace_id": null,
    "gateway_customer_token": null,
    "gateway_source_token": null,
    "payment_frequency": null,
    "recurring_interval": null,
    "recurring_day": false,
    "recurring_until": null,
    "recurring_max_times": null,
    "recurring_money_transfer_id": null,
    "comment": null,
    "donate_page_id": null,
    "donation_campaign_id": null,
    "donation_appeal_id": null,
    "draft_date_id": null,
    "back_url": null,
    "payment_secret": null,
    "disable_convenience_fee": false,
    "cover_processing_fees": false,
    "added_at": null,
    "added_by_id": null,
    "sandbox": true
}
Attribute Required Data Type
id Yes int
status Yes enum (construction, checkout, payment, processing, complete, error)
type Yes enum (credit_card, ach, paypal, charge_to_account)
link_type No enum (payment, donation, application, bookstore_order, transcript_request, form_response, recurring_money_transfer, populi_client, course_order)
link_id No int
person_id No int
contact_organization_id No int
sponsor_id No int
sponsor_type No enum (person, org)
amount Yes decimal
net_amount No decimal
preset_amount No decimal
first_name No text (75)
last_name No text (75)
street No text (150)
city No text (100)
state No text (50)
postal No text (50)
country No text (50)
email No text (75)
phone No text (50)
cc_status No enum (authorized, captured, error, refunded, initialized, setup_complete, cancelled)
cc_last_digits No char
cc_bin No text (6)
cc_is_international Yes bool
cc_expiration_month No int
cc_expiration_year No int
cc_transaction_id No text (300)
cc_approval_code No text (50)
cc_processing_fee No decimal
cc_status_code No text (50)
cc_status_msg No text (300)
bank_name No text (200)
bank_account_last_four No char
last_settlement_check_at No datetime
ach_status No enum (pending, settled, error, initialized, setup_complete)
ach_return_id No text (200)
ach_settled_response No text (5000)
ach_return_message No text (500)
ach_transaction_id No text (200)
paypal_order_id No text (128)
paypal_payer_id No text (128)
paypal_authorization_id No text (128)
paypal_status No enum (initialized, authorized, captured, error, refunded)
reference_number No text (100)
organization_name No text (100)
payment_gateway_id No int
payment_gateway_processing_fee No decimal
payment_gateway_transaction_id No text (128)
payment_gateway_trace_id No text (128)
gateway_customer_token No text (100)
gateway_source_token No text (100)
payment_frequency No enum (single, plan, interval)
recurring_interval No enum (1_week, 2_week, 4_week, 1_month, 3_month, 12_month)
recurring_day No bool
recurring_until No enum (forever, max_times)
recurring_max_times No int
recurring_money_transfer_id No int
comment No text
donate_page_id No int
donation_campaign_id No int
donation_appeal_id No int
draft_date_id No int
back_url No text (1000)
payment_secret No text (128)
disable_convenience_fee Yes bool
cover_processing_fees Yes bool
added_at No datetime
added_by_id No int
sandbox No bool

index

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/onlinepayments" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
-d '{
    "filter": {"0":{"logic":"ALL","fields":[{"name":"amount","value":{"type":"RANGE","start":"10.5","end":"900.15"},"positive":1}]}}
}' \ 
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/onlinepayments',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/onlinepayments',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/onlinepayments"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/onlinepayments');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "list",
    "count": 0,
    "results": 0,
    "results_per_page": 200,
    "pages": 0,
    "page": 0,
    "offset": 0,
    "has_more": false,
    "data": [],
    "sandbox": true
}

Retrieves all OnlinePayment objects that match given filter conditions.

HTTP Request

GET /onlinepayments

Parameters

Name Required Data Type Description
filter No mixed See available filter conditions
page No int The page of results to return if more than 200 records are found.

Filter Condition Parameters

These conditions can be used to narrow the results returned.

Name Type
created date
link_type choice
type enum
status text
gateway object id
payer_account text
first_name text
last_name text
email text
phone text
processing_fee decimal
convenience_fee decimal
amount decimal

Permissions

One of the following roles is required to call this method:

show

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/onlinepayments/(onlinepayment)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/onlinepayments/(onlinepayment)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/onlinepayments/(onlinepayment)',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/onlinepayments/(onlinepayment)"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/onlinepayments/(onlinepayment)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "online_payment",
    "id": 6,
    "status": "construction",
    "type": "credit_card",
    "link_type": null,
    "link_id": null,
    "person_id": null,
    "contact_organization_id": null,
    "sponsor_id": null,
    "sponsor_type": null,
    "amount": 0,
    "net_amount": null,
    "preset_amount": null,
    "first_name": "Jon",
    "last_name": "Doe",
    "street": "1000 1st Av",
    "city": "Moscow",
    "state": "ID",
    "postal": "10101",
    "country": "US",
    "email": "jon@hotmail.org",
    "phone": "777-888-7777",
    "cc_status": null,
    "cc_last_digits": "1111",
    "cc_bin": null,
    "cc_is_international": false,
    "cc_expiration_month": 2,
    "cc_expiration_year": 2010,
    "cc_transaction_id": "A050B0F28A084EF1B9E445D2792A85B6",
    "cc_approval_code": "17360",
    "cc_processing_fee": null,
    "cc_status_code": "APPROVED",
    "cc_status_msg": "APPROVED",
    "bank_name": null,
    "bank_account_last_four": null,
    "last_settlement_check_at": null,
    "ach_status": null,
    "ach_return_id": null,
    "ach_settled_response": null,
    "ach_return_message": null,
    "ach_transaction_id": null,
    "paypal_order_id": null,
    "paypal_payer_id": null,
    "paypal_authorization_id": null,
    "paypal_status": null,
    "reference_number": null,
    "organization_name": null,
    "payment_gateway_id": null,
    "payment_gateway_processing_fee": null,
    "payment_gateway_transaction_id": null,
    "payment_gateway_trace_id": null,
    "gateway_customer_token": null,
    "gateway_source_token": null,
    "payment_frequency": null,
    "recurring_interval": null,
    "recurring_day": false,
    "recurring_until": null,
    "recurring_max_times": null,
    "recurring_money_transfer_id": null,
    "comment": null,
    "donate_page_id": null,
    "donation_campaign_id": null,
    "donation_appeal_id": null,
    "draft_date_id": null,
    "back_url": null,
    "payment_secret": null,
    "disable_convenience_fee": false,
    "cover_processing_fees": false,
    "added_at": null,
    "added_by_id": null,
    "sandbox": true
}

Retrieves a specific OnlinePayment object.

HTTP Request

GET /onlinepayments/(onlinepayment)

Parameters

No additional parameters are needed beyond the ID of the object being requested that appears in the URL.

Permissions

One of the following roles is required to call this method: