curl -X POST https://api.nshiftgo.com/v1/shipments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"carrier": "postnord",
"sender": {
"name": "Your Company",
"address": "Street 1",
"city": "Copenhagen",
"zip": "1000",
"country": "DK"
},
"recipient": {
"name": "Customer Name",
"address": "Customer Street 42",
"city": "Aarhus",
"zip": "8000",
"country": "DK"
},
"parcels": [{ "weight": 1.5 }]
}'
const response = await fetch('https://api.nshiftgo.com/v1/shipments', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
carrier: 'postnord',
sender: {
name: 'Your Company',
address: 'Street 1',
city: 'Copenhagen',
zip: '1000',
country: 'DK'
},
recipient: {
name: 'Customer Name',
address: 'Customer Street 42',
city: 'Aarhus',
zip: '8000',
country: 'DK'
},
parcels: [{ weight: 1.5 }]
})
});
const shipment = await response.json();
console.log(shipment.tracking_number);
import requests
response = requests.post(
'https://api.nshiftgo.com/v1/shipments',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'carrier': 'postnord',
'sender': {
'name': 'Your Company',
'address': 'Street 1',
'city': 'Copenhagen',
'zip': '1000',
'country': 'DK'
},
'recipient': {
'name': 'Customer Name',
'address': 'Customer Street 42',
'city': 'Aarhus',
'zip': '8000',
'country': 'DK'
},
'parcels': [{'weight': 1.5}]
}
)
shipment = response.json()
print(shipment['tracking_number'])