> ## 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.

# 4、確認託運資料 - TransReport

> **版本**：v1.0.0 \
>
> **狀態**：最終版  \
>
> **最後更新日期**：2026-10-17

## 文件概述

### 文件目的

當包裹皆確認完成，需要即時確認上傳託運資訊

> **注意：**
>
> * 建議有修改代收貨款內容後，務必呼叫此功能
> * 當包裹資料確認完成，不可再修改託運資料
> * 僅供正物流使用

## 前置需求

* [ ] 公司帳號(company)、公司密碼(password)：向營業所申請

## 身分驗證

本 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` | TransReport\_Json | X | 支援JSON格式 |

## API 規格

### 請求格式

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

* TransReport\_Json 定義

| 序號 | 參數 | 資料型態 | 是否必填 | 說明 | 範例 |
| - | - | - | - | - | - |
| 1 | sCompany | String | Y | 公司帳號 | |
| 2 | sPassword | String | Y | 公司密碼 | |
| 3 | dsCusJson | Object | Y | 完成確認的託運資料 | |

* dsCusJson Object 定義

| 序號 | 參數 | 資料型態 | 是否必填 | 說明 | 範例 |
| - | - | - | - | - | - |
| 1 | edelno | String(10) | Y | 新竹貨號 | 1234567891 |
| 2 | epino | String(30) | Y | 訂單編號 | 20260812000000000002 |

### 回應規格

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

#### HTTP 狀態碼

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

#### 業務錯誤代碼

| 錯誤代碼 | 說明 |
| - | - |
| 公司名稱或密碼錯誤 | |
| 查無貨號 | |
| 已經上傳過此筆 | |
| TransReport\_Json資料錯誤請確認 | |

## 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>
        <TransReport_Json xmlns="http://tempuri.org/">
            <sCompany>sCompany</sCompany>
            <sPassword>sPassword</sPassword>
            <dsCusJson>
            [
                {
                    "epino"  : "20260820000000000002",
                    "edelno" : "1004378093"
                }
            ]
            </dsCusJson>
        </TransReport_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>
        <TransReport_JsonResponse xmlns="http://tempuri.org/">
            <TransReport_JsonResult>[
  {
    "Num": "1",
    "success": "Y",
    "edelno": "1004378093",
    "epino": "20260820000000000002",
    "ErrMsg": ""
  }
]</TransReport_JsonResult>
        </TransReport_JsonResponse>
    </soap:Body>
</soap:Envelope>
```


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