> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spojit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SmartFreight

> Rate calculations, consignment management, tracking, and delivery options via SOAP API.

The SmartFreight connector lets your workflows calculate shipping rates, create and manage consignments, compare carrier costs, and track deliveries through SmartFreight's SOAP API.

<Snippet file="connection-note.mdx" />

## Connection setup

<Steps>
  <Step title="Get your API credentials">
    Contact SmartFreight support or log in to your SmartFreight account to obtain your **API ID**, **API Password**, and **WSDL endpoint URL**.
  </Step>

  <Step title="Add the connection in Spojit">
    Go to **Connections** in Spojit, click **Add Connection**, select **SmartFreight**, and enter:

    * **WSDL Endpoint**: Your SmartFreight SOAP endpoint (e.g., `https://api-au-1.smartfreight.com/api/soap/classic?wsdl`)
    * **API ID**: Your SmartFreight API identifier
    * **API Password**: Your SmartFreight API password
  </Step>
</Steps>

## Tools

### Rate & Delivery

<AccordionGroup>
  <Accordion title="calculate-rate: Calculate shipping rate for a consignment">
    <ParamField body="consignment" type="object" required>
      Consignment data (connote fields) including receiver details, carrier, and freight line items.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "consignment": {
        "recname": "John Smith",
        "recaddr": {
          "add1": "123 Main Street",
          "add3": "Sydney",
          "add4": "NSW",
          "add5": "2000"
        },
        "carriername": "TNT",
        "freightlinedetails": [
          {
            "amt": 1,
            "desc": "Carton",
            "wgt": 10.5,
            "len": 40,
            "wid": 30,
            "hgt": 20
          }
        ]
      }
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "CalculateRateResult": {
          "connote": {
            "totalcost": "25.50",
            "carriername": "TNT",
            "carrierservicetype": "Road Express",
            "eta": "2",
            "freightlinedetails": {
              "amt": 1,
              "desc": "Carton",
              "wgt": 10.5,
              "cubicwgt": 4.0,
              "rateperkilo": "2.43",
              "cost": "25.50"
            }
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="get-delivery-options: Get available delivery options">
    <ParamField body="consignment" type="object" required>
      Consignment data with receiver address and freight details.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "consignment": {
        "recname": "Jane Doe",
        "recaddr": {
          "add1": "456 George Street",
          "add3": "Melbourne",
          "add4": "VIC",
          "add5": "3000"
        },
        "freightlinedetails": [
          {
            "amt": 2,
            "desc": "Parcel",
            "wgt": 5.0
          }
        ]
      }
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "GetDeliveryOptionsResult": {
          "options": {
            "option": [
              {
                "carriername": "TNT",
                "carrierservicetype": "Road Express",
                "eta": "2",
                "cost": "18.90"
              },
              {
                "carriername": "Toll",
                "carrierservicetype": "Priority",
                "eta": "1",
                "cost": "24.50"
              },
              {
                "carriername": "StarTrack",
                "carrierservicetype": "Premium",
                "eta": "1",
                "cost": "22.00"
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="cost-comparison: Compare costs across multiple carriers">
    <ParamField body="consignment" type="object" required>
      Consignment data with receiver address and freight details.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "consignment": {
        "recname": "Bob Wilson",
        "recaddr": {
          "add1": "789 Queen Street",
          "add3": "Brisbane",
          "add4": "QLD",
          "add5": "4000"
        },
        "freightlinedetails": [
          {
            "amt": 1,
            "desc": "Pallet",
            "wgt": 250.0,
            "len": 120,
            "wid": 100,
            "hgt": 150
          }
        ]
      }
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "CostComparisonResult": {
          "connote": {
            "comparison": {
              "carrier": [
                {
                  "carriername": "TNT",
                  "carrierservicetype": "Road Express",
                  "totalcost": "185.00",
                  "eta": "3"
                },
                {
                  "carriername": "Toll",
                  "carrierservicetype": "IPEC",
                  "totalcost": "195.50",
                  "eta": "2"
                },
                {
                  "carriername": "StarTrack",
                  "carrierservicetype": "Premium",
                  "totalcost": "210.00",
                  "eta": "2"
                }
              ]
            }
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Consignment Management

<AccordionGroup>
  <Accordion title="import-consignment: Create a new consignment">
    <ParamField body="consignment" type="object" required>
      Full consignment data including sender, receiver, carrier, and freight details.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "consignment": {
        "recname": "John Smith",
        "recaccno": "CUST001",
        "recaddr": {
          "add1": "123 Main Street",
          "add2": "Unit 4",
          "add3": "Sydney",
          "add4": "NSW",
          "add5": "2000"
        },
        "recphone": "0400000000",
        "recemail": "john@example.com",
        "carriername": "TNT",
        "carrierservicetype": "Road Express",
        "specialinstruction": "Leave at reception",
        "reference": "ORD-12345",
        "freightlinedetails": [
          {
            "amt": 2,
            "desc": "Carton",
            "wgt": 10.5,
            "len": 40,
            "wid": 30,
            "hgt": 20
          },
          {
            "amt": 1,
            "desc": "Satchel",
            "wgt": 1.2
          }
        ]
      }
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "ImportResult": {
          "connote": {
            "conid": "987654",
            "connumber": "TNT123456789",
            "carriername": "TNT",
            "carrierservicetype": "Road Express",
            "totalcost": "42.30",
            "recname": "John Smith",
            "recaddr": {
              "add1": "123 Main Street",
              "add2": "Unit 4",
              "add3": "Sydney",
              "add4": "NSW",
              "add5": "2000"
            },
            "status": "Imported",
            "freightlinedetails": [
              {
                "amt": 2,
                "desc": "Carton",
                "wgt": 10.5,
                "cost": "35.00"
              },
              {
                "amt": 1,
                "desc": "Satchel",
                "wgt": 1.2,
                "cost": "7.30"
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="find-consignment: Search for consignments">
    <ParamField body="xmlfield" type="string" required>
      Consignment field name to search (e.g., `recaccno`, `recname`).
    </ParamField>

    <ParamField body="fieldvalue" type="string">
      Value to search for.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "xmlfield": "recaccno",
      "fieldvalue": "CUST001"
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "FindConResult": "987654,987655,987660"
      }
    }
    ```
  </Accordion>

  <Accordion title="get-consignment: Get consignment details by ID">
    <ParamField body="conid" type="string" required>
      SmartFreight consignment ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "conid": "987654"
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "EnquiryResult": {
          "connote": {
            "conid": "987654",
            "connumber": "TNT123456789",
            "carriername": "TNT",
            "carrierservicetype": "Road Express",
            "totalcost": "42.30",
            "status": "Dispatched",
            "recname": "John Smith",
            "recaccno": "CUST001",
            "recaddr": {
              "add1": "123 Main Street",
              "add2": "Unit 4",
              "add3": "Sydney",
              "add4": "NSW",
              "add5": "2000"
            },
            "recphone": "0400000000",
            "recemail": "john@example.com",
            "specialinstruction": "Leave at reception",
            "reference": "ORD-12345",
            "freightlinedetails": [
              {
                "amt": 2,
                "desc": "Carton",
                "wgt": 10.5,
                "len": 40,
                "wid": 30,
                "hgt": 20,
                "cost": "35.00"
              },
              {
                "amt": 1,
                "desc": "Satchel",
                "wgt": 1.2,
                "cost": "7.30"
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="delete-consignment: Delete a consignment">
    <ParamField body="conid" type="string" required>
      SmartFreight consignment ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "conid": "987654"
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "DeleteConResult": "OK"
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Tracking

<AccordionGroup>
  <Accordion title="tracking-events: Get tracking events for a consignment">
    <ParamField body="conid" type="string" required>
      SmartFreight consignment ID.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "conid": "987654"
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "TrackingEventsResult": {
          "events": {
            "event": [
              {
                "status": "Delivered",
                "date": "2024-03-15",
                "time": "14:32",
                "location": "Sydney",
                "description": "Signed for by J Smith"
              },
              {
                "status": "On Board for Delivery",
                "date": "2024-03-15",
                "time": "06:45",
                "location": "Sydney Depot",
                "description": "Out for delivery"
              },
              {
                "status": "In Transit",
                "date": "2024-03-14",
                "time": "18:20",
                "location": "Melbourne Hub",
                "description": "Departed facility"
              },
              {
                "status": "Picked Up",
                "date": "2024-03-13",
                "time": "15:00",
                "location": "Melbourne",
                "description": "Consignment collected"
              }
            ]
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### Advanced

<AccordionGroup>
  <Accordion title="raw-soap-request: Execute an arbitrary SOAP operation">
    Send a raw SOAP request to any SmartFreight API operation. API credentials are injected automatically.

    <ParamField body="operation" type="string" required>
      SOAP operation name (e.g., `CalculateRate`, `Import`).
    </ParamField>

    <ParamField body="body" type="object">
      Request body parameters as key-value pairs.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "operation": "Enquiry",
      "body": {
        "conid": "987654"
      }
    }
    ```

    **Example response (parsed from SOAP XML):**

    ```json theme={null}
    {
      "success": true,
      "data": {
        "EnquiryResult": {
          "connote": {
            "conid": "987654",
            "connumber": "TNT123456789",
            "carriername": "TNT",
            "status": "Dispatched",
            "totalcost": "42.30"
          }
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>
