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

# 5、呼叫派遣 - TransDispatchOrder

> **版本**：v1.0.1 \
>
> **狀態**：最終版  \
>
> **最後更新日期**：2026-11-24

## 文件概述

### 文件目的

當包裹皆確認完成，確認要出貨。呼叫物流司機去收貨

> **注意：**
>
> * 需要30天內上傳的資料
> * 不包含【逆物流】派遣
> * 六日、國定假日不派遣
> * 呼叫派遣後，司機會在下午3點收到要取貨訊息，若呼叫此API是下午3點後則會納入次日工作天才會通知司機
> * 若要查詢司機是否已收件、配送中或已簽收，請至官網輸入貨號查詢 或 向營業所申請貨物配送狀況串接

> **派遣失敗：**
>
> * 會收到指定的信箱錯誤信
> * 請修正【無法派遣原因】後，再重新派遣。
> * 如果【無法派遣原因】是因為【取消派遣(因客戶取消收貨已停止派遣)】，請重新丟新的託運資料後再派遣。

## 前置需求

* [ ] 公司帳號(company)、公司密碼(password)：向營業所申請
* [ ] 託運總表(一式兩份)：[請參考【託運總表】說明](https://developer.hct.com.tw/files/logistics-share-docs/other/zh/logistics-shipping-manifest.md)

## 身分驗證

本 API 目前不提供身份驗證機制，使用者可直接依 API Specification 進行呼叫。

## API 規格總覽

* SOAP Envelope、HTTP Request Header 及 Namespace 定義請參考 **[SOAP規格](https://developer.hct.com.tw/files/logistics-share-docs/protocol-specifications/zh/soap-specification.md)**

### 支援格式

| 環境 | 網址 |
| - | - |
| 測試環境 | [https://hctrt.hct.com.tw/edi\_webservice2\_test/service1.asmx](https://hctrt.hct.com.tw/edi_webservice2_test/service1.asmx) |
| 正式環境 | [https://hctrt.hct.com.tw/edi\_webservice2/service1.asmx](https://hctrt.hct.com.tw/edi_webservice2/service1.asmx) |

| 規範項目 | 設定值 | 備註 |
| - | - | - |
| 回應逾時時間 | 60s | 伺服器處理並回傳資料的最大等待時間 |

### 資料格式

* 傳送一批資料請不要超過20筆
* 文字請使用utf-8

### API 端點

| 請求方法 | 端點 | SOAP 動作 | 驗證方式 | 說明 |
| - | - | - | - | - |
| POST | `/service1.asmx` | TransDispatchOrder\_Json | X | 支援JSON格式 |

## API 規格

### 請求格式

| 序號 | 參數 | 資料型態 | 是否必填 | 說明 | 範例 |
| - | - | - | - | - | - |
| 1 | Body | SOAP Body | Y | SOAP Request Body | `<soap12:Body> </soap12:Body>` |
| 2 | TransDispatchOrder\_Json | Object | Y | SOAPAction:TransDispatchOrder\_Json Request 物件 | `<TransDispatchOrder_Json  xmlns="http://tempuri.org/"></TransDispatchOrder_Json >` |

* TransDispatchOrder\_Json 定義

| 序號 | 參數 | 資料型態 | 是否必填 | 說明 | 範例 |
| - | - | - | - | - | - |
| 1 | company | String | Y | 公司帳號 | |
| 2 | password | String | Y | 公司密碼 | |
| 3 | json | Object | Y | 此次要更新的資料 | |

* json Object 定義

| 序號 | 參數 | 資料型態 | 是否必填 | 說明 | 範例 |
| - | - | - | - | - | - |
| 1 | epino | String(30) | Y | 訂單編號 | 20260812000000000002 |
| 2 | edelno | String(10) | Y | 新竹貨號 | 1234567891 |
| 3 | emark | String(30) | Y | 【平台or公司】-出貨人姓名 | 智生活-王小明 |

### 回應規格

| 序號 | 參數 | 資料型態 | 是否必填 | 說明 |
| - | - | - | - | - |
| 1 | rtn\_code | Integer | 回傳結果代碼 | |
| 2 | rtn\_msg | String(200) | 回傳結果訊息 | |
| 3 | rtn\_data | Object | 回傳物件 | |

* rtn\_data 定義

| 序號 | 參數 | 資料型態 | 是否必填 | 說明 |
| - | - | - | - | - |
| 1 | num | String(2) | 序號 | |
| 2 | success | String(1) | 結果(Y：成功/N：失敗) | |
| 3 | edelno | String(10) | 新竹貨號 | |
| 4 | epino | String(30) | 訂單編號 | |
| 5 | ErrMsg | String(200) | 異常錯誤訊息 | |

#### HTTP 狀態碼

| 狀態碼 | 說明 |
| - | - |
| 200 | 成功 |

#### 業務錯誤代碼

| 錯誤代碼 | 錯誤訊息 | 描述 |
| - | - | - |
| 111000001 | 公司名稱或密碼錯誤.. | |
| 111000001 | 傳入資料為空.. | |
| 120000001 | 服務發生例外錯誤，請稍後再試 | |
| 120000004 | 派遣收貨異常 (在企業代碼(Company)所設定的「派遣類型」，尚未配置參數，目前整批資料無法處理) | |

## SDK 與範例程式碼

### 範例

#### Request

```bash theme={null}
curl --location 'https://hctrt.hct.com.tw/edi_webservice2_test/service1.asmx' \
--header 'Content-Type: application/soap+xml; charset=utf-8' \
--data '<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
        <TransDispatchOrder_Json  xmlns="http://tempuri.org/">
            <company>company</company>
            <password>password</password>
            <json>
            [
                {
                    "epino"  : "20260820000000000002",
                    "edelno" : "1004378093",
                    "emark":"我是測試"
                }
            ]
            </json>
        </TransDispatchOrder_Json >
    </soap12:Body>
</soap12:Envelope>'
```

#### Response

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <TransDispatchOrder_JsonResponse xmlns="http://tempuri.org/">
            <TransDispatchOrder_JsonResult>{
  "rtn_data": [
    {
      "num": "1",
      "success": "N",
      "edelno": "1004378093",
      "epino": "20260820000000000002",
      "emark": "我是測試",
      "errMsg": "查無此資料或已超過30日，請確認資料"
    }
  ],
  "rtn_code": 120000004,
  "rtn_msg": "派遣收貨異常 (在企業代碼(Company)所設定的「派遣類型」，尚未配置參數，目前整批資料無法處理)"
}</TransDispatchOrder_JsonResult>
        </TransDispatchOrder_JsonResponse>
    </soap:Body>
</soap:Envelope>
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.