NAV
shell ruby python csharp php

ShippingMethod

The ShippingMethod object

The ShippingMethod object looks like this in JSON:

{
    "object": "shipping_method",
    "id": 20,
    "name": "Standard: 3-5 business days",
    "type": "per_item",
    "carrier_id": 0,
    "international": false,
    "amount": 1.5,
    "default": false,
    "order_id": 6,
    "retired": null,
    "sandbox": true
}
Attribute Required Data Type
id No int
name Yes text (100)
type Yes enum (flat, per_item, per_pound, carrier_plan)
carrier_id Yes int
international Yes bool
amount Yes decimal
default Yes bool
order_id Yes int
retired Yes date
sandbox No bool

index

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/shippingmethods" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/shippingmethods',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/shippingmethods',
 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/shippingmethods"), 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/shippingmethods');
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": 1,
    "results": 1,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "shipping_method",
            "id": 20,
            "name": "Standard: 3-5 business days",
            "type": "per_item",
            "carrier_id": 0,
            "international": false,
            "amount": 1.5,
            "default": false,
            "order_id": 6,
            "retired": null
        }
    ],
    "sandbox": true
}

Retrieves all ShippingMethod objects.

HTTP Request

GET /shippingmethods

Parameters

None

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/shippingmethods/(shippingmethod)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/shippingmethods/(shippingmethod)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/shippingmethods/(shippingmethod)',
 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/shippingmethods/(shippingmethod)"), 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/shippingmethods/(shippingmethod)');
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": "shipping_method",
    "id": 20,
    "name": "Standard: 3-5 business days",
    "type": "per_item",
    "carrier_id": 0,
    "international": false,
    "amount": 1.5,
    "default": false,
    "order_id": 6,
    "retired": null,
    "sandbox": true
}

Retrieves a specific ShippingMethod object.

HTTP Request

GET /shippingmethods/(shippingmethod)

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: