# Sample API doc of ECPayData
## 建立新訂單
發出建立訂單請求,並回傳訂單編號與狀態碼。
### 請求網址
https://beta.ecpaydata.com.tw/data-api
### 請求參數
| 欄位 | 格式 | 必填 | 說明 |
| ------------ | ------- | -------------- | ------------------------------------------------------ |
| act | string | * | 預設帶入: add_order |
| uid | string | | 若留空並且用戶已登入,會帶入 SESSION的uid值 (UUID格式) |
| fullname | string | * | 客戶姓名 |
| email | string | * | 客戶 Email |
| phone | string | * | 客戶手機號碼 |
| use_tax | integer | * | 發票類型 <br>個人: 0 <br>公司: 1 |
| payment_type | string | * | 付款方式 <br>轉帳: transfer <br>綠界ATM(5萬以內): ATM |
| tags | string | | tags逗點隔開 |
| amount | integer | * | 訂單總金額 |
| tax_title | string | if use_tax=1 * | 發票 - 公司抬頭 |
| tax_number | integer | if use_tax=1 * | 發票 - 公司統編 |
| address_zip | integer | if use_tax=1 * | 發票 - 郵遞區號 |
| address_city | integer | if use_tax=1 * | 發票 - 縣市 |
| address_dist | integer | if use_tax=1 * | 發票 - 地區 |
| address_detail | integer | if use_tax=1 * | 發票 - 地址 |
| order_items | array | * | 訂單品項(陣列參考如下) |
### order_items 請求陣列
*陣列需至少包含1筆品項*
| 欄位 | 格式 | 必填 | 說明 |
| ---------- | ------ | ---- | -------- |
| item_name | string | * | 品項名稱 |
| item_price | integer | * | 單價 |
| item_qty | integer | * | 數量 |
範例如下
```json=
{
"uid": "uuid",
"fullname": "客戶姓名",
"use_tax": 1,
"tax_title": "XX有限公司",
"tax_number": 00000000,
"payment_type": "transfer",
"order_items": [
{
"item_name" : "商品1",
"item_price" : 1000,
"item_qty" : 1
},
{
"item_name" : "商品2",
"item_price" : 2000,
"item_qty" : 2
},
],
"tags": "tag1,tag2,tag3",
"amount": 5000
}
```
---
## 查詢訂單明細
還沒做好
## 訂單列表
還沒做好