Comprehensive car shipping and logistics API for international and domestic transport
The Lima Automotive Shipping API provides comprehensive car shipping calculations for international and domestic transport. The API supports multiple regions, currencies, and shipping scenarios.
https://your-api-domain.comapplication/jsonUnderstanding the terminology used in this API is critical for proper integration:
The shipping industry uses overlapping terminology that can be confusing:
customsBreakdown.duty)| Term | Meaning | Example |
|---|---|---|
| Duty (Base) | Base import duty rate applied to cargo value | 12.971% of $10,000 = $1,297.10 |
| Tariff | Additional country-pair tariff (ADDS to duty, not replaces) | EUβUS 12.5% of $10,000 = $1,250 |
| CustomsTotal | Total of all customs charges | Duty + Tariff + GST/MPF/HMF + Brokerage + Bond |
| MPF | Merchandise Processing Fee (USA only) | 0.346% of cargo value |
| HMF | Harbor Maintenance Fee (USA only) | 0.125% of cargo value |
| GST | Goods and Services Tax (Canada only, SEPARATE from duty) | 5% of cargo value (independent) |
Dues) and new clear naming (customsBreakdown.duty)Cargo Value: $11,600 USD (converted from EUR)
Base Duty (12.971%): $1,504.80 β Called "Dues" in legacy API
Tariff (12.5% EUβUS): $1,450.12 β Additional, not replacement
MPF (0.346%): $40.19
HMF (0.125%): $14.50
ββββββββββ
Percentage Fees: $3,009.61
Brokerage (fixed): $400.00
Bond (0.55%, min $250): $250.00
ββββββββββ
CustomsTotal: $3,659.61 β This is what "dues" means in shipping jargon
customsBreakdown object for clearer field names:
customsBreakdown.duty instead of DuescustomsBreakdown.total instead of CustomsTotalcustomsBreakdown.percentageFeesSubtotal for sum of duty+tariff+GST/MPF/HMFThe API has two types of endpoints:
Most API endpoints (shipping calculation, currency conversion, etc.) are publicly accessible and don't require authentication.
Admin endpoints require JWT (JSON Web Token) authentication. To access admin endpoints:
/admin/login with username and passwordBearer YOUR_JWT_TOKEN// Example: Admin authentication
const response = await fetch('/admin/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
username: 'admin',
password: 'your_password',
remember: true
})
});
const { token } = await response.json();
// Use token for admin endpoints
const customsData = await fetch('/admin/customs', {
headers: {
'Authorization': `Bearer ${token}`
}
});
/admin/verifyCalculate shipping fees for car transport between two locations.
| Parameter | Type | Required | Description |
|---|---|---|---|
| origin | string/object | Yes | Origin address (string) or coordinates object with latitude/longitude |
| destination | string/object | Yes | Destination address (string) or coordinates object with latitude/longitude |
| value | number | Yes | Cargo value in input_currency |
| type | string | No | Request type: "addressreq" (default) or "pointReq" for coordinates |
| inputCurrency | string | No | Currency of input value (defaults to origin country currency) |
| currency | string | No | Output currency (defaults to destination country currency) |
| insured | string | No | Insurance type: "basic" (default), "comprehensive", or "no" |
| importType | string | No | Import type for customs calculation |
| buyForMe | boolean | No | Whether to include buy-for-me service (default: false) |
| insuredPrice | number | No | Custom insured value (overrides cargo value for insurance) |
| year | number | No | Car year (if provided, all three car details must be included) |
| make | string | No | Car make (if provided, all three car details must be included) |
| model | string | No | Car model (if provided, all three car details must be included) |
Automatic Location Decoding: When using "type": "pointReq" with coordinate-based requests, the API automatically performs reverse geocoding to include human-readable location strings in the response.
Added Fields: Both Origin and Destination objects will include a location field containing the decoded address string.
Example: Coordinates (25.7616798, -80.1917902) will be decoded to "Miami, FL, USA"
{
"Origin": {
"latitude": 25.7616798,
"longitude": -80.1917902,
"location": "Miami, FL, USA"
},
"OriginPort": null,
"Destination": {
"latitude": 40.7127753,
"longitude": -74.0059728,
"location": "New York, NY, USA"
},
"DestinationPort": null,
"Freight": 1830,
"CustomsTotal": 0,
"Insurance": 230,
"TotalCost": 3260,
"CargoValue": 10000,
"OceanTransport": 0,
"LandTransport": 1830,
"LandTransportOriginToPort": 0,
"LandTransportPortToDestination": 0,
"Brokerage": 0,
"Dues": 0,
"Bond": 0,
"Currency": "USD",
"ExchangeRate": 1.0,
"InsuranceType": "basic",
"importManagement": 1200,
"buyForMe": false,
"buyForMeFee": 0.025,
"agencyFee": 0,
"importType": null,
"customsMode": "domestic",
"insuranceBaseValue": 10000,
"isDomestic": true,
"inputCurrency": "USD",
"originalValue": 10000,
"carDetails": {
"year": 2020,
"make": "Porsche",
"model": "911 Turbo S"
},
"callerInfo": {
"host": "api.example.com",
"userAgent": "Mozilla/5.0...",
"remoteAddr": "192.168.1.1",
"timestamp": "2024-01-01T12:00:00"
},
"Fees": {
"transport": {
"baseRate": 950,
"ratePerKm": 0.5,
"distance": 1760.0,
"pickupRate": 0,
"oceanRate": 0
},
"insurance": {
"basicRate": 1.5,
"comprehensiveRate": 1.75,
"multiplier": 1.1,
"type": "basic",
"baseValue": 10000
},
"customs": {
"brokerage": 0,
"dues": 0,
"bond": 0
},
"service": {
"importManagement": 1200,
"buyForMe": {
"rate": 2.5,
"applied": false
}
}
},
"ID": "875a157cc4d4b069"
}
Get location suggestions for address autocomplete.
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Search query for location |
| limit | number | No | Maximum number of suggestions (default: 5) |
{
"suggestions": [
{
"label": "Miami, FL, USA",
"address": "Miami, FL, USA",
"country": "United States",
"region": "Florida",
"latitude": 25.7616798,
"longitude": -80.1917902,
"currency": "USD"
}
]
}
Convert address to GPS coordinates.
{
"address": "Miami, FL, USA"
}
{
"latitude": 25.7616798,
"longitude": -80.1917902,
"cc": "USA",
"currency": "USD"
}
Get list of available currencies.
{
"currencies": ["USD", "EUR", "GBP", "CAD", "AUD", "ZAR", "AED", "MXN"],
"count": 8
}
Convert amount between currencies.
{
"amount": 1000,
"from_currency": "USD",
"to_currency": "EUR"
}
{
"amount": 1000,
"from_currency": "USD",
"to_currency": "EUR",
"converted_amount": 859.0,
"exchange_rate": 0.859
}
Get current exchange rates.
{
"base_currency": "USD",
"rates": {
"EUR": 0.859,
"GBP": 0.789,
"CAD": 1.35
},
"timestamp": 1640995200
}
Find the nearest port to a given location.
{
"location": {
"latitude": 25.7616798,
"longitude": -80.1917902
},
"type": "pointReq"
}
{
"location": {
"address": "Miami, FL, USA",
"coordinates": {
"latitude": 25.7616798,
"longitude": -80.1917902
},
"country_code": "USA",
"currency": "USD"
},
"nearest_port": {
"id": "507f1f77bcf86cd799439011",
"name": "Port of Miami",
"address": "Port of Miami, Miami, FL, USA",
"region": "USA",
"coordinates": {
"latitude": 25.7616798,
"longitude": -80.1917902
}
},
"distance": {
"kilometers": 0.5,
"miles": 0.31
},
"port_region": "USA"
}
Health check endpoint with cache status.
{
"status": "healthy",
"ports_refresh_strategy": "time_based",
"refresh_interval_seconds": 300,
"ports_loaded": true,
"ports_count": 150,
"regions": ["USA", "Canada", "UK", "Europe", "Ireland", "South Africa", "Australia", "UAE", "Mexico"],
"cache_age_seconds": 45.2,
"cache_fresh": true
}
Get all customs rates and fees between two locations (percentages and base numbers only, no cargo value required).
| Parameter | Type | Required | Description |
|---|---|---|---|
| origin | string/object | Yes | Origin address (string) or coordinates object |
| destination | string/object | Yes | Destination address (string) or coordinates object |
| type | string | No | Request type: "addressreq" (default) or "pointReq" |
{
"origin": {
"country": "USA",
"region": "USA"
},
"destination": {
"country": "CAN",
"region": "Canada"
},
"isDomestic": false,
"fees": {
"transport": {
"pickupBase": 205,
"pickupRatePerKm": 0.9,
"oceanFee": 2900,
"deliveryBase": 577,
"deliveryRatePerKm": 0.31
},
"customs": {
"brokerage": 390,
"duesRate": 0.05, // 5% - In Canada, this is GST
"gstRate": 0.05, // 5% - Same as dues for Canada
"bondRate": 0,
"bondMin": 0,
"bondMax": 0,
"mpfRate": null,
"hmfRate": null,
"tariffApplied": false,
"tariffType": null,
"tariffRate": null
},
"service": {
"importManagement": 1200,
"buyForMeRate": 0.025 // 2.5%
},
"insurance": {
"basicRate": 0.015, // 1.5%
"comprehensiveRate": 0.0175, // 1.75%
"multiplier": 1.1
}
}
}
{
"origin": {
"country": "GER",
"region": "Europe"
},
"destination": {
"country": "USA",
"region": "USA"
},
"fees": {
"customs": {
"brokerage": 400,
"duesRate": 0.12, // 12% - Custom tariff rate
"standardDuesRate": 0.029714, // Original rate before tariff
"tariffApplied": true,
"tariffType": "country", // Country-specific tariff
"tariffRate": 0.12, // 12%
"bondRate": 0.0055,
"bondMin": 250,
"bondMax": 950,
"mpfRate": 0.003464,
"hmfRate": 0.00125
}
}
}
Bearer YOUR_JWT_TOKEN
Authenticate admin user and receive JWT token.
{
"username": "admin",
"password": "your_password",
"remember": true // Optional, extends token expiration
}
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"username": "admin",
"role": "admin",
"expiresIn": "7d" // or "24h" if remember is false
}
Verify admin token validity.
Authorization: Bearer YOUR_JWT_TOKEN
{
"valid": true,
"username": "admin",
"role": "admin"
}
Get all customs fees configuration and tariffs.
{
"pickupFee": 205,
"importManagement": 1200,
"buyForMeFee": 0.025,
"basicInsurance": 0.015,
"comprehensiveInsurance": 0.0175,
// USA fees
"usaBrokerage": 400,
"usaDues": 0.029714,
"usaMPF": 0.003464,
"usaHMF": 0.00125,
"usaBondMin": 250,
"usaBondMax": 950,
"usaBondX": 0.0055,
"usaDeliveryBase": 284,
"usaDeliveryX": 0.637,
// Canada fees (GST serves as dues)
"canadaBrokerage": 390,
"canadaGST": 0.05, // Also serves as dues
"canadaDeliveryBase": 577,
"canadaDeliveryX": 0.31,
// Other regions...
"customsPairs": [
{
"_id": "507f1f77bcf86cd799439011",
"originCountry": "GER",
"destinationCountry": "USA",
"type": "country",
"dutyRate": 0.12,
"active": true
},
{
"_id": "507f1f77bcf86cd799439012",
"originRegion": "Europe",
"destinationRegion": "USA",
"type": "region",
"dutyRate": 0.08,
"active": true
}
]
}
Update customs fees configuration and tariffs.
{
"pickupFee": 205,
"importManagement": 1200,
// ... all fee configurations
"customsPairs": [
{
"type": "country", // or "region"
"originCountry": "GER", // For country type
"destinationCountry": "USA",
"dutyRate": 0.12 // Replaces standard dues
},
{
"type": "region",
"originRegion": "Europe", // For region type
"destinationRegion": "USA",
"dutyRate": 0.08
}
]
}
{
"success": true,
"message": "Customs fees updated successfully"
}
Get all tariffs (active and inactive).
[
{
"_id": "507f1f77bcf86cd799439011",
"type": "country",
"originCountry": "GER",
"destinationCountry": "USA",
"dutyRate": 0.12,
"active": true,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
},
{
"_id": "507f1f77bcf86cd799439012",
"type": "region",
"originRegion": "Europe",
"destinationRegion": "USA",
"dutyRate": 0.08,
"active": false, // Inactive tariff
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-02T00:00:00Z"
}
]
Deactivate a specific tariff.
{
"success": true,
"message": "Tariff deactivated successfully"
}
Get audit log of admin actions.
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | number | No | Number of entries to return (default: 100) |
[
{
"timestamp": "2024-01-01T12:00:00Z",
"user": "admin",
"action": "update_customs",
"details": {
"changes": {
"usaBrokerage": {
"old": 400,
"new": 425
}
}
},
"ip": "192.168.1.1"
}
]
Create a new admin user (requires existing admin authentication).
{
"username": "newadmin",
"password": "secure_password",
"role": "admin" // Optional, defaults to "admin"
}
{
"success": true,
"username": "newadmin",
"message": "Admin user created successfully"
}
Admin panel web interface (requires authentication).
Admin login page (HTML interface).
The API supports the following regions with specific rates and configurations:
The API supports a flexible customs tariff system that allows for specific duty rates between country pairs or region blocks.
Define custom duty rates between specific countries (e.g., Germany β USA: 12%)
Define duty rates between regions (e.g., Europe β USA: 8%)
// Tariff application priority 1. Country-Specific Tariff (if exists) Example: GER β USA = 12% 2. Region-Block Tariff (if exists) Example: Europe β USA = 8% 3. Standard Region Dues (default) Example: USA standard = 2.971%
Example: If USA standard duty is 12.971% and a tariff of 12.5% applies (EUβUSA), the total customs duty will be 25.471% (12.971% + 12.5%).
Dues field shows duty only, GST field is separateAdmin users can manage tariffs through the admin panel:
Origin: Germany (GER) Destination: USA Country Tariff: 12% Region Tariff: 8% (Europe β USA) Base Duty: 12.971% Applied Rates: - Base Duty: 12.971% - Country Tariff: 12% (country-specific wins over region) - Total Duty Rate: 24.971% (12.971% + 12%) - Plus MPF (0.346%) and HMF (0.125%)
Origin: France (FRA) Destination: USA Country Tariff: None Region Tariff: 12.5% (Europe β USA) Base Duty: 12.971% Applied Rates: - Base Duty: 12.971% - Region Tariff: 12.5% - Total Duty Rate: 25.471% (12.971% + 12.5%) - Plus MPF (0.346%) and HMF (0.125%)
Origin: UAE Destination: Canada Country Tariff: None Region Tariff: 6.1% (UAE β Canada) Base Duty: 5% GST: 5% Applied Rates: - Base Duty: 5% - Region Tariff: 6.1% - Total Duty: 11.1% (5% + 6.1%) - GST: 5% (separate, calculated independently) - Total Percentage Fees: 16.1% (11.1% duty + 5% GST)
// When a tariff is applied
{
"Fees": {
"customs": {
"brokerage": 400,
"dues": 1200, // 12% of $10,000
"tariffApplied": true,
"tariffType": "country", // or "region"
"tariffRate": 12, // Percentage
"standardDues": 297.10 // What it would have been without tariff
}
}
}
Important: All internal calculations are performed in USD, then converted to the output currency.
Flow: Input Currency β USD β Calculate β Output Currency
// Currency calculation flow input_value_in_currency β convert_to_usd β calculate_costs_in_usd β convert_to_output_currency // Example: EUR 10000 β USD 10859 β Calculate β USD 6240 β EUR 5750
Fixed Issue: CargoValue now correctly preserves the original input value in the input currency.
Previous Behavior: CargoValue was incorrectly converted to origin country currency.
Current Behavior: CargoValue maintains the original input value and currency.
// Domestic calculation example (USA β USA) direct_distance = calculateDistance(origin, destination) transport = 950 + (0.5 Γ direct_distance) freight = transport ocean_fee = 0 customs_total = 0 import_management = 1200 // Lima Automotive service fee total_cost = freight + insurance + import_management + agency_fee
// International calculation example (UAE β Europe) pickups = origin_to_port_distance ocean_fee = max(origin_ocean_fee, destination_ocean_fee) freight = pickups + ocean_fee customs_total = brokerage + dues + bond import_management = 1200 // Lima Automotive service fee total_cost = freight + insurance + customs_total + import_management + agency_fee
Formula: ocean_fee = max(origin_ocean_fee, destination_ocean_fee)
The higher ocean fee between origin and destination regions is used.
Ocean transport fees are set to 0 for the following scenarios:
Reason: These routes don't require ocean transport and use land-based logistics.
// Insurance calculation with TWO different modes:
// MODE 1: When custom insured_price is provided by user
if insured == 'comprehensive':
insurance = comprehensive_rate Γ insured_price // No 1.1x, no freight
else: // basic
insurance = basic_rate Γ insured_price // No 1.1x, no freight
// MODE 2: Default calculation (no custom insured_price)
if insurance_base_value == 0 or insured == 'no':
insurance = 0
elif insured == 'comprehensive':
insurance = comprehensive_rate Γ 1.1 Γ (cargo_value + freight)
else: // basic
insurance = basic_rate Γ 1.1 Γ (cargo_value + freight)
No Insurance: When insured = "no"
Zero Value: When cargo value or insured price is 0
Custom Insured Value (insured_price parameter):
insuranceBaseValue in response = insured_priceDefault Calculation (no custom insured_price):
insuranceBaseValue in response = cargo_value + freightAll monetary values are rounded to 2 decimal places like regular currency
Example: $1234.56789 becomes $1234.57
POST /shipping
{
"origin": {
"latitude": 25.7616798,
"longitude": -80.1917902
},
"destination": {
"latitude": 40.7127753,
"longitude": -74.0059728
},
"value": 10000,
"type": "pointReq",
"insured": "basic"
}
{
"Freight": 1830,
"CustomsTotal": 0,
"Insurance": 230,
"TotalCost": 3260,
"OceanTransport": 0,
"LandTransport": 1830,
"importManagement": 1200,
"isDomestic": true,
"Currency": "USD"
}
POST /shipping
{
"origin": {
"latitude": 25.2048493,
"longitude": 55.2707828
},
"destination": {
"latitude": 48.8575475,
"longitude": 2.3513765
},
"value": 10000,
"type": "pointReq",
"insured": "comprehensive",
"currency": "EUR"
}
{
"Freight": 4645,
"CustomsTotal": 344,
"Insurance": 69,
"TotalCost": 6258,
"OceanTransport": 4600,
"LandTransport": 245,
"importManagement": 1200,
"isDomestic": false,
"Currency": "EUR"
}
POST /shipping
{
"origin": "Miami, FL, USA",
"destination": "New York, NY, USA",
"value": 15000,
"insured": "basic",
"buyForMe": true
}
{
"Freight": 1830,
"CustomsTotal": 0,
"Insurance": 345,
"TotalCost": 4675,
"OceanTransport": 0,
"LandTransport": 1830,
"importManagement": 1200,
"agencyFee": 375,
"buyForMe": true,
"isDomestic": true,
"Currency": "USD"
}
| Error Type | Status Code | Description | Example |
|---|---|---|---|
| Invalid JSON | 400 | Request body is not valid JSON | {"error": "No JSON received"} |
| Missing Parameters | 400 | Required parameters are missing | {"error": "Missing required parameter: value"} |
| Geocoding Failed | 400 | Could not find coordinates for address | {"error": "Could not find coordinates for origin address: Invalid Address"} |
| Currency Conversion Failed | 400 | Failed to convert between currencies | {"error": "Failed to convert 1000 USD to INVALID"} |
| Server Error | 500 | Internal server error | {"error": "Internal server error", "ID": "abc123"} |
{
"error": "Error description",
"ID": "request_id_for_tracking"
}
The API includes comprehensive analytics tracking to monitor usage, performance, and caller behavior.
The API automatically captures caller information from HTTP headers for analytics purposes:
{
"callerInfo": {
"host": "api.example.com",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...",
"remoteAddr": "192.168.1.1",
"xForwardedFor": "203.0.113.1",
"xRealIp": "203.0.113.1",
"cfConnectingIp": "203.0.113.1",
"timestamp": "2024-01-01T12:00:00"
}
}
IP Detection Priority:
CF-Connecting-IP - Cloudflare real IPX-Real-IP - Nginx real IPX-Forwarded-For - Proxy forwarded IPremote_addr - Direct connection IPThis strategy ensures accurate IP detection even when the API is hosted behind proxies or load balancers.
Each API call is logged with comprehensive analytics data:
{
"ID": "875a157cc4d4b069",
"timestamp": "2024-01-01T12:00:00",
"method": "POST",
"path": "/shipping",
"status": 200,
"response_time_ms": 150,
"input_currency": "USD",
"output_currency": "EUR",
"insured": "basic",
"buyForMe": false,
"carDetails": {
"year": 2020,
"make": "Porsche",
"model": "911 Turbo S"
},
"origin": {
"latitude": 25.7616798,
"longitude": -80.1917902
},
"destination": {
"latitude": 40.7127753,
"longitude": -74.0059728
},
"value": 10000,
"type": "pointReq",
"customsMode": "domestic",
"isDomestic": true
}
Privacy Note: Caller information is collected for analytics purposes only. No personal data is stored or shared.
Data Retention: Analytics data is retained for operational and performance monitoring purposes.
Domestic shipments occur when both origin and destination are within the same region (e.g., USA to USA, Europe to Europe). These shipments have simplified calculations and different cost structures compared to international shipments.
Automatic Detection: The API automatically detects domestic shipments based on region matching.
Response Field: isDomestic: true indicates a domestic shipment.
| Aspect | Domestic | International |
|---|---|---|
| Ocean Transport | 0 (no ocean crossing) | Calculated based on region |
| Ports | None (direct transport) | Origin and destination ports |
| Customs | 0 (no customs fees) | Brokerage + Dues + Bond |
| Land Transport | Direct origin to destination | Origin to port + port to destination |
| Import Management | 1200 (service fee) | 1200 (service fee) |
// Domestic shipment calculation direct_distance = calculateDistance(origin, destination) transport = base_rate + (rate_per_km Γ direct_distance) freight = transport ocean_fee = 0 customs_total = 0 import_management = 1200 // Lima Automotive service fee insurance = insurance_rate Γ (cargo_value + freight + import_management) agency_fee = buy_for_me ? (cargo_value Γ 0.025) : 0 total_cost = freight + insurance + import_management + agency_fee
POST /shipping
{
"origin": "Miami",
"destination": "New York",
"value": 10000,
"insuredPrice": 15000,
"year": 2020,
"make": "Porsche",
"model": "911 Turbo S",
"buyForMe": true,
"inputCurrency": "USD",
"currency": "USD"
}
{
"Origin": {
"latitude": 25.7616798,
"longitude": -80.1917902,
"location": "Miami, FL, USA"
},
"OriginPort": null,
"Destination": {
"latitude": 40.7127753,
"longitude": -74.0059728,
"location": "New York, NY, USA"
},
"DestinationPort": null,
"Freight": 1830,
"CustomsTotal": 0,
"Insurance": 280,
"TotalCost": 3560,
"CargoValue": 10000,
"OceanTransport": 0,
"LandTransport": 1830,
"LandTransportOriginToPort": 0,
"LandTransportPortToDestination": 0,
"Brokerage": 0,
"Dues": 0,
"Bond": 0,
"Currency": "USD",
"ExchangeRate": 1.0,
"InsuranceType": "basic",
"importManagement": 1200,
"buyForMe": true,
"buyForMeFee": 0.025,
"agencyFee": 250,
"importType": null,
"customsMode": "domestic",
"insuranceBaseValue": 15000,
"isDomestic": true,
"inputCurrency": "USD",
"originalValue": 10000,
"carDetails": {
"year": 2020,
"make": "Porsche",
"model": "911 Turbo S"
},
"callerInfo": {
"host": "localhost:8080",
"userAgent": "PostmanRuntime/7.29.4",
"remoteAddr": "127.0.0.1",
"timestamp": "2025-08-20T17:15:50.000034"
},
"ID": "394bd8c3a2412758"
}
Distance Calculation: Miami to New York β 1760 km
Transport Cost: $950 + (0.5 Γ 1760) = $950 + $880 = $1830
Insurance: 1.5% Γ (15000 + 1830 + 1200) = 1.5% Γ 18030 = $270.45 β $280 (rounded up)
Buy-for-Me Fee: 2.5% Γ 10000 = $250
Total: $1830 + $280 + $1200 + $250 = $3560
| Field | Value | Description |
|---|---|---|
| isDomestic | true | Indicates this is a domestic shipment |
| customsMode | "domestic" | Customs calculation mode |
| OceanTransport | 0 | No ocean transport for domestic shipments |
| OriginPort | null | No ports involved in domestic shipments |
| DestinationPort | null | No ports involved in domestic shipments |
| CustomsTotal | 0 | No customs fees for domestic shipments |
| Brokerage | 0 | No customs brokerage for domestic |
| Dues | 0 | No customs duties for domestic |
| Bond | 0 | No customs bond for domestic |
| LandTransport | 1830 | Direct transport cost (origin to destination) |
| LandTransportOriginToPort | 0 | No port involved |
| LandTransportPortToDestination | 0 | No port involved |
Formula: Uses Haversine formula for accurate great-circle distance calculation
Units: Distances are calculated in kilometers
Accuracy: Provides precise distance for cost calculations
// Distance calculation example (Miami to New York)
miami_coords = {lat: 25.7616798, lng: -80.1917902}
ny_coords = {lat: 40.7127753, lng: -74.0059728}
distance_km = haversine_distance(miami_coords, ny_coords) β 1760 km
// Transport cost calculation
transport_cost = 950 + (0.5 Γ 1760) = 950 + 880 = 1830 USD
The API response includes a comprehensive Fees object that provides all the percentages, rates, and values used in calculating the shipment cost. This transparency allows developers to understand exactly how costs are calculated and verify calculations.
{
"Fees": {
"transport": { ... }, // Transport-related fees
"insurance": { ... }, // Insurance calculation details
"customs": { ... }, // Customs fees actually applied
"service": { ... } // Service fees
}
}
Note: The Fees object only includes the fees that were actually used in the calculation, with standardized names that work universally across all regions and shipment types.
{
"transport": {
"baseRate": 950, // Base rate for domestic shipments
"ratePerKm": 0.5, // Rate per kilometer for domestic
"distance": 1760.0, // Calculated distance in kilometers
"pickupRate": 205, // Pickup fee for international (0 for domestic)
"oceanRate": 4600 // Ocean transport rate (0 for domestic)
}
}
Domestic USA: $950 + ($0.5 Γ distance_km)
Example: 1760 km = $950 + ($0.5 Γ 1760) = $950 + $880 = $1830
International: pickup_rate + ocean_rate + delivery_fees
{
"insurance": {
"basicRate": 1.5, // Basic insurance rate (1.5%)
"comprehensiveRate": 1.75, // Comprehensive insurance rate (1.75%)
"multiplier": 1.1, // Risk multiplier (only for default calculations)
"type": "basic", // Insurance type used in calculation
"baseValue": 11830 // Base value: insured_price (if provided) OR (cargo_value + freight)
}
}
Default Mode (no custom insured_price):
// Basic Insurance (Default) insurance = basic_rate Γ multiplier Γ (cargo_value + freight) insurance = 1.5% Γ 1.1 Γ (10000 + 1830) = 1.5% Γ 1.1 Γ 11830 = $195.20 // Comprehensive Insurance (Default) insurance = comprehensive_rate Γ multiplier Γ (cargo_value + freight) insurance = 1.75% Γ 1.1 Γ (10000 + 1830) = 1.75% Γ 1.1 Γ 11830 = $227.73
Custom Insured Value Mode (when insured_price is provided):
// Basic Insurance (Custom) insurance = basic_rate Γ insured_price // No 1.1x multiplier, no freight insurance = 1.5% Γ 15000 = $225.00 // Comprehensive Insurance (Custom) insurance = comprehensive_rate Γ insured_price // No 1.1x multiplier, no freight insurance = 1.75% Γ 15000 = $262.50
{
"customs": {
"brokerage": 400, // Customs brokerage fee actually applied
"dues": 297.10, // Customs duties actually applied
"bond": 250 // Customs bond fee actually applied
}
}
USA Customs:
Example for $10,000 cargo:
Note: For domestic shipments, all customs fees will be 0.
{
"service": {
"importManagement": 1200, // Lima Automotive service fee
"buyForMe": {
"rate": 2.5, // Buy-for-me fee rate (2.5%)
"applied": true // Whether buy-for-me service is included
}
}
}
Import Management: Fixed $1,200 fee for all shipments
Buy-for-Me: 2.5% of cargo value when service is requested
Example: $10,000 cargo with buy-for-me = $10,000 Γ 2.5% = $250
{
"ocean": {
"usa": 2900, // USA ocean transport fee
"canada": 2900, // Canada ocean transport fee
"uk": 2900, // UK ocean transport fee
"europe": 2900, // Europe ocean transport fee
"southAfrica": 4200, // South Africa ocean transport fee
"australia": 4600, // Australia ocean transport fee
"uae": 4600, // UAE ocean transport fee
"mexico": 4200 // Mexico ocean transport fee
}
}
Formula: ocean_fee = max(origin_ocean_fee, destination_ocean_fee)
Example: UAE (4600) to Europe (2900) = max(4600, 2900) = 4600
Reasoning: Higher fee covers the more expensive leg of the journey
{
"delivery": {
"usa": {
"base": 284, // Base delivery fee for USA
"rate": 63.7 // Delivery rate per km (63.7%)
},
"canada": {
"base": 577, // Base delivery fee for Canada
"rate": 31.0 // Delivery rate per km (31.0%)
}
}
}
// USA Delivery delivery_fee = base + (rate Γ distance_km) delivery_fee = 284 + (63.7% Γ distance_km) // Canada Delivery delivery_fee = base + (rate Γ distance_km) delivery_fee = 577 + (31.0% Γ distance_km)
// Input
cargo_value = 10000
distance = 1760 km
insured_price = 15000
buy_for_me = true
// Transport Cost
transport = 950 + (0.5 Γ 1760) = 950 + 880 = 1830
// Insurance (Basic)
insurance_base = 15000 + 1830 + 1200 = 18030
insurance = 1.5% Γ 1.1 Γ 18030 = 0.015 Γ 1.1 Γ 18030 = 297.50 β 300 (rounded up)
// Buy-for-Me Fee
agency_fee = 2.5% Γ 10000 = 250
// Total Cost
total = transport + insurance + import_management + agency_fee
total = 1830 + 300 + 1200 + 250 = 3580
// Final Response
{
"Freight": 1830,
"Insurance": 300,
"importManagement": 1200,
"agencyFee": 250,
"TotalCost": 3580,
"Fees": {
"transport": {
"baseRate": 950,
"ratePerKm": 0.5,
"distance": 1760.0
},
"insurance": {
"basicRate": 1.5,
"multiplier": 1.1,
"baseValue": 15000
},
"service": {
"importManagement": 1200,
"buyForMe": {
"rate": 2.5,
"applied": true
}
}
}
}
Note: Fees vary by region and are stored in the customs database. The API automatically selects the appropriate rates based on origin and destination regions.
Updates: Fee rates can be updated in the database without requiring API code changes.
| Field | Type | Description |
|---|---|---|
| Origin | object | Origin coordinates with latitude/longitude and location string (for pointReq) |
| Destination | object | Destination coordinates with latitude/longitude and location string (for pointReq) |
| OriginPort | object/null | Nearest port to origin (null for domestic) |
| DestinationPort | object/null | Nearest port to destination (null for domestic) |
| Freight | number | Total freight cost (transport for domestic, pickups+ocean for international) |
| CustomsTotal | number | Total customs charges (brokerage + duty + tariff + GST/MPF/HMF + bond) |
| Insurance | number | Insurance premium amount |
| TotalCost | number | Total shipping cost (freight + insurance + customs + service fees) |
| CargoValue | number | Cargo value in origin country currency |
| OceanTransport | number | Ocean transport fee (0 for domestic) |
| LandTransport | number | Total land transport cost |
| LandTransportOriginToPort | number | Origin to port transport cost (0 for domestic) |
| LandTransportPortToDestination | number | Port to destination transport cost (0 for domestic) |
| Brokerage | number | Customs brokerage fee |
| Dues | number | Base customs duty amount (legacy field - use customsBreakdown.duty for clarity) |
| Tariff | number | Additional tariff amount (country/region-specific, adds to duty) |
| MPF | number | Merchandise Processing Fee (USA only, 0 for others) |
| HMF | number | Harbor Maintenance Fee (USA only, 0 for others) |
| GST | number | Goods and Services Tax (Canada only, 0 for others - separate from duty) |
| Bond | number | Customs bond fee |
| Currency | string | Output currency code |
| ExchangeRate | number | USD to output currency exchange rate |
| InsuranceType | string | Insurance type used ("basic", "comprehensive", "no") |
| importManagement | number | Lima Automotive service fee |
| buyForMe | boolean | Whether buy-for-me service is included |
| buyForMeFee | number | Buy-for-me fee rate (2.5%) |
| agencyFee | number | Agency fee amount |
| importType | string/null | Import type for customs calculation |
| customsMode | string | Customs calculation mode ("domestic", "default", "customs_waived") |
| insuranceBaseValue | number | Base value used for insurance calculation. When custom insured_price is provided, this equals the insured_price. When using default calculation, this equals (cargo_value + freight) |
| isDomestic | boolean | Whether shipment is domestic (same region) |
| ID | string | Unique request ID for tracking |
| callerInfo | object | Information about the caller (host, user agent, remote address, timestamp) |
| carDetails | object/null | Car details (year, make, model) if provided in the request |
| inputCurrency | string | Currency of the input value |
| originalValue | number | Original cargo value in input currency |
| Rates | object | NEW: Percentage rates breakdown (shows rates even when cargo value is 0) |
| ββ dutyRate | number | Base duty rate percentage (e.g., 12.971 for 12.971%) |
| ββ tariffRate | number | Additional tariff rate percentage (e.g., 12.5 for 12.5%) |
| ββ gstRate | number | GST rate for Canada (e.g., 5.0 for 5%) |
| ββ mpfRate | number | MPF rate for USA (e.g., 0.346 for 0.346%) |
| ββ hmfRate | number | HMF rate for USA (e.g., 0.125 for 0.125%) |
| ββ bondRate | number | Bond rate for USA (e.g., 0.55 for 0.55%) |
| ββ insuranceRate | number | Insurance rate based on type (e.g., 1.5 for 1.5%) |
| customsBreakdown | object | NEW: Clear breakdown of customs charges with intuitive naming (recommended for new integrations) |
| ββ duty | number | Base duty amount (same as Dues field, clearer naming) |
| ββ tariff | number | Additional tariff amount (country/region-specific) |
| ββ gst | number | GST amount (Canada only) |
| ββ mpf | number | MPF amount (USA only) |
| ββ hmf | number | HMF amount (USA only) |
| ββ brokerage | number | Customs brokerage fee |
| ββ bond | number | Customs bond amount |
| ββ percentageFeesSubtotal | number | Sum of percentage-based fees (duty+tariff+gst+mpf+hmf) |
| ββ total | number | Total customs charges (same as CustomsTotal) |
| ββ note | string | Explanatory text about customs calculation |
Check API health: GET /health
View dashboard: GET /dashboard
All API calls are logged with:
This API is actively maintained and updated. Check the health endpoint for current status and cache information.