#!/bin/bash
# CreateShipment -- REST curl example
# Pre-configured for the DM Web Services test environment.
# Replace YOUR_TOKEN below with your Bearer token.

BASE_URL="https://webservices.nebulasuite.net"
TOKEN="YOUR_TOKEN"

curl -X POST "${BASE_URL}/api/public/v1/shipping/CreateShipment" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "clientReferenceCode": "YOUR-CLIENT-CODE",
    "carrierReferenceCode": "CARRIER-CODE",
    "serviceLevelCode": "OHN",
    "recordLayout": 0,
    "consignee": {
      "name": "John Smith",
      "address1": "123 Main Street",
      "city": "Austin",
      "state": "TX",
      "zip": "78701",
      "phone": "5125551234"
    },
    "shipper": {
      "name": "Acme Warehouse",
      "address1": "456 Industrial Blvd",
      "city": "Dallas",
      "state": "TX",
      "zip": "75201",
      "phone": "2145559876"
    },
    "lineItems": [
      {
        "pieces": 1,
        "weight": 65,
        "length": 24,
        "width": 12,
        "height": 10,
        "description": "Furniture piece"
      }
    ]
  }'
