Getting latest orders

This API request retrieves information about the latest orders created with your personal selling account or store.

Request Format
Request Format

GET / POST https://shopiro.ca/api/v1/{appid}/{pvk}/get/orders

Parameters
Parameters
  • {appid}: Your application ID
  • {pvk}: Your application's private key
  • ct: Integer, how many orders to return (range of 1-50, 25 by default)
  • of: Integer, pagination offset (0 by default)
Response
Response

The response is a JSON object containing the following fields if the request is successful:

  • success
  • offset
  • count
Examples
Examples

curl -X GET 'https://shopiro.ca/api/v1/your_app_id/your_private_key/get/orders'

$appid = 'your_app_id';
$pvk = 'your_private_key';
$aid = 'the_agent_id';

$url = "https://shopiro.ca/api/v1/{$appid}/{$pvk}/get/orders";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);


const appId = 'yourAppId';
const pvk = 'yourPrivateKey';
const aid = 'theAgentId';

const url = `https://shopiro.ca/api/v1/${appId}/${pvk}/get/orders`;

fetch(url)
.then(response => response.json())
.then(data => console.log(data))
.catch((error) => console.error('Error:', error));

import requests

app_id = 'your_app_id'
pvk = 'your_private_key'
aid = 'the_agent_id'

url = f'https://shopiro.ca/api/v1/{app_id}/{pvk}/get/orders'

response = requests.get(url)

if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Request failed with status code {response.status_code}")

use reqwest;
use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let app_id = "your_app_id";
let pvk = "your_private_key";
let aid = "the_agent_id";

let url = format!("https://shopiro.ca/api/v1/{}/{}//get/orders", app_id, pvk);

let client = reqwest::Client::new();
let res = client.get(&url).send().await?;

if res.status().is_success() {
let response_body: HashMap<String, String> = res.json().await?;
println!("{:?}", response_body);
} else {
println!("Request failed with status code {}", res.status());
}

Ok(())
}

require 'net/http'
require 'uri'
require 'json'

app_id = 'your_app_id'
pvk = 'your_private_key'
aid = 'the_agent_id'

url = URI("https://shopiro.ca/api/v1/#{app_id}/#{pvk}/get/orders")

response = Net::HTTP.get_response(url)

if response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)
puts data
else
puts "Request failed with status code #{response.code}"
end

using System;
using System.Net.Http;
using System.Threading.Tasks;

public class Program
{
private static readonly HttpClient client = new HttpClient();

public static async Task Main(string[] args)
{
var appId = "your_app_id";
var pvk = "your_private_key";
var aid = "the_agent_id";

var url = $"https://shopiro.ca/api/v1/{appId}/{pvk}/get/orders";

HttpResponseMessage response = await client.GetAsync(url);

if (response.IsSuccessStatusCode)
{
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
else
{
Console.WriteLine($"Request failed with status code {response.StatusCode}");
}
}
}