curl --request POST \
--url https://www.landedfees.com/v1/calc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination_country": "US",
"origin_country": "CN",
"incoterm": "FOB",
"transport_mode": "ocean",
"currency": "USD",
"freight": 250,
"insurance": 45,
"line_items": [
{
"description": "Wireless earbuds, plastic housing",
"hs_code": "8517.62.00",
"quantity": 500,
"unit_value": 12.5,
"origin_country": "CN",
"weight_kg": 0.15
}
]
}
'import requests
url = "https://www.landedfees.com/v1/calc"
payload = {
"destination_country": "US",
"origin_country": "CN",
"incoterm": "FOB",
"transport_mode": "ocean",
"currency": "USD",
"freight": 250,
"insurance": 45,
"line_items": [
{
"description": "Wireless earbuds, plastic housing",
"hs_code": "8517.62.00",
"quantity": 500,
"unit_value": 12.5,
"origin_country": "CN",
"weight_kg": 0.15
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination_country: 'US',
origin_country: 'CN',
incoterm: 'FOB',
transport_mode: 'ocean',
currency: 'USD',
freight: 250,
insurance: 45,
line_items: [
{
description: 'Wireless earbuds, plastic housing',
hs_code: '8517.62.00',
quantity: 500,
unit_value: 12.5,
origin_country: 'CN',
weight_kg: 0.15
}
]
})
};
fetch('https://www.landedfees.com/v1/calc', 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://www.landedfees.com/v1/calc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination_country' => 'US',
'origin_country' => 'CN',
'incoterm' => 'FOB',
'transport_mode' => 'ocean',
'currency' => 'USD',
'freight' => 250,
'insurance' => 45,
'line_items' => [
[
'description' => 'Wireless earbuds, plastic housing',
'hs_code' => '8517.62.00',
'quantity' => 500,
'unit_value' => 12.5,
'origin_country' => 'CN',
'weight_kg' => 0.15
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.landedfees.com/v1/calc"
payload := strings.NewReader("{\n \"destination_country\": \"US\",\n \"origin_country\": \"CN\",\n \"incoterm\": \"FOB\",\n \"transport_mode\": \"ocean\",\n \"currency\": \"USD\",\n \"freight\": 250,\n \"insurance\": 45,\n \"line_items\": [\n {\n \"description\": \"Wireless earbuds, plastic housing\",\n \"hs_code\": \"8517.62.00\",\n \"quantity\": 500,\n \"unit_value\": 12.5,\n \"origin_country\": \"CN\",\n \"weight_kg\": 0.15\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.landedfees.com/v1/calc")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination_country\": \"US\",\n \"origin_country\": \"CN\",\n \"incoterm\": \"FOB\",\n \"transport_mode\": \"ocean\",\n \"currency\": \"USD\",\n \"freight\": 250,\n \"insurance\": 45,\n \"line_items\": [\n {\n \"description\": \"Wireless earbuds, plastic housing\",\n \"hs_code\": \"8517.62.00\",\n \"quantity\": 500,\n \"unit_value\": 12.5,\n \"origin_country\": \"CN\",\n \"weight_kg\": 0.15\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.landedfees.com/v1/calc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination_country\": \"US\",\n \"origin_country\": \"CN\",\n \"incoterm\": \"FOB\",\n \"transport_mode\": \"ocean\",\n \"currency\": \"USD\",\n \"freight\": 250,\n \"insurance\": 45,\n \"line_items\": [\n {\n \"description\": \"Wireless earbuds, plastic housing\",\n \"hs_code\": \"8517.62.00\",\n \"quantity\": 500,\n \"unit_value\": 12.5,\n \"origin_country\": \"CN\",\n \"weight_kg\": 0.15\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "5f6b7c8d-1234-4abc-9def-0123456789ab",
"result": {
"goods_value": 6250,
"freight": 250,
"insurance": 45,
"customs_value": 6545,
"duty_amount": 3796.1,
"taxes_amount": 0,
"fees_amount": 25.67,
"total_landed_cost": 10366.77,
"currency": "USD",
"calculation_date": "2026-08-23",
"breakdown": [
{
"code": "MFN",
"amount": 0,
"rate": 0,
"exempted": false
},
{
"code": "SEC_301",
"amount": 1636.25,
"rate": 0.25,
"exempted": false
},
{
"code": "SEC_232",
"amount": 0,
"rate": 0,
"exempted": false
}
]
},
"compliance_flags": [],
"data_stale": false
}{
"error": "invalid body",
"issues": [
{
"path": [
"destination_country"
],
"message": "String must contain exactly 2 character(s)"
}
]
}{
"error": "unauthorized"
}{
"error": "quota_exceeded",
"code": "QUOTA_EXCEEDED",
"message": "Monthly quota exhausted. Upgrade at https://www.landedfees.com/pricing."
}{
"error": "missing_hs_code",
"code": "MISSING_HS_CODE",
"message": "Could not derive HS code for 1 line item(s)."
}{
"error": "rate_limited",
"code": "RATE_LIMITED",
"message": "Too many requests. Retry after 60 seconds."
}{
"error": "internal",
"detail": "engine error"
}Calculate landed cost
Runs the landed-cost engine end-to-end for a single shipment. Resolves MFN, Section 232 / 301 / 122 / 338, AD/CVD, FTA preferences, VAT/GST, MPF, HMF, and de-minimis. Returns a full CalculationResult plus compliance flags (PGA, restricted product, denied party, unit-price deviation, data-freshness, Section 122 sunset banner).
curl --request POST \
--url https://www.landedfees.com/v1/calc \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination_country": "US",
"origin_country": "CN",
"incoterm": "FOB",
"transport_mode": "ocean",
"currency": "USD",
"freight": 250,
"insurance": 45,
"line_items": [
{
"description": "Wireless earbuds, plastic housing",
"hs_code": "8517.62.00",
"quantity": 500,
"unit_value": 12.5,
"origin_country": "CN",
"weight_kg": 0.15
}
]
}
'import requests
url = "https://www.landedfees.com/v1/calc"
payload = {
"destination_country": "US",
"origin_country": "CN",
"incoterm": "FOB",
"transport_mode": "ocean",
"currency": "USD",
"freight": 250,
"insurance": 45,
"line_items": [
{
"description": "Wireless earbuds, plastic housing",
"hs_code": "8517.62.00",
"quantity": 500,
"unit_value": 12.5,
"origin_country": "CN",
"weight_kg": 0.15
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination_country: 'US',
origin_country: 'CN',
incoterm: 'FOB',
transport_mode: 'ocean',
currency: 'USD',
freight: 250,
insurance: 45,
line_items: [
{
description: 'Wireless earbuds, plastic housing',
hs_code: '8517.62.00',
quantity: 500,
unit_value: 12.5,
origin_country: 'CN',
weight_kg: 0.15
}
]
})
};
fetch('https://www.landedfees.com/v1/calc', 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://www.landedfees.com/v1/calc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination_country' => 'US',
'origin_country' => 'CN',
'incoterm' => 'FOB',
'transport_mode' => 'ocean',
'currency' => 'USD',
'freight' => 250,
'insurance' => 45,
'line_items' => [
[
'description' => 'Wireless earbuds, plastic housing',
'hs_code' => '8517.62.00',
'quantity' => 500,
'unit_value' => 12.5,
'origin_country' => 'CN',
'weight_kg' => 0.15
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.landedfees.com/v1/calc"
payload := strings.NewReader("{\n \"destination_country\": \"US\",\n \"origin_country\": \"CN\",\n \"incoterm\": \"FOB\",\n \"transport_mode\": \"ocean\",\n \"currency\": \"USD\",\n \"freight\": 250,\n \"insurance\": 45,\n \"line_items\": [\n {\n \"description\": \"Wireless earbuds, plastic housing\",\n \"hs_code\": \"8517.62.00\",\n \"quantity\": 500,\n \"unit_value\": 12.5,\n \"origin_country\": \"CN\",\n \"weight_kg\": 0.15\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.landedfees.com/v1/calc")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination_country\": \"US\",\n \"origin_country\": \"CN\",\n \"incoterm\": \"FOB\",\n \"transport_mode\": \"ocean\",\n \"currency\": \"USD\",\n \"freight\": 250,\n \"insurance\": 45,\n \"line_items\": [\n {\n \"description\": \"Wireless earbuds, plastic housing\",\n \"hs_code\": \"8517.62.00\",\n \"quantity\": 500,\n \"unit_value\": 12.5,\n \"origin_country\": \"CN\",\n \"weight_kg\": 0.15\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.landedfees.com/v1/calc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination_country\": \"US\",\n \"origin_country\": \"CN\",\n \"incoterm\": \"FOB\",\n \"transport_mode\": \"ocean\",\n \"currency\": \"USD\",\n \"freight\": 250,\n \"insurance\": 45,\n \"line_items\": [\n {\n \"description\": \"Wireless earbuds, plastic housing\",\n \"hs_code\": \"8517.62.00\",\n \"quantity\": 500,\n \"unit_value\": 12.5,\n \"origin_country\": \"CN\",\n \"weight_kg\": 0.15\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "5f6b7c8d-1234-4abc-9def-0123456789ab",
"result": {
"goods_value": 6250,
"freight": 250,
"insurance": 45,
"customs_value": 6545,
"duty_amount": 3796.1,
"taxes_amount": 0,
"fees_amount": 25.67,
"total_landed_cost": 10366.77,
"currency": "USD",
"calculation_date": "2026-08-23",
"breakdown": [
{
"code": "MFN",
"amount": 0,
"rate": 0,
"exempted": false
},
{
"code": "SEC_301",
"amount": 1636.25,
"rate": 0.25,
"exempted": false
},
{
"code": "SEC_232",
"amount": 0,
"rate": 0,
"exempted": false
}
]
},
"compliance_flags": [],
"data_stale": false
}{
"error": "invalid body",
"issues": [
{
"path": [
"destination_country"
],
"message": "String must contain exactly 2 character(s)"
}
]
}{
"error": "unauthorized"
}{
"error": "quota_exceeded",
"code": "QUOTA_EXCEEDED",
"message": "Monthly quota exhausted. Upgrade at https://www.landedfees.com/pricing."
}{
"error": "missing_hs_code",
"code": "MISSING_HS_CODE",
"message": "Could not derive HS code for 1 line item(s)."
}{
"error": "rate_limited",
"code": "RATE_LIMITED",
"message": "Too many requests. Retry after 60 seconds."
}{
"error": "internal",
"detail": "engine error"
}Authorizations
API key issued from the LandedFees dashboard under Settings > API keys.
Format: sk_live_... (production) or sk_test_... (sandbox). Pass in
the Authorization: Bearer <key> header.
Headers
Client-generated unique string (recommended UUID v4). Repeating the same key within 24 hours returns the cached response for the original request body. Different bodies with the same key return HTTP 409.
8 - 128"e4c1d2a0-8f6b-4c9d-a123-2f8b7c5e9d10"
Body
2"US"
2"CN"
EXW, FCA, CPT, CIP, DAP, DPU, DDP, FAS, FOB, CFR, CIF ocean, air, truck, rail, express 3"USD"
1Show child attributes
Show child attributes
x >= 0x >= 0x >= 0Itemized customs-value adjustments per 19 CFR 152.103.
Show child attributes
Show child attributes
Required when destination_country is EU.
222FTA program ID (KORUS, CAFTA_DR, etc.).
ISO date the shipment left the country of exportation. Drives the CBP-published weekly FX lookup per 19 CFR 141.62. Falls back to calculation_date when unset.
upload, manual Snapshot of extractor output for auto-detected fields.