# Fee of Order Info

> Get the current fee breakdown of an existing order.

## Endpoint

| Environment | URL |
| --- | --- |
| Production | `https://online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/soc` |
| Staging | `https://dev-online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/soc` |

**Method**: `GET`

## Headers

| Header | Required | Description |
| --- | --- | --- |
| `Token` | Yes | Shop token (issued by GHN) — [get a token](https://developer.ghn.vn/en/docs/token/get-token.md) |
| `ShopId` | Yes | Shop ID (int) |

## Parameters

- **order_code** (String): GHN tracking code. The order must belong to your account

## Request Example

```bash
curl -X GET "https://dev-online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/soc?order_code=LAD8VT" \
  -H "Token: 5c1d8a9e-2f4b-11ed-..." \
  -H "ShopId: 92837"
```

## Response

### Success (HTTP 200)

_Captured from a real Staging-environment call (`detail` abridged to the main fees)._

```json
{
  "code": 200,
  "message": "Success",
  "data": {
    "order_code": "LAD8VT",
    "detail": {
      "main_service": 20900,
      "insurance": 0,
      "cod_fee": 0,
      "station_do": 0,
      "station_pu": 0,
      "return": 0,
      "r2s": 0,
      "coupon": 0
    },
    "cod_collect_date": "0001-01-01T00:00:00Z"
  }
}
```

### Response Fields

All fee amounts are in VND.

| Field | Type | Description |
| --- | --- | --- |
| `order_code` | String | GHN tracking code |
| `detail` | Object | Current fee breakdown of the order |
| `detail.main_service` | Int | Base shipping fee |
| `detail.insurance` | Int | Insurance (declared-value) fee |
| `detail.cod_fee` | Int | COD collection fee |
| `detail.station_do` | Int | Fee for **receiving** the parcel at a station (delivery leg) |
| `detail.station_pu` | Int | Fee for **sending** the parcel at a station (pickup leg) |
| `detail.return` | Int | Return fee |
| `detail.r2s` | Int | Re-delivery ("return to shop") fee |
| `detail.coupon` | Int | Coupon discount |
| `detail.total` | Int | Total fee (omitted when 0) |
| `cod_collect_date` | String | When COD was collected (ISO 8601). The zero date `0001-01-01T00:00:00Z` means not collected yet |

> **NOTE**
> `detail` also carries the extra fee components seen on Calculate Fee (`document_return`, `double_check`, remote-area fees, address-change fees, …); zero values are returned as `0`.

## Error Codes

| Condition | HTTP | Meaning |
| --- | --- | --- |
| `Không tìm thấy thông tin đơn hàng` | 404 | The order code is unknown |
| `CLIENT_NOT_OWNER_OF_SHOP` | 400 | The order does not belong to your account |
| `SERVER_ERROR_COMMON` | 500 | Internal error |
