Description
Create/update an order and immediately generate a shipping label in one call.
Required
- orderNumber, orderDate, shipTo, weight, dimensions, items (≥1)
Optional
- orderId, orderKey, shipByDate, orderStatus, customerUsername, customerEmail
- billTo, customerNotes, requestedShippingService, serviceCode
- internationalOptions, customsCountryCode
Response
{
"success": true,
"data": {
"shippingLabelBase64": "...",
"courierService": "shipnoble_...",
"trackingNumber": "...",
"trackingLink": "https://...",
"orderNumber": "...",
"expectedDeliveryDate": "3-5 business days"
}
}
Example (detailed)
{
"orderNumber": "WEB-1725360000",
"orderKey": "ext-12345",
"orderDate": "2025-09-03T12:00:00",
"shipByDate": "2025-09-05T12:00:00",
"orderStatus": "awaiting_shipment",
"customerUsername": "acme_user",
"customerEmail": "customer@example.com",
"billTo": {
"name": "John Doe",
"company": "ACME Billing",
"street1": "123 Billing Street",
"city": "Toronto",
"state": "ON",
"postalCode": "M5V 3A8",
"country": "CA"
},
"shipTo": {
"name": "Jane Doe",
"company": "ACME Receiving",
"street1": "456 Shipping Ave",
"city": "Vancouver",
"state": "BC",
"postalCode": "V6B 1A1",
"country": "CA",
"phone": "+1 604-555-9876",
"residential": false
},
"items": [
{
"sku": "WIDGET-PRO",
"name": "Professional Widget",
"quantity": 1,
"unitPrice": 149.99,
"weight": { "value": 2.0, "units": "pounds" }
},
{
"sku": "MANUAL-001",
"name": "User Manual",
"quantity": 1,
"unitPrice": 9.99,
"weight": { "value": 0.5, "units": "pounds" }
}
],
"customerNotes": "Leave at front desk.",
"requestedShippingService": "ShipNoble Canada Express",
"serviceCode": "canada_zone_skip_express",
"weight": { "value": 2.5, "units": "pounds" },
"dimensions": { "length": 12.0, "width": 10.0, "height": 6.0, "units": "inches" },
"internationalOptions": {
"contents": "merchandise",
"customsItems": null
},
"customsCountryCode": "CA"
}
Order Creation Examples
HTTP Request (cURL)
curl -X POST "https://snap.shipnoble.com/api/v1/orders/submit" \
-H "Authorization: Bearer sk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"orderNumber": "WEB-1725360000",
"orderDate": "2025-09-03T12:00:00",
"shipTo": {
"name": "Jane Doe",
"company": "ACME Receiving",
"street1": "456 Shipping Ave",
"city": "Vancouver",
"state": "BC",
"postalCode": "V6B 1A1",
"country": "CA",
"phone": "+1 604-555-9876",
"residential": false
},
"items": [
{
"sku": "WIDGET-PRO",
"name": "Professional Widget",
"quantity": 1,
"unitPrice": 149.99,
"weight": { "value": 2.0, "units": "pounds" }
}
],
"weight": { "value": 2.5, "units": "pounds" },
"dimensions": { "length": 12.0, "width": 10.0, "height": 6.0, "units": "inches" }
}'
Python Example
import json
import requests
url = "https://snap.shipnoble.com/api/v1/orders/submit"
headers = {
"Authorization": "Bearer sk_your_api_key_here",
"Content-Type": "application/json"
}
data = {
"orderNumber": "WEB-1725360000",
"orderDate": "2025-09-03T12:00:00",
"shipTo": {
"name": "Jane Doe",
"company": "ACME Receiving",
"street1": "456 Shipping Ave",
"city": "Vancouver",
"state": "BC",
"postalCode": "V6B 1A1",
"country": "CA",
"phone": "+1 604-555-9876",
"residential": False
},
"items": [
{
"sku": "WIDGET-PRO",
"name": "Professional Widget",
"quantity": 1,
"unitPrice": 149.99,
"weight": {"value": 2.0, "units": "pounds"}
}
],
"weight": {"value": 2.5, "units": "pounds"},
"dimensions": {"length": 12.0, "width": 10.0, "height": 6.0, "units": "inches"}
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
if result["success"]:
print(f"Label generated! Tracking: {result['data']['trackingNumber']}")
# Save the base64 label
import base64
with open("shipping_label.pdf", "wb") as f:
f.write(base64.b64decode(result["data"]["shippingLabelBase64"]))
else:
print(f"Error: {result['error']['message']}")
JavaScript/Node.js Example
const fetch = require('node-fetch'); // or use fetch in browser
const url = 'https://snap.shipnoble.com/api/v1/orders/submit';
const headers = {
"Authorization": "Bearer sk_your_api_key_here",
"Content-Type": "application/json"
};
const data = {
orderNumber: "WEB-1725360000",
orderDate: "2025-09-03T12:00:00",
shipTo: {
name: "Jane Doe",
company: "ACME Receiving",
street1: "456 Shipping Ave",
city: "Vancouver",
state: "BC",
postalCode: "V6B 1A1",
country: "CA",
phone: "+1 604-555-9876",
residential: false
},
items: [
{
sku: "WIDGET-PRO",
name: "Professional Widget",
quantity: 1,
unitPrice: 149.99,
weight: { value: 2.0, units: "pounds" }
}
],
requestedShippingService: "ShipNoble Canada Express",
serviceCode: "canada_zone_skip_express",
weight: { value: 2.5, units: "pounds" },
dimensions: { length: 12.0, width: 10.0, height: 6.0, units: "inches" }
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => {
if (result.success) {
console.log(`Label generated! Tracking: ${result.data.trackingNumber}`);
// Save the base64 label
const fs = require('fs');
const buffer = Buffer.from(result.data.shippingLabelBase64, 'base64');
fs.writeFileSync('shipping_label.pdf', buffer);
} else {
console.log(`Error: ${result.error.message}`);
}
})
.catch(error => console.error('Request failed:', error));
Important Notes
- Replace API Key: Use your actual API key from the self-service generation
- Base URL: Use production URL in live environment
- Error Handling: Always check the
success field in response
- Label Storage: The
shippingLabelBase64 is a PDF that needs to be decoded
- Required Fields: orderNumber, orderDate, shipTo, weight, dimensions, items