01
Create the shipment
Your order as cargo lines: sizes, weights, quantities, and the stop each line goes to. Send an Idempotency-Key, and a retry never makes a second shipment.
curl · shipment.sh
curl https://api.stowtix.com/v1/shipments \
-H "Authorization: Bearer $STOWTIX_KEY" \
-H "Idempotency-Key: po-4471" \
-H "Content-Type: application/json" \
-d '{"name": "PO 4471", "lines": [{
"description": "Pump housing", "quantity": 6,
"length_mm": 1200, "width_mm": 1150, "height_mm": 1300,
"weight_kg": 640, "stop_no": 3}]}'
# 201 Created {"id": "…", "name": "PO 4471", "lines": [ … ]}Python · shipment.py
import os, requests
api = requests.Session()
api.headers["Authorization"] = f"Bearer {os.environ['STOWTIX_KEY']}"
shipment = api.post("https://api.stowtix.com/v1/shipments",
headers={"Idempotency-Key": "po-4471"},
json={"name": "PO 4471", "lines": [{
"description": "Pump housing", "quantity": 6,
"length_mm": 1200, "width_mm": 1150, "height_mm": 1300,
"weight_kg": 640, "stop_no": 3}]}).json()Node.js · shipment.mjs
const headers = {
Authorization: `Bearer ${process.env.STOWTIX_KEY}`,
"Content-Type": "application/json",
};
const shipment = await fetch("https://api.stowtix.com/v1/shipments", {
method: "POST",
headers: { ...headers, "Idempotency-Key": "po-4471" },
body: JSON.stringify({ name: "PO 4471", lines: [{
description: "Pump housing", quantity: 6,
length_mm: 1200, width_mm: 1150, height_mm: 1300,
weight_kg: 640, stop_no: 3 }] }),
}).then((r) => r.json());