API Endpoints #
Warehouse #
GET v1/inventories #
https://tw.supplier.yahoo.com/api/spa/v1/inventories
Query the inventories in the warehouse belong to login user
Parameters
Parameter Name | Type | Required | Note |
---|---|---|---|
fields | String | Y | Options:
|
offset | Int32 | N | Pagination offset. Default: 0 |
limit | Int32 | N | Pagination limit. Default: 20 |
unsalableThreshold | Int32 | N | 滯銷天數定義 Be used while the fields parameter contains unsalableItems Default: 90 |
period | String | N | Search period, for specifying the time range of the following fields:
All of the inventories related period will be in Asia/Taipei time zone. |
sort | String | N | 排序條件 Supported fields: expiryDate, unsalableDays |
Output
- HTTP Status Code: 200 (OK)
- Object: Inventories
Error
HTTP Status Code | Error Code | Description |
---|---|---|
400 | Invalid input | |
400 | 40000002 | Missing period |
400 | 40000003 | Wrong fields collection |
400 | 40000005 | Contains illegal character(s) |
400 | 40007002 | Get unsalable items but the threshold was not provided |
401 | 40100001 | Missing or bad authentication |
401 | 40100002 | Invalid cookie |
401 | 40100003 | Missing or bad authentication |
401 | 40100004 | Check wssid failed |
401 | 40100006 | Cookie has expired |
500 | 50000006 | Internal server error |
500 | 50007000 | Query inventories failed |
Example
Case | Request | Response Status | Response |
---|---|---|---|
取得在庫品項數 | GET /api/spa/v1/inventories?fields=inventories&offset=0&limit=0 | HTTP/1.1 200 | Response |
取得在庫品項列表 | GET /api/spa/v1/inventories?fields=inventories | HTTP/1.1 200 | Response |
取得效期警示品項數 | GET /api/spa/v1/inventories?fields=expiringItems&offset=0&limit=0 | HTTP/1.1 200 | Response |
取得效期警示品項列表 | GET /api/spa/v1/inventories?fields=expiringItems&sort=+expiryDate | HTTP/1.1 200 | Response |
取得滯銷品項數 | GET /api/spa/v1/inventories?fields=unsalableItems&unsalableThreshold=90&offset=0&limit=0 | HTTP/1.1 200 | Response |
取得滯銷品項列表 | GET /api/spa/v1/inventories?fields=unsalableItems&unsalableThreshold=90&sort=-unsalableDays | HTTP/1.1 200 | Response |
取得本月累積出貨量 | GET /api/spa/v1/inventories?fields=totalDeliveryQty&period=2017-10-01T00:00:00+08:00/2017-10-31T23:59:59+08:00 | HTTP/1.1 200 | Response |
取得本月累計進貨量 | GET /api/spa/v1/inventories?fields=totalReceivedQty&period=2017-10-01T00:00:00+08:00/2017-10-31T23:59:59+08:00 | HTTP/1.1 200 | Response |
取得目前庫存金額 | GET /api/spa/v1/inventories?fields=totalAmount&period=2017-10-01 | HTTP/1.1 200 | Response |
取得目前庫存材積 | GET /api/spa/v1/inventories?fields=totalVolume&period=2017-10-01 | HTTP/1.1 200 | Response |
同時取得目前庫存金額與目前庫存材積 | GET /api/spa/v1/inventories?fields=totalAmount,totalVolume&period=2017-10-01 | HTTP/1.1 200 | Response |