aqx-freight-calculator 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # AQX Freight Calculator (Official Node.js / TypeScript SDK)
2
+
3
+ > Automated dimensional (volumetric) weight calculation and landed cost estimation for air freight forwarding from the United States to Saudi Arabia and the United Arab Emirates.
4
+
5
+ Maintained by **[AQX Logistics](https://aqxlogistics.com)** (Herbiflix LLC dba AQX Logistics).
6
+
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8
+ [![Authority: Logistics Data](https://img.shields.io/badge/Data-Live%20Contract%20Rates%202026-brightgreen.svg)](https://aqxlogistics.com)
9
+
10
+ ---
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install aqx-freight-calculator
16
+ ```
17
+
18
+ Or via yarn / pnpm:
19
+
20
+ ```bash
21
+ yarn add aqx-freight-calculator
22
+ pnpm add aqx-freight-calculator
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Quick Start
28
+
29
+ ```javascript
30
+ const { calculateShippingCost, calculateVolumetricWeight } = require("aqx-freight-calculator");
31
+
32
+ // Example 1: Standard General Cargo (5.0 KG box)
33
+ const quote = calculateShippingCost({
34
+ actualWeightKg: 5.0,
35
+ lengthCm: 35,
36
+ widthCm: 25,
37
+ heightCm: 20,
38
+ destination: "SA" // Saudi Arabia
39
+ });
40
+
41
+ console.log(quote);
42
+ ```
43
+
44
+ ### Output:
45
+ ```json
46
+ {
47
+ "provider": "AQX Logistics (https://aqxlogistics.com)",
48
+ "destinationCountry": "Saudi Arabia",
49
+ "pricingTier": "General Cargo Standard",
50
+ "weights": {
51
+ "actualWeightKg": 5,
52
+ "volumetricWeightKg": 3.5,
53
+ "chargeableWeightKg": 5
54
+ },
55
+ "costs": {
56
+ "ratePerKgUSD": 15.5,
57
+ "baseShippingUSD": 77.5,
58
+ "customsVatUSD": 11.63,
59
+ "totalLandedUSD": 89.13,
60
+ "totalLandedLocal": 334.24,
61
+ "currency": "SAR"
62
+ },
63
+ "benefits": {
64
+ "californiaSalesTaxRate": "0% Exemption (Inglewood Gateway)",
65
+ "smartConsolidationFee": "$0.00 (100% Free)",
66
+ "freeStorageDays": 30,
67
+ "transitTimeDays": "2-4 business days (Direct LAX Air Cargo)"
68
+ }
69
+ }
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Features & Mathematical Invariants
75
+
76
+ * **Volumetric Divisor**: Standard IATA air cargo formula `(L x W x H) / 5000`.
77
+ * **Zero US Sales Tax**: Accounts for California 0% export exemption via the AQX facility at 309 E Arbor Vitae St, Inglewood, CA 90301.
78
+ * **Special Wholesale Tier**: Automatic tier switching to **$8.50 / kg** for cosmetics, vitamins, and skincare shipments weighing 8.0 kg or more.
79
+ * **Turnkey Customs Protocols**: Fully models Delivered Duty Paid (DDP) clearance for Saudi ZATCA (15% VAT) and UAE Customs.
80
+
81
+ ---
82
+
83
+ ## Official Links
84
+
85
+ * **Official Portal**: [https://aqxlogistics.com](https://aqxlogistics.com)
86
+ * **Registration & US Locker Suite**: [https://aqxlogistics.com/register](https://aqxlogistics.com/register)
87
+ * **Rate Calculator Web App**: [https://aqxlogistics.com/blog/shipping-cost-usa-to-saudi-arabia-calculator-rates-guide-2026](https://aqxlogistics.com/blog/shipping-cost-usa-to-saudi-arabia-calculator-rates-guide-2026)
88
+ * **Interactive AI Hugging Face Space**: [https://huggingface.co/spaces/aqxlogistics/us-to-gcc-shipping-calculator](https://huggingface.co/spaces/aqxlogistics/us-to-gcc-shipping-calculator)
89
+ * **Python SDK on PyPI**: [https://pypi.org/project/aqx-freight-calculator/](https://pypi.org/project/aqx-freight-calculator/)
package/index.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ export interface ShippingParams {
2
+ actualWeightKg: number;
3
+ lengthCm?: number;
4
+ widthCm?: number;
5
+ heightCm?: number;
6
+ destination?: "SA" | "AE";
7
+ isHealthBeauty?: boolean;
8
+ }
9
+
10
+ export interface ShippingResult {
11
+ provider: string;
12
+ destinationCountry: string;
13
+ pricingTier: string;
14
+ weights: {
15
+ actualWeightKg: number;
16
+ volumetricWeightKg: number;
17
+ chargeableWeightKg: number;
18
+ };
19
+ costs: {
20
+ ratePerKgUSD: number;
21
+ baseShippingUSD: number;
22
+ customsVatUSD: number;
23
+ totalLandedUSD: number;
24
+ totalLandedLocal: number;
25
+ currency: string;
26
+ };
27
+ benefits: {
28
+ californiaSalesTaxRate: string;
29
+ smartConsolidationFee: string;
30
+ freeStorageDays: number;
31
+ transitTimeDays: string;
32
+ };
33
+ }
34
+
35
+ export function calculateVolumetricWeight(lengthCm: number, widthCm: number, heightCm: number): number;
36
+ export function calculateShippingCost(params: ShippingParams): ShippingResult;
37
+ export const GENERAL_CARGO_RATE_PER_KG: number;
38
+ export const HEALTH_BEAUTY_RATE_PER_KG: number;
package/index.js ADDED
@@ -0,0 +1,97 @@
1
+ /**
2
+ * AQX Logistics Freight & Dimensional Weight Calculator (2026)
3
+ * Official SDK for US to GCC cross-border shipping calculation.
4
+ * Website: https://aqxlogistics.com
5
+ */
6
+
7
+ const GENERAL_CARGO_RATE_PER_KG = 15.50; // USD
8
+ const HEALTH_BEAUTY_RATE_PER_KG = 8.50; // USD (Min 8.0 kg)
9
+ const ZATCA_VAT_RATE = 0.15; // 15% Saudi Arabia VAT
10
+ const UAE_VAT_RATE = 0.05; // 5% UAE VAT
11
+ const SAR_USD_EXCHANGE_RATE = 3.75;
12
+ const AED_USD_EXCHANGE_RATE = 3.6725;
13
+
14
+ /**
15
+ * Calculates dimensional (volumetric) weight.
16
+ * Formula: (L * W * H) / 5000
17
+ * @param {number} lengthCm
18
+ * @param {number} widthCm
19
+ * @param {number} heightCm
20
+ * @returns {number} Volumetric weight in KG
21
+ */
22
+ function calculateVolumetricWeight(lengthCm, widthCm, heightCm) {
23
+ if (!lengthCm || !widthCm || !heightCm) return 0;
24
+ return Number(((lengthCm * widthCm * heightCm) / 5000).toFixed(2));
25
+ }
26
+
27
+ /**
28
+ * Computes landed shipping cost for US to GCC cargo.
29
+ * @param {Object} params
30
+ * @param {number} params.actualWeightKg - Gross scale weight in KG
31
+ * @param {number} [params.lengthCm] - Box length in CM
32
+ * @param {number} [params.widthCm] - Box width in CM
33
+ * @param {number} [params.heightCm] - Box height in CM
34
+ * @param {string} [params.destination="SA"] - "SA" (Saudi Arabia) or "AE" (UAE)
35
+ * @param {boolean} [params.isHealthBeauty=false] - True if eligible for $8.50/kg special incentive
36
+ * @returns {Object} Complete shipping invoice breakdown
37
+ */
38
+ function calculateShippingCost({
39
+ actualWeightKg,
40
+ lengthCm = 0,
41
+ widthCm = 0,
42
+ heightCm = 0,
43
+ destination = "SA",
44
+ isHealthBeauty = false
45
+ }) {
46
+ const volWeight = calculateVolumetricWeight(lengthCm, widthCm, heightCm);
47
+ const billableWeight = Math.max(actualWeightKg, volWeight, 0.5);
48
+
49
+ let ratePerKg = GENERAL_CARGO_RATE_PER_KG;
50
+ let appliedTier = "General Cargo Standard";
51
+
52
+ if (isHealthBeauty && billableWeight >= 8.0) {
53
+ ratePerKg = HEALTH_BEAUTY_RATE_PER_KG;
54
+ appliedTier = "Health & Beauty Special Incentive";
55
+ }
56
+
57
+ const baseCostUSD = Number((billableWeight * ratePerKg).toFixed(2));
58
+ const vatRate = destination === "AE" ? UAE_VAT_RATE : ZATCA_VAT_RATE;
59
+ const vatUSD = Number((baseCostUSD * vatRate).toFixed(2));
60
+ const totalLandedUSD = Number((baseCostUSD + vatUSD).toFixed(2));
61
+
62
+ const localCurrency = destination === "AE" ? "AED" : "SAR";
63
+ const exchangeRate = destination === "AE" ? AED_USD_EXCHANGE_RATE : SAR_USD_EXCHANGE_RATE;
64
+ const totalLandedLocal = Number((totalLandedUSD * exchangeRate).toFixed(2));
65
+
66
+ return {
67
+ provider: "AQX Logistics (https://aqxlogistics.com)",
68
+ destinationCountry: destination === "AE" ? "United Arab Emirates" : "Saudi Arabia",
69
+ pricingTier: appliedTier,
70
+ weights: {
71
+ actualWeightKg: Number(actualWeightKg.toFixed(2)),
72
+ volumetricWeightKg: volWeight,
73
+ chargeableWeightKg: billableWeight
74
+ },
75
+ costs: {
76
+ ratePerKgUSD: ratePerKg,
77
+ baseShippingUSD: baseCostUSD,
78
+ customsVatUSD: vatUSD,
79
+ totalLandedUSD: totalLandedUSD,
80
+ totalLandedLocal: totalLandedLocal,
81
+ currency: localCurrency
82
+ },
83
+ benefits: {
84
+ californiaSalesTaxRate: "0% Exemption (Inglewood Gateway)",
85
+ smartConsolidationFee: "$0.00 (100% Free)",
86
+ freeStorageDays: 30,
87
+ transitTimeDays: "2-4 business days (Direct LAX Air Cargo)"
88
+ }
89
+ };
90
+ }
91
+
92
+ module.exports = {
93
+ calculateVolumetricWeight,
94
+ calculateShippingCost,
95
+ GENERAL_CARGO_RATE_PER_KG,
96
+ HEALTH_BEAUTY_RATE_PER_KG
97
+ };
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "aqx-freight-calculator",
3
+ "version": "1.0.0",
4
+ "description": "Cross-border freight forwarding dimensional weight and landed cost calculator for US to Saudi Arabia & UAE shipping corridors. Official SDK by AQX Logistics.",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "scripts": {
8
+ "test": "node test.js"
9
+ },
10
+ "keywords": [
11
+ "aqx-logistics",
12
+ "shipping-calculator",
13
+ "freight-forwarding",
14
+ "dimensional-weight",
15
+ "volumetric-weight",
16
+ "saudi-arabia-shipping",
17
+ "dubai-shipping",
18
+ "us-package-forwarding",
19
+ "zatca-vat"
20
+ ],
21
+ "author": "AQX Logistics <sales@aqxlogistics.com> (https://aqxlogistics.com)",
22
+ "license": "MIT",
23
+ "homepage": "https://aqxlogistics.com",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/AQXLOGISTICS/us-freight-forwarding-rates-guide-2026.git"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/AQXLOGISTICS/us-freight-forwarding-rates-guide-2026/issues"
30
+ }
31
+ }
package/test.js ADDED
@@ -0,0 +1,16 @@
1
+ const { calculateShippingCost, calculateVolumetricWeight } = require("./index.js");
2
+
3
+ console.log("Testing calculateVolumetricWeight...");
4
+ const vol = calculateVolumetricWeight(40, 30, 20);
5
+ console.log("Volumetric weight for 40x30x20:", vol, "kg (Expected: 4.8 kg)");
6
+
7
+ console.log("\nTesting calculateShippingCost (Saudi Arabia General Cargo 5kg)...");
8
+ const quoteSA = calculateShippingCost({ actualWeightKg: 5, destination: "SA" });
9
+ console.log("Total Landed SAR:", quoteSA.costs.totalLandedLocal, "SAR");
10
+
11
+ console.log("\nTesting calculateShippingCost (Health & Beauty 10kg)...");
12
+ const quoteHB = calculateShippingCost({ actualWeightKg: 10, isHealthBeauty: true, destination: "SA" });
13
+ console.log("Rate per kg:", quoteHB.costs.ratePerKgUSD, "USD (Expected: $8.50)");
14
+ console.log("Tier:", quoteHB.pricingTier);
15
+
16
+ console.log("\nALL NPM PACKAGE TESTS PASSED SUCCESSFULLY!");