NAV
shell ruby python csharp php

BookstoreItem

The BookstoreItem object

The BookstoreItem object looks like this in JSON:

{
    "object": "bookstore_item",
    "id": 40,
    "type": "item",
    "category_id": 7,
    "name": "Infinity in Most Directions",
    "description": "Revised with extensive footnotes.",
    "status": "available",
    "tax_free": false,
    "isbn": "9781411179988",
    "image_file_id": null,
    "income_account_id": null,
    "can_charge_to_account": false,
    "vendor_id": 10,
    "report_on_1098t": true,
    "course_offering_id": null,
    "discount_type": "none",
    "discount_amount": null,
    "discount_can_combine": false,
    "sandbox": true
}
Attribute Required Data Type
id Yes int
type Yes enum (item, course, bundle)
category_id No int
name Yes text (200)
description Yes text
status Yes enum (available, not_available)
tax_free Yes bool
isbn No text (20)
image_file_id No int
income_account_id No int
can_charge_to_account Yes bool
vendor_id No int
report_on_1098t Yes bool
course_offering_id No int
discount_type Yes enum (none, percent, fixed_price)
discount_amount No decimal
discount_can_combine Yes bool
sandbox No bool

index

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/items" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
-d '{
    "filter": {"0":{"logic":"ALL","fields":[{"name":"status","value":"BLAH","positive":1}]}}
}' \ 
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/items',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/items',
 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/items"), 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/items');
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": 2,
    "results": 2,
    "results_per_page": 200,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "bookstore_item",
            "id": 40,
            "type": "item",
            "category_id": 7,
            "name": "Infinity in Most Directions",
            "description": "Revised with extensive footnotes.",
            "status": "available",
            "tax_free": false,
            "isbn": "9781411179988",
            "image_file_id": null,
            "income_account_id": null,
            "can_charge_to_account": false,
            "vendor_id": 10,
            "report_on_1098t": true,
            "course_offering_id": null,
            "discount_type": "none",
            "discount_amount": null,
            "discount_can_combine": false,
            "report_data": {
                "price": "12.00",
                "retail_price": "0",
                "max_price": "12.00",
                "min_list_price": "12.00",
                "max_list_price": "12.00",
                "has_variations_on_sale": 0,
                "num_variations": 1,
                "total_sold": "31",
                "quantity_available": "50",
                "category_name": null,
                "item_status": "available",
                "vendor_name": null,
                "course_abbrv": null,
                "course_offering_catalog_course_id": null,
                "course_name": null,
                "start_date": null,
                "end_date": null,
                "campus_name": null,
                "term_display_name": null,
                "add_drop_time": null,
                "add_drop_time_local": null
            }
        }
    ],
    "sandbox": true
}

Retrieves all BookstoreItem objects that match given filter conditions.

HTTP Request

GET /items

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.

Expandable Properties

Filter Condition Parameters

These conditions can be used to narrow the results returned.

Name Type
search text
category itemcategory
status choice
tax_free bool
inventory integer
isbn text
total_sold integer
min_price decimal
max_price decimal
report_on_1098t bool

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/items/(bookstoreitem)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/items/(bookstoreitem)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/items/(bookstoreitem)',
 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/items/(bookstoreitem)"), 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/items/(bookstoreitem)');
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": "bookstore_item",
    "id": 40,
    "type": "item",
    "category_id": 7,
    "name": "Infinity in Most Directions",
    "description": "Revised with extensive footnotes.",
    "status": "available",
    "tax_free": false,
    "isbn": "9781411179988",
    "image_file_id": null,
    "income_account_id": null,
    "can_charge_to_account": false,
    "vendor_id": 10,
    "report_on_1098t": true,
    "course_offering_id": null,
    "discount_type": "none",
    "discount_amount": null,
    "discount_can_combine": false,
    "sandbox": true
}

Retrieves a specific BookstoreItem object.

HTTP Request

GET /items/(bookstoreitem)

Parameters

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

Expandable Properties

Permissions

Any role may call this method.