Retrieve the shipping margin report
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"
}Reports
Retrieve the shipping margin report
Returns a per-package shipping margin report classifying each shipped label as profit, breakeven, loss, or refund overpay, with carrier totals and per-package detail. Returns inline data rather than an async job; requires reports:read scope.
GET
/
reports
/
shipping-margin
Retrieve the shipping margin report
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
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
Lookback window in days (clamped to 1..365)
Required range:
1 <= x <= 365Filter to a single margin status
Available options:
profit, breakeven, loss, refund_overpay Free-text carrier name (ILIKE match, e.g. UPS, FedEx)
Maximum string length:
60Sort order for the packages[] block
Available options:
worst_loss, shipped_at_desc, margin_pct_asc Was this page helpful?

