Skip to main content
GET
/
reports
/
shipping-margin
Shipping margin report (per-package classification)
curl --request GET \
  --url https://api.arcuserp.com/v1/reports/shipping-margin \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.arcuserp.com/v1/reports/shipping-margin"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.arcuserp.com/v1/reports/shipping-margin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.arcuserp.com/v1/reports/shipping-margin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.arcuserp.com/v1/reports/shipping-margin"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.arcuserp.com/v1/reports/shipping-margin")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.arcuserp.com/v1/reports/shipping-margin")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "data": {
    "summary": {
      "package_count": 123,
      "total_margin_amount": 123,
      "total_carrier_cost": 123,
      "total_customer_charge": 123,
      "avg_margin_pct": 123,
      "by_status": {
        "profit": {},
        "breakeven": {},
        "loss": {},
        "refund_overpay": {}
      }
    },
    "by_carrier": [
      {
        "carrier": "<string>",
        "status": "<string>",
        "package_count": 123,
        "total_margin_amount": 123,
        "avg_margin_pct": 123
      }
    ],
    "packages": [
      {
        "package_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "order_number": "<string>",
        "account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "account_name": "<string>",
        "carrier": "<string>",
        "service": "<string>",
        "status": "<string>",
        "margin_amount": 123,
        "margin_pct": 123,
        "carrier_cost": 123,
        "customer_charge": 123,
        "shipped_at": "2023-11-07T05:31:56Z",
        "computed_at": "2023-11-07T05:31:56Z"
      }
    ]
  },
  "filters": {
    "days": 123,
    "status": "<string>",
    "carrier": "<string>",
    "sort": "<string>",
    "date_from": "2023-11-07T05:31:56Z",
    "date_to": "2023-11-07T05:31:56Z"
  }
}
{
"error": "not_found",
"code": "not_found",
"type": "not_found",
"hint": "The requested order does not exist or does not belong to this entity.",
"param": "expand[0]",
"required": "accounts:read",
"request_id": "req_abc123"
}
{
"error": "not_found",
"code": "not_found",
"type": "not_found",
"hint": "The requested order does not exist or does not belong to this entity.",
"param": "expand[0]",
"required": "accounts:read",
"request_id": "req_abc123"
}
{
"error": "not_found",
"code": "not_found",
"type": "not_found",
"hint": "The requested order does not exist or does not belong to this entity.",
"param": "expand[0]",
"required": "accounts:read",
"request_id": "req_abc123"
}

Authorizations

Authorization
string
header
required

API key issued per entity via Settings > Developers > API Keys. Each key carries scopes (e.g. orders:read, products:write). Bearer token format: Authorization: Bearer ark_live_ent_Test keys use ark_test_ent_. Both are issued per entity
via Settings > Developers > API Keys.

Query Parameters

days
integer
default:30

Lookback window in days (clamped to 1..365)

Required range: 1 <= x <= 365
status
enum<string>

Filter to a single margin status

Available options:
profit,
breakeven,
loss,
refund_overpay
carrier
string

Free-text carrier name (ILIKE match, e.g. UPS, FedEx)

Maximum string length: 60
sort
enum<string>
default:worst_loss

Sort order for the packages[] block

Available options:
worst_loss,
shipped_at_desc,
margin_pct_asc

Response

Shipping margin report

data
object
filters
object