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

# 依起始位置取得 Shipping Fees

<Warning>
  此頁面由 AI 自動翻譯。API 技術規格以英文呈現為標準。如有任何疑問，請參閱[英文版本](/api-reference/shipment/get-shipping-fees-from-origin-location)。
</Warning>

針對指定的起始位置（國家 + 郵遞區號）與包裹尺寸／重量，回傳可用的 **Return Service Types** 並**附帶費用估算**。可作為其他 `/api/ServiceType/*` 查詢的「含費用」對應，在 [建立 Return Shipment](/zh-Hant/api-reference/returnshipment/create-return-shipment) 之前預覽費用。預覽階段不保證最終費率，但相同輸入通常會在建立 Shipment 時產生相同費用。

此端點公開的是 **Return** 目錄加上費用。**Resend** 出庫服務不適用此端點 — 請改用 [依目的地取得 Resend Shipping Fees](/zh-Hant/api-reference/resend/get-resend-shipping-fees-by-destination) 預覽 Resend 費用。

<h2 id="when-to-call">
  何時呼叫
</h2>

* 為已知尺寸與重量的包裹挑選最便宜的退貨價格。
* 整合測試時，確認帳戶在指定國家下已開通的退件服務。

<h2 id="required-parameters">
  必要參數
</h2>

* **`fromCountryCode`** — 必填，**小寫 ISO3**（例如 `usa`、`gbr`）。可用值見 [取得所有起始國家](/zh-Hant/api-reference/country/get-all-from-countries-origin-countries)。
* **`fromPostalCode`** — 必填，非空。
* **`weight`、`dimension1`、`dimension2`、`dimension3`** — 全部必填且必須 `> 0`。
* **`limit`** — 選填，上限 `50`。省略時不設限制（回應由可用服務數量限制）。

<h2 id="response-notes">
  回應備註
</h2>

* 每筆紀錄包含 `serviceTypeCode`、`serviceType`（顯示名稱）、`warehouseId`（接收退件的 Warehouse）、`currencyCode` 與 `fee`。
* 列表會過濾為該起始位置下您帳戶已授權的退件服務。空回應表示該起始位置下沒有符合該尺寸／重量的服務。
* `chargeableWeight` 為承運商實際計費的重量，可能因材積重量進位而高於實際 `weight`。

<h2 id="related">
  相關
</h2>

* [建立 Return Shipment](/zh-Hant/api-reference/returnshipment/create-return-shipment) — 使用所選 `serviceTypeCode`。
* [取得所有 Return Service Types](/zh-Hant/api-reference/servicetype/get-all-return-service-types) — 不依尺寸／重量篩選的完整退件服務列表。
* [依起始與目的國家取得 Return Service Types](/zh-Hant/api-reference/servicetype/get-service-types-by-origin-and-destination-countries) 與 [依起始國家與 Warehouse 取得 Return Service Types](/zh-Hant/api-reference/servicetype/get-service-types-by-origin-country-and-warehouse) — 不含費用估算的較窄查詢。
* [取得所有國家](/zh-Hant/api-reference/country/get-all-countries) 與 [取得所有起始國家](/zh-Hant/api-reference/country/get-all-from-countries-origin-countries) — 有效國家代碼。


## OpenAPI

````yaml get /api/Shipment/getShippingFeeListByFromShippingOption
openapi: 3.1.0
info:
  title: Return Helper API
  description: API documentation for Return Helper — covering User and Public endpoints.
  version: 1.0.0
servers:
  - url: https://api.returnshelper.com/uat/user
    description: Sandbox — User API
  - url: https://api.returnshelper.com/uat/public
    description: Sandbox — Public API
  - url: https://api.returnhelpercentre.com/v1/user
    description: Production — User API
  - url: https://api.returnhelpercentre.com/v1/public
    description: Production — Public API
  - url: https://api.returnhelperchina.com/user
    description: Production — User API (China)
security:
  - ApiKey: []
    ApiToken: []
paths:
  /api/Shipment/getShippingFeeListByFromShippingOption:
    get:
      tags:
        - Shipment
      summary: Get shipping fees from origin location
      operationId: ReturnUserApi_GetShippingFeeListByFromShippingOption
      parameters:
        - name: fromCountryCode
          in: query
          required: true
          schema:
            type: string
          description: ISO3 origin country code
        - name: fromPostalCode
          in: query
          required: true
          schema:
            type: string
          description: Origin postal code
        - name: weight
          in: query
          required: true
          schema:
            type: number
            format: decimal
          description: Parcel weight
        - name: dimension1
          in: query
          required: true
          schema:
            type: number
            format: decimal
          description: Length (longest dimension)
        - name: dimension2
          in: query
          required: true
          schema:
            type: number
            format: decimal
          description: Width (second longest dimension)
        - name: dimension3
          in: query
          required: true
          schema:
            type: number
            format: decimal
          description: Height (shortest dimension)
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int32
            maximum: 50
            minimum: 0
          description: Maximum number of results
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralShippingFeeSummaryReply'
        '401':
          description: >-
            Authentication failed. Returned when the `x-rr-apikey` or
            `x-rr-apitoken` header is missing or invalid. The body uses the
            standard `ApiResponse` envelope with `meta.error.message` describing
            the auth failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      security:
        - ApiKey: []
          ApiToken: []
      servers:
        - url: https://api.returnshelper.com/uat/user
          description: Sandbox — User API
components:
  schemas:
    GeneralShippingFeeSummaryReply:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ShippingFeeSummaryReply'
          description: Shipping fee summary
    ApiResponse:
      type: object
      description: >-
        Universal response envelope. Successful responses include the business
        payload as additional top-level fields alongside `correlationId` and
        `meta`. Failed responses (auth errors, validation errors) only populate
        `correlationId` and `meta`, with `meta.errorCode` and `meta.error`
        describing the failure.
      properties:
        correlationId:
          type:
            - string
            - 'null'
          description: >-
            Unique correlation ID for tracing the request through Return Helper
            systems.
        meta:
          $ref: '#/components/schemas/ApiResponseMeta'
    ShippingFeeSummaryReply:
      type: object
      properties:
        shippingFeeDetailList:
          type: array
          items:
            type: object
            description: '(see source: ShippingFeeDetailReply)'
    ApiResponseMeta:
      type: object
      description: >-
        Application-level metadata for every API response. Inspect `status` and
        `errorCode` to detect soft-error responses (validation failures arrive
        as HTTP 200 with `meta.status: 400`).
      properties:
        status:
          type: integer
          description: >-
            Application-level status code. For successful operations this
            mirrors the HTTP status (e.g. 200). For validation failures it
            reports the logical status (e.g. 400) even though the wire HTTP
            status is 200.
        data:
          type: object
          additionalProperties:
            type: string
          description: Reserved free-form metadata key/value pairs. Usually empty.
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Machine-readable error code (e.g. `VALIDATION_FAILED`). Non-null
            only when the operation failed.
        error:
          type: object
          additionalProperties: true
          description: >-
            Field-level or message-level error detail keyed by request property
            name. Empty object on success.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-rr-apikey
      description: Your API key
    ApiToken:
      type: apiKey
      in: header
      name: x-rr-apitoken
      description: Your API token — keep this private

````