# Synctify Public API 文件
Synctify Public API 允許前端開發人員從我們的訂單管理系統中取得支援的 Integration 清單。目前,此 API 僅支援取得數據,不提供新增、刪除或修改資料的功能。使用 API 無需授權。
Base URL: https://4e2668e8-e183-426c-a43c-213199b0f8eb.mock.pstmn.io/api/
## 使用方法
| Endpoints | Method | Path |
| -------- | -------- | -------- |
| Get All Datasources | GET | /dataSources |
| Get a Datasource | GET | /dataSources/{dataSourceId} |
| Get all Categories | GET | /dataSources/categories |
## Endpoints
### 1. 取得所有資料
#### Request
Method: GET
Endpoint: /dataSources
Headers:
- Accept: application/json
- Content-Type: application/json
#### Response
| Json Field | Description |
|------------|-------------|
| **id** | 平台的 id |
| **name** | 平台名稱 |
| **categoryId** | 類別 id |
| **categoryName** | 類別名稱 |
| **icon** | 圖檔的路徑 |
| `Integration Logo - {name}` | 格式:Integration Logo - {name} |
| **tags.name** | tag 欄位的預設名稱 |
| **tags.localized** | tag 欄位的翻譯,如果顯示 false 則使用預設名稱 |
| **availableToConnect** | 是否要顯示在頁面上 (`true` or `false`) |
```=json
{
"status": "success",
"code": 200,
"message": "Http ok",
"data": {
"contents": [
{
"id": 16,
"name": "Amazon Seller Central",
"category": {
"id": 3,
"name": "Marketplace"
},
"type": "API",
"serviceRegions": [
"US"
],
"icon": "http://v0.synctify.test/static/images/channels/logo-amazon.png",
"features": [],
"availableToConnect": true
},
{
"id": 2,
"name": "Wayfair",
"category": {
"id": 2,
"name": "Wholesaler & Retail"
},
"type": "API",
"serviceRegions": [
"US"
],
"icon": "http://v0.synctify.test/static/images/channels/logo-wayfair.png",
"features": {
"authorize_with_oauth2": false,
"sync_sales_order": true,
"acknowledge_sales_order": true,
"download_shipping_label": true,
"formatted_packing_slip": true,
"sync_advanced_shipment_notice": true,
"sync_inventory_advice": true,
"sync_invoice": false,
"download_product": true,
"multi_warehouses_supported": true,
"has_net_term_allowance": false,
"use_third_party_shipping_accounts": true
},
"availableToConnect": true
}
]
},
"error": {}
}
```
---
### 2. 取得一筆指定 id 資料
#### Request
Method: GET
Endpoint: /dataSources/{dataSourceId}
Headers:
- Accept: application/json
- Content-Type: application/json
#### Response
```=json
{
"status": "success",
"code": 200,
"message": "Http ok",
"data": {
"id": 2,
"name": "Wayfair",
"category": {
"id": 2,
"name": "Wholesaler & Retail"
},
"type": "API",
"serviceRegions": [
"US"
],
"icon": "http://v0.synctify.test/static/images/channels/logo-wayfair.png",
"features": {
"authorize_with_oauth2": false,
"sync_sales_order": true,
"acknowledge_sales_order": true,
"download_shipping_label": true,
"formatted_packing_slip": true,
"sync_advanced_shipment_notice": true,
"sync_inventory_advice": true,
"sync_invoice": false,
"download_product": true,
"multi_warehouses_supported": true,
"has_net_term_allowance": false,
"use_third_party_shipping_accounts": true
},
"availableToConnect": true
},
"error": {}
}
```
---
### 3. 取得所有分類
#### Request
Method: GET
Endpoint: /dataSources/categories
Headers:
- Accept: application/json
- Content-Type: application/json
#### Response
| Json Field | Description |
|------------|-------------|
| **id** | 類別的 id |
| **name** | 類別名稱 |
| **icon** | 類別名稱前的 icon,使用 `<i class="{icon}"></i>` 來取用 class name |
```=json
{
"status": "success",
"code": 200,
"message": "Http ok",
"data": {
"contents": [
{
"id": 2,
"name": "Wholesaler & Retail",
"icons": {
"feather": "feather icon-home",
"tabler": "ti ti-building-store"
}
},
{
"id": 3,
"name": "Marketplace",
"icons": {
"feather": "feather icon-shopping-bag",
"tabler": "ti ti-basket"
}
},
{
"id": 4,
"name": "Shopping Cart",
"icons": {
"feather": "feather icon-shopping-cart",
"tabler": "ti ti-shopping-cart"
}
},
{
"id": 5,
"name": "3PL & WMS & ERP",
"icons": {
"feather": "feather icon-box",
"tabler": "ti ti-building-warehouse"
}
},
{
"id": 6,
"name": "Financial Solutions",
"icons": {
"feather": "feather icon-dollar-sign",
"tabler": "ti ti-file-dollar"
}
},
{
"id": 1,
"name": "Others",
"icons": {
"feather": "feather icon-plus-circle",
"tabler": "ti ti-circle-plus"
}
}
]
},
"error": {}
}
```
---
## 語言參數
要取得指定語言版本的資料,請包括以下 headers 參數:
```=javascript
fetch('API-ENDPOINT', {
method: 'GET',
headers: {
'Accept-Language': 'en_US',
'Accept-Charset': 'utf-8'
},
})
```
`Accept-Language`: 預設為 en_US;其他選項:zh_CN, zh_TW