# API 命名規則
[TOC]
## 格式範例:
### Production API Prefix
**https://greenboxapiprod.azurewebsites.net/api**
### Stage API Prefix
**https://gb-dev-4.azurewebsites.net/api**
### API 功能
- Method: **GET** | **POST**
- Endpoint:
- Query
- Parameter1
- Parameter2 (optional)
- Body (JSON)
```
```
- Response (GET)
```
```
- Response (POST)
```
{
Code: string,
Message: string,
Data: {}
}
```
## 定義
### 商品分類(產線)
```
單品-產地直送: 0
快速到貨: 2
箱類: 5
生鮮肉舖: 7
粥寶寶: 9
```
### 溫層 (TemperatureType)
```
常溫: 1
冷藏: 2
冷凍: 3
```
### 訂單狀態 (OrderStatus)
```
處理中: 0
已出貨: 1
已送達: 2
已取消: 3
```
### 性別 (Sex)
```
女: 0
男: 1
```
### Datetime 格式
```
string: YYYY-MM-DDTHH:mm:ss
```
### 商品卡片(簡易商品資訊)
```
{
ProductId: int,
Name: string,
Pictures: [string(URL)], // 圖片數量(全部)(絕對路徑(https://.....))
MinPrice: int,
CategoryType: int,
TemperatureType: int,
IsAvailable: boolean
}
```
### 商品規格及庫存
```
{
ProductId: int,
ProductDetailId: int,
CategoryType: int,
SubCategoryType: int,
TemperatureType: int,
Unit: int, (x)
Module: string, (包)
Detail: string, (x 包 (oo 入))
Price: int,
DiscountPrice: int | null,
StockCount: int,
IsShipping: boolean,
IsAvailable: boolean,
HasTax: boolean,
ExportStartDate: DateTime | null,
ExportEndDate: DateTime | null,
StartTime: DateTime | null,
EndTime: DateTime | null,
IsLimitedOnePackForOneAccount: bool, 限購一組
VIPLevelId: int[],
BoxWeeklyType: int, 箱類(1:單週/2:雙週)
}
```
### 商品評論
```
{
CommentId: int,
MemberName: string,
Ranking: int,
Content: string,
CreateDate: Datetime,
}
```
### 收件人資料
```
{
ReceiverId : int,
ZipCode : string,
Name : string,
City : string,
District : string,
Address : string,
Mobile : string,
[收件人姓名]: string,
[收件人電話]: string,
[收件人郵遞區號]: string, // Additional
[收件人地址-縣市]: string,
[收件人地址-鄉鎮市區]: string,
[收件人地址]: string,
[收件人電話]: string
}
```
### 會員資料
```
{
MemberId : int,
Account: string
Name : string | null,
Sex: int | null,
Email: string | null,
Birthday: Datetime | null,
VipLevelId : int,
VipLevelName : string,
Avatar : string(URL), // 絕對路徑(https://.....),
OrderRemarks : int,
Bonus : int,
Redpoint : int,
CouponCount : int,
VoucherCount : int,
Receivers :收件人資料
[會員id]: int,
[帳號]: string,
[姓名]: string,
[性別]: int,
[信箱]: string,
[生日]: Datetime,
[會員等級id]: int,
[會員等級名稱]: int,
[頭像]: string,
[備註]: string,
[購物金]: int,
[紅利點數]: int,
[優惠卷數量]: int,
[兌換卷數量]: int,
[常用收件人]: [
收件人資料
],
}
```
### 購物金紀錄
```
{
Bonus : string,
OrderNumber : string | null,
Remark : string | null,
CreateTime : DateTime
[金額]: int(signed),
[訂單編號]: int | null,
[備註]: string | null,
[時間]: Date(String | int),
}
```
### 紅利點數紀錄
```
{
Redpoint : string,
OrderNumber : string | null,
Remark : string,
CreateTime : DateTime
[金額]: int(signed),
[訂單編號]: int | null,
[備註]: string | null,
[使用期限]: Date(String | int),
[時間]: Date(String | int),
}
```
### 優惠卷
```
{
CouponId: int,
Name: string,
Count: int,
Discount: decimal,
IsPercent: bool, (0: number, 1: percent)
StartTime: DateTime,
EndTime: DateTime,
PriceLimit: int | null,
CategoryLimit: int[] | null,
ProductLimit: int[] | null
[優惠卷id]: int,
[優惠卷名稱]: string,
[優惠卷數量]: int, // 重複的卷
[優惠金額]: float,
[優惠權重]: float,
[使用期限-開始]: Date(String | int),
[使用期限-結束]: Date(String | int),
[訂單金額限制]: int | null,
[商品分類限制]: int[] | null,
[商品限制]: int[] | null,
}
```
### 商品規格預覽
```
{
ProductId: int,
ProductDetailId: int,
Name: string,
Picture: string,
Detail: string, (xx組(x包/斤)),
Module: string,
Price: int,
Quantity: int
[商品id]: int,
[商品規格id]: int,
[商品名稱]: string,
[商品圖片]: string(URL),
[商品規格描述(數量)]: int,
[商品規格描述(單位)]: string,
[商品價格]: int,
[商品數量]: int,
}
```
### ATM資料
```
{
BankCode: string,
Account: string,
ExpireDate: string
[銀行代碼]: string,
[匯款虛擬帳號]: string,
[繳款期限]: string,
}
```
### 簡易訂單資訊
```
{
OrderNumber: string,
PaymentType: int,
PaymentStatus: int, (1:未付款, 2:已付款)
OrderStartDate: DateTime,
OrderEndDate: DateTime,
CreateDate: DateTime,
Sub_week: int,
Subscribe: int,
ProductsPreview: ProductsPreview{}
[訂單編號]: int,
[付款方式]: int,
[付款狀態]: int,
[出貨起始日期]: DateTime,
[出貨結束日期]: DateTime,
[訂單建立日期]: DateTime,
[箱類訂單目前週數]: int,
[箱類訂單總週數]: int,
[商品資訊]: 商品規格預覽(第一筆)
}
```
### 詳細訂單資訊
[ATM資料](#ATM資料)
[收件人資料](#收件人資料)
[商品規格預覽](#商品規格預覽)
```
{
OrderNumber: string,
Status: int,
CreateDate: DateTime,
PaymentType: int,
DeliveryNumber: string,
DeliveryType: int,
DeliveryPicture: string,
TotalPrice: int,
DiscountPrice: int,
DeliveryCharge: int,
ShippingFee: int,
InvoiceNumber: string,
OrderStartDate: DateTime,
OrderEndDate: DateTime,
PaymentStatus: int, (1:未付款, 2:已付款)
IsPauseable: bool,
ATM: ATM?,
Receiver: Receiver,
ProductsPreview: [ProductsPreview{}]
[訂單編號]: int,
[訂單狀態]: int,
[訂購日期]: Date(String | int),
[付款方式]: int,
[物流編號]: int,
[物流方式]: int,
[訂單金額]: int,
[折扣金額]: int,
[物流代收費]: int,
[運費]: int,
[發票號碼]: string,
[出貨時間]: DateTime,
[付款狀態]: int,
[是否可暫停之訂單]: bool,
[ATM資料]: ATM資料,
[收件人資料]: 收件人資料,
[商品資訊]: [商品規格預覽]
}
```
### 購物車商品
[商品規格及庫存](#商品規格及庫存)
```
{
CartItem: 商品規格及庫存,
Quantity: int,
}
```
## 商品
### 首頁輪播圖
- Method: **GET**
- Endpoint: /Home/Banners
- Response
```
[
{
MobileBanner: String(URL),
MobileBanner2x: String(URL),
MobileBanner3x: String(URL),
MobileBanner4x: String(URL)
}
]
### 各產線輪播圖
- Method: **GET**
- Endpoint: /Home/Banners
- Query
- CategoryType: int
- Response
```
[
{
MobileBanner: String(URL),
MobileBanner2x: String(URL),
MobileBanner3x: String(URL),
MobileBanner4x: String(URL)
}
]
````
### 商品分類
- Method: **GET**
- Endpoint: /Product/Category
- - Query
- Response
```
[
{
Type: int,
TypeName: string,
SubCategorys: [
{
SubType: int,
SubTypeName: string
}
]
}
]
```
### 商品子分類
- Method: **GET**
- Endpoint: /Product/SubCategory
- - Query
- Category: int (商品分類)
- Response
```
[
{
SubType: int, ( > 0)
SubTypeName: string
}
]
```
### 商品清單(V1)
- Method: **GET**
- Endpoint: /Product/List
- Query (不帶 Query, 回傳首頁主打商品)
- Category: int (商品分類)
- SubCategory: int (商品子分類)(可為null,則不包含子分類)
- Response
```
[
簡易商品資訊
]
```
\# [簡易商品資訊](#商品卡片(簡易商品資訊))
### 商品關鍵字列表
- Method: **GET**
- Endpoint: /Product/Keywords
- Response
```
[
{
Name: string,
}
]
```
### 箱類頁面資料
- Method: **GET**
- Endpoint: /Product/Box
- Response
```
{
SubType: int,
Menu: [string], // 當週、下週
Wording:
[
{
Header: string,
Body: [string],
}
]
}
```
### 商品搜尋
- Method: **GET**
- Endpoint: /Product/Search
- Query
- SearchString: string
- Response
```
[
簡易商品資訊
]
```
\# [簡易商品資訊](#商品卡片(簡易商品資訊))
### 商品資訊(詳細商品資訊)
- Method: **GET**
- Endpoint: /Product/Data
- Query
- ProductId: int
- Response
```
{
ProductId: int,
Name: string,
Pictures: [string(URL)], // 圖片數量(全部)(絕對路徑(https://.....))
MinPrice: int,
MaxPrice: int,
CategoryType: int,
TemperatureType: int,
Module: string,
OriginPlace: string,
Ranking: float, (eg. x.x)
ShippingFee: int,
ShippingThreshold: int,
Remind: string,
Spec: string,
Preserve: string,
Content: string(HTML),
PlaceStory: string(HTML),
CommentCount: int,
SoldCount: int,
ProductDetail: [string] // 規格(eg. x包(x入))
}
```
### 商品規格及庫存列表
- Method: **GET**
- Endpoint: /Product/Detail
- Query
- ProductId: int
- Response
```
[
{
ProductId: int,
ProductDetailId: int,
CategoryType: int,
SubCategoryType: int,
TemperatureType: int,
Module: string,
Detail: string,
Price: int,
DiscountPrice: int?,
StockCount: int,
IsShipping: bool,
IsAvailable: bool,
HasTax: bool,
ExportStartDate: DateTime?,
ExportEndDate: DateTime?,
StartTime: DateTime?,
EndTime: DateTime?,
MinimumPrice: int (滿額限購商品 >0須判斷),
IsLimitedOnePackForOneAccount: bool (超殺商品)
VIPLevelId: [int]
}
]
```
\# [商品規格及庫存](#商品規格及庫存)
### 檢查商品庫存
- Method: **POST**
- Endpoint: /Product/Stock
- Body (JSON)
```
{
CartData: [
ProductDetailId: int
]
}
```
- Response
```
{
Code: string,
Message: string,
Data: [
{
ProductDetailId: int,
ProductName: string,
ProductDetailName: string,
StockCount: int,
}
]
}
```
- Code
- SUCCESS
### 檢查箱類價格(身分驗證)
- Method: **POST**
- Endpoint: /Product/BoxProperty
- Body (JSON)
```
{
CartData: [
ProductDetailId: int
]
}
```
- Response
```
{
Code: string,
Message: string,
Data: [
{
ProductDetailId: int,
Price: int
}
]
}
```
- Code
- SUCCESS
### 商品評論列表
- Method: **GET**
- Endpoint: /Product/Comments
- Query
- ProductId: int
- Page: int,
- Size: int
- Response
```
[
商品評論
]
```
\# [商品評論](#商品評論)
## 結帳購物車
### 產線運費(免運條件)
- Method: **GET**
- Endpoint: /Product/Shipping
- Query (不帶Query, 列出全部)
- Category: int
- Response
```
[
{
CategoryType: int,
ShippingFee: int,
ShippingThreshold: int,
OutTaiwan: boolean,
}
]
```
### 結帳加購
- Method: **Post**
- Endpoint: /Order/ExtraProduct
- Body (JSON)
```
[
{
"CartItem": {
"ProductId": int,
"ProductDetailId": 55023,
"CategoryType": 9,
"SubCategoryType": 2,
"TemperatureType": 3,
"Module": "組",
"Detail": "1組(2入,150克/入)",
"Price": 160,
"DiscountPrice": 160,
"StockCount": 1912,
"IsShipping": false,
"IsAvailable": true,
"HasTax": true,
"ExportStartDate": "2021-03-16T00:00:00",
"ExportEndDate": null,
"Name": "大寶寶 金時瓜瓜鯛魚粥",
"Picture": "https://greenbox.azureedge.net//upload/Product_3033/202005200917141.jpg"
},
"Quantity": 1
}
]
```
- Response
```
[
{
"ProductId": 57890,
"ProductDetailId": 82493,
"CategoryType": 9,
"SubCategoryType": 5,
"TemperatureType": 3,
"Name": "超值加購 小寶寶-南瓜米糊",
"Picture": "https://greenbox.tw//upload/Product_3033/202009251011401.png",
"Unit": 1,
"Module": "組",
"Detail": "3入,90克/入",
"Price": 120,
"DiscountPrice": 100,
"StockCount": 23,
"IsShipping": false,
"IsAvailable": true,
"HasTax": true,
"ExportStartDate": "2021-10-07T00:00:00",
"ExportEndDate": null
}
]
```
\# [加購](#加購)
### 折扣碼(身份驗證)
- Method: **POST**
- Endpoint: /Order/PromoCode
- Body (JSON)
```
{
PromoCode: string,
ShoppingCart: [
購物車商品
]
}
```
- Response
```
{
Code: string,
Message: string,
Data: {
Discount: int,
}
}
```
- Code
- SUCCESS
- ERROR_NOT_FOUND
- ERROR_NOT_YET
- ERROR_EXPIRED
- ERROR_NOT_AVAILABLE
- ERROR_INVALID_FORMAT
- ERROR_SPECIFIC_PRODUCT
- ERROR_SPECIFIC_CATEGORY
- ERROR_PRICE_LIMIT
- ERROR_USED
\# [購物車商品](#購物車商品)
### 物流及付款方式列表
- Method: **POST**
- Endpoint: /Order/Options
- Body (JSON)
```
[
購物車商品
]
```
- Response
```
{
Code: string,
Message: string,
Data: {
Delivery:[
{
Type: int,
Name: string,
Payment:[
{
Type: int,
Name: string,
Fee: int
}
]
}
]
全部舉例出來
[物流方式]: [
{
[物流方式]: int,
[物流名稱]: string,
[物流代收費]: int,
[付款方式]: [
{
[付款方式]: int,
[付款名稱]: string,
}
]
}
],
}
}
```
\# [購物車商品](#購物車商品)
### 離島及當日配狀態
- Method: **GET**
- Endpoint: /Order/AddressStatus?ZipCode=
- Query
- Response
```
{
IsOutTaiwan: boolean,
IsSameDay: boolean
}
```
\# [購物車商品](#購物車商品)
### 離島及當日配狀態
- Method: **POST**
- Endpoint: /Order/AddressStatus_v2?ZipCode=
- Query
- CartData : []
- Response
```
{
IsOutTaiwan: boolean,
IsSameDay: boolean,
LastArrivalTime: string
}
```
\# [購物車商品](#購物車商品)
### 常用收件人(身份驗證)
- Method: **GET**
- Endpoint: /Member/CommonReceiver
- Response
```
[
收件人資料
]
```
\# [收件人資料](#收件人資料)
### 加入常用收件人(身份驗證)
- Method: **POST**
- Endpoint: /Member/CommonReceiver
- Body (JSON)
```
{
收件人資料,
IsDefaultAddress: bool
}
```
- Response
```
{
Code: string,
Message: string,
Data: {
ReceiverId: int
}
}
```
- Code
- SUCCESS
- ERROR_OUT_OF_NUMBER
\# [收件人資料](#收件人資料)
### 更新常用收件人(身份驗證)
- Method: **PUT**
- Endpoint: /Member/CommonReceiver
- Body (JSON)
```
{
收件人資料
IsDefaultAddress: bool
}
```
- Response
```
{
Code: string,
Message: string,
Data: null
}
```
- Code
- SUCCESS
- ERROR_NOT_FOUND
\# [收件人資料](#收件人資料)
### 刪除常用收件人(身份驗證)
- Method: **DELETE**
- Endpoint: /Member/CommonReceiver
- Query
- ReceiverId : int
- Response
```
{
Code: string,
Message: string,
Data: null
}
```
- Code
- SUCCESS
- ERROR_NOT_FOUND
### 運費(身份驗證)
- Method: **POST**
- Endpoint: /Order/ShippingFee
- Body (JSON)
```
[購物車資料]
```
- Response
```
{
TotalInnerLandShipping: number,
TotalOuterLandShipping: number,
SameDayDiscount: number,
SameDayDescription: number,
DetailInfo:[
{
CategoryType: int,
TemperatureType: int,
InnerLandShipping: int,
OuterLandShipping: int,
Description: string
}
]
[一般運費]: number,
[離島運費]: number,
[當日配運費]: number,
[當日配說明]: String,
[詳細資訊]: [{
[產線]: int,
[溫層]: int,
[一般運費]: number,
[離島運費]: number,
[說明]: String
}]
}
```
- Code
- SUCCESS
\# [購物車商品](#購物車商品)
### 結帳並取得付款資訊(身份驗證)
- Method: **POST**
- Endpoint: /Order/Checkout
- Body (JSON)
```
{
CartData: [購物車資料],
MemberReceiver: {收件人資訊},
Buyer:{
Name: string,
Mobile: string
},
Discount: {
Total: int,
// 金額
Bonus: int,
Coupon: int (?)
Redpoint: int,
Promo: int, (?)
// 碼
PromoCode: string,
CouponId: int,
},
Invoice: {
Type: int, (0: 捐贈發票, 1: 二聯式, 2: 三聯式)
Email: string,
CarrierType: int, (2: 自然人載具, 3: 手機載具)
CarrierNumber: string,
CompanyName: string,
CompanyUniformNumber: string, 統編
CompanyEmail: string,
CompanyReceiverName: string,
CompanyCounty: string,
CompanyDistrict: string,
CompanyAddress: string
},
FamiPickUpReturn: {
ReturnCode:"api9101",
Message:"",
Data:{
"CvsTemp":"mvlbyid15hrdicyjs5cpkmer",
"StoreId":"017897",
"Name":"全家大溪三本店",
"Addr":"桃園市大溪區仁善街182﹑186號",
"Items":[
{
"ChanItem":"9",
"ReservedNo":"21090300000007825966",
"OrderDate":"2021-09-17",
"ShipDate":"2021-09-18"
}
]
}
},
TotalPrice: int,
DeliveryType: int,(1: 自取, 3: 黑貓, 4: 全家)
ReceiveType: int, (1: 13時前, 2: 14時~18時, 5:當日配)
PaymentType: int, (0: 信用卡, 2: 貨到付款, 3: 現金自取)
SingleItemArrivedType: int(0: 不指定, 1: 平日收貨, 2: 假日收貨)
Remark: string,
IsDisplayBuyerName: int, (0: 不顯示購買者, 1: 送禮顯示購買者),
IsCollectByGuard: int, (0: 否, 1: 是)
IsContactReceiver: int,(0: 否, 1: 是)
IsRecycle: int, (0: 否, 1: 是)
OrderOrigin: int, (1: 前台, 2: 後台, 3: APP)
}
```
- Response
```
{
Code: string,
Message: string,
Data: {
EcpayToken: string, (跟綠界有關才會有值)
OrderNumber: string
}
}
```
- Code
- SUCCESS
- ERROR_NOT_AVAILABLE_STOCK (庫存不足)
- ERROR_CALCULATE (金額比對錯誤)
- ERROR_OFF_SHELF (產品已下架)
\# [購物車商品](#購物車商品)
\# [收件人資料](#收件人資料)
### 產生全家電子地圖所需資料
- Method: **Post**
- Endpoint: Order/FamiOrderDetail
- Body (JSON)
```
[
{
"CartItem": {
"ProductId": 44249,
"ProductDetailId": 55023,
"CategoryType": 9,
"SubCategoryType": 2,
"TemperatureType": 3,
"Module": "組",
"Detail": "1組(2入,150克/入)",
"Price": 160,
"DiscountPrice": 160,
"StockCount": 1912,
"IsShipping": false,
"IsAvailable": true,
"HasTax": true,
"ExportStartDate": "2021-03-16T00:00:00",
"ExportEndDate": null,
"Name": "大寶寶 金時瓜瓜鯛魚粥",
"Picture": "https://greenbox.azureedge.net//upload/Product_3033/202005200917141.jpg"
},
"Quantity": 1
}
]
```
- Response
```
{
"CvsName": "greenbox.tw",
"CvsLink": "https://gb-dev-4.azurewebsites.net/api/Order/FamiOrderReceive",
"CvsTemp": "0d4ac3b888c6458d",
"Cvsid": "0",
"Exchange": "true",
"RcvOldStoreId": null,
"Items": [
{
"ParentId": "567",
"EshopId": "0001",
"ChanItem": "9",
"EshopType": "9",
"Length": 30.0,
"Wide": 30.0,
"High": 45.0,
"Weight": 0.0,
"Qty": 1,
"StartDate": "2021-09-17",
"EndDate": "2021-09-19"
}
]
}
```
### 取得全家門市資訊
- Method: **Get**
- Endpoint: Order/FamiStoreInfo
- Query
- cvsTemp: string,
- Response
```
{
Code: string,
Message: string,
Data: {
ReturnCode:"api9101",
Message:"",
Data:{
"CvsTemp":"mvlbyid15hrdicyjs5cpkmer",
"StoreId":"017897",
"Name":"全家大溪三本店",
"Addr":"桃園市大溪區仁善街182﹑186號",
"Items":[
{
"ChanItem":"9",
"ReservedNo":"21090300000007825966",
"OrderDate":"2021-09-17",
"ShipDate":"2021-09-18"
}
]
}
}
}
```
- Code
- SUCCESS
- ERROR_NOT_EXIST (門市資訊不存在)
### ATM紀錄(身份驗證)
- Method: **POST**
- Endpoint: /Order/EcPayATM
- Body (JSON)
```
{
MerchantTradeNo: string,
RtnMsg: string,
RtnCode: int,
TradeNo: string,
TradeAmt: decimal,
TradeDate: string,
BankCode: string,
vAccount: string,
ExpireDate: string
}
```
### 重新刷卡並取得付款資訊(身份驗證)
- Method: **POST**
- Endpoint: /Order/RePayCheckout
- Body (JSON)
```
{
OrderNumber: string,
OrderOrigin: int, (1: 前台, 2: 後台, 3: APP)
}
```
- Response
```
{
Code: string,
Message: string,
Data: {
EcpayToken: string
}
}
```
- Code
- SUCCESS
### 依照主單編號查詢訂單資訊
- Method: **GET**
- Endpoint: /Order/Checkout
- Query
- OrderNumber
- Response
```
[
{
ProfilePicture: string,
OrderNumber: string,
OrderDetail:
{
PaymentType: string,
DeliveryType: string,
CreateDate: DateTime,
OrderItemList: string
}
}
]
```
- Code
- SUCCESS
- ERROR_NOT_EXISTED // 無此訂單編號
## 會員
### 會員資料(身份驗證)
- Method: **GET**
- Endpoint: /Member/Data
- Response
```
會員資料
```
\# [會員資料](#會員資料)
### 購物金紀錄(身份驗證)
- Method: **GET**
- Endpoint: /Member/Bonus
- Query
- Page: int,
- Size: int
- Response
```
[
購物金紀錄
]
```
\# [購物金紀錄](#購物金紀錄)
### 紅利點數紀錄(身份驗證)
- Method: **GET**
- Endpoint: /Member/Redpoint
- Query
- Page: int,
- Size: int
- Response
```
{
RedpointRecord: [紅利點數紀錄],
ExpiringPoint: int,
ExpiringTime: DateTime,
}
```
\# [紅利點數紀錄](#紅利點數紀錄)
### 優惠卷列表(身份驗證)
- Method: **GET**
- Endpoint: /Member/Coupon
- Query
- Page: int,
- Size: int
- Response
```
[
優惠卷
]
```
\# [優惠卷](#優惠卷)
### 兌換卷列表(身份驗證)
- Method: **GET**
- Endpoint: /Member/Voucher
- Query
- Page: int
- Size: int
- Response
```
[
{
TicketId: int,
Name: string,
Quantity: int,
ProductId: int,
ProductDetailId: int,
ProductPrice: int,
ProductImage: string(URL),
ProductDetail: string,
ProductCategoryType: int,
ProductTemperatureType: int,
ProductExportStartDate: DateTime,
ProductExportEndDate: DateTime,
}
]
```
\# [簡易商品資訊](#商品卡片簡易商品資訊)
\# [商品規格及庫存](#商品規格及庫存)
### 訂單資訊(身份驗證)
- Method: **GET**
- Endpoint: /Member/OrderData
- Query
- OrderStatus: int,
(0:處理中,1:已出貨,2:已送達,3:已取消)
- Page: int,
- Size: int
- Response
```
[
簡易訂單資訊
]
```
\# [簡易訂單資訊](#簡易訂單資訊)
### 訂單資訊(身份驗證)
- Method: **GET**
- Endpoint: /Member/OrderDetail
- Query
- OrderNumber: string
- Response
```
[
詳細訂單資訊
]
```
\# [詳細訂單資訊](#詳細訂單資訊)
### 更改密碼(身份驗證)
- Method: **POST**
- Endpoint: /Member/ResetPassword
- Body (JSON)
```
{
NewPassword: string
[新密碼]: string,
[設備識別(IMEI...)]: string,
}
```
- Response
```
{
Code: string,
Message: string,
Data: {}
}
```
- Code
- SUCCESS
- ERROR_NOT_FOUND (查無使用者)
### 會員資料設定(身份驗證)
- Method: **PUT**
- Endpoint: /Member/Data
- Body (JSON)
```
{
Name: string,
Email: string,
Sex: int (女 0, 男 1),
Birth: string(YYYY-MM-DD),
Receipt: string,
[姓名(暱稱)]: string, (optional)
[Email]: string, (optional)
[性別]: int, (optional)
[生日]: Date(String | int), (optional)
[載具]: String, (optional)
}
```
- Response
```
{
Code: string,
Message: string,
Data: {}
}
```
- Code
- SUCCESS
- ERROR
### 登入
- Method: **POST**
- Endpoint: /Token/SignInFrontEnd
- Body (JSON)
```
{
Username: string,
Password: string,
DeviceToken: string
[帳號(手機號碼)]: string,
[密碼]: string, // Hash
[設備識別(IMEI...)]: string, (defer...)
}
```
- Response
```
{
Code: string,
Message: string,
Data: {
AccessToken: string,
RefreshToken: string,
ExpireDate: Datetime,
}
}
```
- Code
- SUCCESS
- ERROR // 帳號對、密碼錯誤
- ERROR_USER_DISABLED // 停用(黑名單)
- ERROR_USER_DELETED // 已刪除
- ERROR_USER_NOT_EXISTED // 使用者不存在
### 刷新Token(身份驗證)
- Method: **GET**
- Endpoint: /Token/Refresh
- Query
- RefreshToken: string
- Response
```
{
Code: string,
Message: string,
Data: {
AccessToken: string,
RefreshToken: string,
ExpireDate: Datetime,
}
}
```
- Code
- SUCCESS
- ERROR_TOKEN_NOT_EXISTED // Refresh Token 不存在
### 傳送手機驗證碼
- Method: **POST**
- Endpoint: /Member/SendCode
- Body (JSON)
```
{
Mobile: string,
[手機號碼]: string,
}
```
- Response
```
{
Code: string,
Message: string,
Data: {
ExpireDate: Datetime,
}
}
```
- Code
- SUCCESS
- ERROR_USER_EXISTED
### 驗證手機驗證碼
- Method: **POST**
- Endpoint: /Member/VerifiedCode
- Body (JSON)
```
{
Mobile: string,
Code: string
[手機號碼]: string,
[手機驗證碼]: string,
}
```
- Response
```
{
Code: string,
Message: string,
Data: {
VerifiedId: int,
}
}
```
- Code
- SUCCESS
- ERROR_VERIFY_FAIL (驗證碼失效or錯誤)
### 註冊(手機驗證碼)
- Method: **POST**
- Endpoint: /Member/SignUp
- Body (JSON)
```
{
Account: string,
VerifiedId: int,
VerifiedCode: string,
Password: string (hash),
Name: string,
Email: string | null,
Sex: int (女 0, 男 1) | null,
Birthday: string(YYYY-MM-DD) | null
[帳號(手機號碼)]: string,
[驗證碼token]: int,
[驗證碼]: string,
[密碼]: string, // Hash?
[姓名(暱稱)]: string,
[Email]: string, (optional)
[性別]: int, (optional)
[生日]: Date(String | int), (optional)
}
```
- Response
```
{
Code: string,
Message: string,
Data: {}
}
```
- Code
- SUCCESS
- ERROR_VERIFY_FAIL (驗證失敗)
- ERROR_INSERT_FAIL (新增會員失敗)
### 忘記密碼
- Method: **GET**
- Endpoint: /Member/ForgotPassword
- Query
- Mobile: string
- Response
```
{
Code: string,
Message: string,
Data: {}
}
```
- Code
- SUCCESS
- ERROR_USER_DISABLED // 停用(黑名單)
- ERROR_USER_DELETED // 已刪除
- ERROR_USER_NOT_EXISTED // 使用者不存在
### 取得會員訊息分類(身份驗證)
- Method: **GET**
- Endpoint: /Notification/Categories
- Response
```
[
{
Id: int,
UnReadCount: int,
[分類Id]: int,
[分類未讀數量]: int,
},
]
```
### 取得會員訊息項目(身份驗證)
- Method: **GET**
- Endpoint: /Notification/Items
- Query
- CategoryId: int
- Page: int
- Size: int
- Response
```
[
{
NotificationId:int,
Code: string,
Header: string,
Body: string,
Image: string,
OrderNumber: string,
IsRead: boolean,
SentTime: datetime
[訊息Id]: int,
[路徑參數]: string,
[標題]: string,
[內容]: string,
[圖片]: string,
[訂單編號]: string, (路徑為null,才會有值)
[已讀]: boolean,
[發送時間]: datetime (排序最新在前)
},
]
```
### 新增DeviceToken(身份驗證)
- Method: **POST**
- Endpoint: FCM/Token
- Query
- DeviceToken: string
- Response
```
{
Code: string,
Message: string,
Data: {}
}
```
- Code
- SUCCESS
### 刪除DeviceToken(身份驗證)
- Method: **POST**
- Endpoint: FCM/DeleteToken
- Response
```
{
Code: string,
Message: string,
Data: {}
}
```
- Code
- SUCCESS
### 2022新農食運動資料(身份驗證)
- Method: **GET**
- Endpoint: NewFarming/Data
- Response
```
{
IsSignin: bool, [是否簽到]
OrderCount: int, [活動期間成立訂單總數]
Ticket: int, [抽獎券]
Prize: int, [總獎金池]
Products: [
{
ProductId: int,
ProductDetailId: int,
Name: string,
Picture: string,
SoldOutPicture: string,
IsSoldOut: bool
Price: int,
DiscountPrice: int,
SearchString: string
}
]
},
```
### 2022新農食運動簽到(身份驗證)
- Method: **POST**
- Endpoint: NewFarming/Signin
- Response
```
{
Code: string,
Message: string,
Data: {
Point: int [簽到紅利]
Prize: int [總獎金池]
}
}
```
- Code
- SUCCESS
- ERROR_RECORD_EXISTED