#!/bin/bash
# GetLastMileRate -- REST example
#
# BASE_URL is pre-configured for the Nebula test environment.
# Replace YOUR_BEARER_TOKEN with the token issued to your client branch.

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

curl -X POST "${BASE_URL}/api/public/v1/rating/GetLastMileRate" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "originZipCode": "75201",
  "destinationZipCode": "78701",
  "rateDate": "2026-05-08T00:00:00Z",
  "serviceLevel": "OHS",
  "totalWeight": 500,
  "lineItems": [
    {
      "class": 100,
      "weight": 500,
      "description": "General Freight",
      "pieces": 1,
      "length": 48,
      "width": 40,
      "height": 40
    }
  ],
  "accessorials": [
    {
      "accessorialType": "Liftgate",
      "locationType": 1
    }
  ]
}'
