> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.orderupb2b.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.orderupb2b.com/_mcp/server.

# 查詢規格清單

GET https://api.example.com/v1/skus

分頁查詢規格清單，用於遺失 id 對照，或規格是在後台先建立時，重新在 API 端找回既有規格。可用 outerSysCode、name 篩選，兩者皆為大小寫不敏感的子字串比對（查 A100 也會比對到 A1000）；barcode 則是精確比對，整段條碼要完全相符才會命中，與前兩者的子字串比對不同。用 productId 篩指定商品底下的規格；用 status 篩規格狀態，只接受 Active 或 Inactive（完全比對，而且大小寫必須完全相符，帶 active 會回傳 HTTP 200 但 data 是空陣列；語意見 SkuResponse.status 說明；規格沒有商品才有的 InactiveVisible 狀態）；用 updatedSince 篩「異動時間等於或晚於此刻」的資料，邊界含在內，剛好等於這一刻的資料也會被回傳，須帶明確時區或 Z（例如 2026-07-01T00:00:00Z），網址中的 + 記得轉成 %2B 編碼。page 從 1 起算，pageSize 為 1–100（預設 100），超出範圍一律回 400，不會自動夾限，避免分批掃描時誤判為已經抓完全部資料。

Reference: https://docs.orderupb2b.com/api-reference/skus/list-skus

## Authentication

- `X-Signature` header (required) — 每個 /v1 請求都必須帶 X-Client-Id、X-Timestamp、X-Nonce 與 X-Signature 四個標頭。X-Signature 是以 client secret 對 canonical string 做 HMAC-SHA256 後的 Base64。canonical string 的組成、可複製的簽章範例與 401 排查步驟，請參閱「驗證與簽章」。

## Request

### Query parameters

- `outerSysCode` (string, optional) — 依 ERP 端的規格代碼篩選。大小寫不敏感的子字串比對，查 A100 也會一併比對到 A1000；要精確命中某一筆，請在你端再比對一次完整字串。
- `name` (string, optional) — 依規格名稱篩選。大小寫不敏感的子字串比對，規則與 outerSysCode 相同。
- `productId` (long, optional) — 依所屬商品的序號篩選，只回傳這個商品底下的規格。合法的序號可由 GET /v1/products 取得。
- `barcode` (string, optional) — 依條碼篩選。這是精確比對，整段條碼完全相符才會命中，與 outerSysCode、name 的子字串比對不同。
- `status` (string, optional) — 依規格狀態篩選，只接受 Active 或 Inactive。這是完全比對，而且大小寫必須與這裡列出的完全相符——帶 active 不會命中任何資料，會回傳 HTTP 200 但 data 是空陣列，不是錯誤。規格沒有商品才有的 InactiveVisible 狀態，語意見 SkuResponse.status 說明。
- `UpdatedSince` (string, optional) — 只回傳異動時間等於或晚於此刻的規格，用於增量同步；邊界含在內，剛好等於這一刻的資料也會被回傳。必須是 ISO-8601 格式，並帶明確的時區位移或 Z（例如 2026-07-01T00:00:00Z）；沒有時區資訊會回傳 400 invalid_updated_since，不會被猜成任何時區。放進網址時記得把 + 編碼成 %2B。
- `Page` (integer, optional) — 頁碼，從 1 起算，省略時預設 1。小於 1 回傳 400 invalid_page；頁碼大到讓內部位移量溢位時同樣回傳 400 invalid_page。
- `PageSize` (integer, optional) — 每頁筆數，範圍 1 至 100，省略時預設 100。超出範圍一律回傳 400 invalid_page_size，不會自動夾限成合法值，避免分批掃描時誤判為已經抓完全部資料。

## Response

### 200

OK

- `data` (list of object, optional, nullable) — 本頁的規格資料，每一筆為一個 SkuResponse。
  - `id` (long, optional) — 規格序號。
  - `productId` (long, optional) — 所屬的商品序號。
  - `outerSysCode` (string, optional, nullable) — ERP 端的規格代碼。
  - `name` (string, optional, nullable) — 名稱。
  - `barcode` (string, optional, nullable) — 條碼。
  - `warehouse` (string, optional, nullable) — 倉別。
  - `unit` (string, optional, nullable) — 商品單位。
  - `spec` (string, optional, nullable) — 規格內容（例如「12入」「500g」）。
  - `price` (double, optional) — 價格。
  - `sellPrice` (double, optional) — 賣價。
  - `quantityPrecision` (integer, optional) — 數量精度（0 為整數，1 至 4 為小數位數）。
  - `status` (string, optional, nullable) — 規格狀態，只有兩種：Active（上架）、Inactive（下架）。與商品狀態不同，規格沒有「下架-顯示」（InactiveVisible）這個狀態——商品下架-顯示時，其規格一律收斂為 Inactive。狀態值只能在後台維護，本 API 目前不提供寫入；透過本 API 建立的規格一律為 Active。
  - `inventoryQty` (double, optional) — 目前的在庫數量，唯讀，規格主檔的寫入端點永遠不會異動這個值。這裡是實際在庫的物理數量，不含已保留／已成立訂單的扣抵；需要可售數請改查 GET /v1/skus/\{id}/stock 的 availableQty。
- `totalCount` (integer, optional) — 符合篩選條件的規格總數，涵蓋所有頁，不受目前頁碼影響。
- `currentPage` (integer, optional) — 目前頁碼，即請求帶入的 page，從 1 起算。
- `pageSize` (integer, optional) — 目前頁面的筆數上限，即請求帶入的 pageSize。
- `totalPages` (integer, optional) — 總頁數，等於 totalCount 除以 pageSize 後無條件進位；沒有符合的資料時為 0。

## Errors

### 400 Bad Request Error

Bad Request

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 401 Unauthorized Error

Unauthorized

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 403 Forbidden Error

Forbidden

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 500 Internal Server Error

Internal Server Error

- `code` (string, optional, nullable) — 錯誤代碼字串。
- `message` (string, optional, nullable) — 對應的錯誤說明文字。

## Examples

**Response**

```json
{
  "data": [
    {
      "id": 1,
      "productId": 1,
      "outerSysCode": "string",
      "name": "string",
      "barcode": "string",
      "warehouse": "string",
      "unit": "string",
      "spec": "string",
      "price": 1.1,
      "sellPrice": 1.1,
      "quantityPrecision": 1,
      "status": "string",
      "inventoryQty": 1.1
    }
  ],
  "totalCount": 1,
  "currentPage": 1,
  "pageSize": 1,
  "totalPages": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/skus"

headers = {"X-Signature": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/skus';
const options = {method: 'GET', headers: {'X-Signature': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/skus"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Signature", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/skus")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Signature"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/skus")
  .header("X-Signature", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/skus', [
  'headers' => [
    'X-Signature' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/skus");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Signature", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Signature": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/skus")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```