Skip to content

Update Shops Setting

Description

批次更新門市設定檔,包含基本資訊、營業時間、休假日、外送距離門檻及UI視覺設定。

Resource

PATCH /v1/basic/update-shops-setting

Authorization

採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login

Request Body Parameters

Name Type Description
shops array 門市設定陣列(必填)
shops[].shop_id string 門市編號(必填)
shops[].shop_name string 門市名稱
shops[].shop_nickname string 門市暱稱
shops[].code string 門市代碼
shops[].taxno string 統一編號
shops[].tel string 電話
shops[].fax string 傳真
shops[].zip string 郵遞區號
shops[].address string 地址
shops[].shop_ip string 門市 IP
shops[].port string 連接埠
shops[].shop_kind integer 門市類型
shops[].prcarea_id string 價格區域編號
shops[].brand_id string 品牌編號
shops[].shipset_aid string 出貨設定編號
shops[].prod_model string 產品型號
shops[].gid string 群組編號
shops[].pstarea_id integer 郵遞區域編號
shops[].pstarea_sno integer 郵遞區域序號
shops[].longitude decimal 經度
shops[].latitude decimal 緯度
shops[].storeHours object 營業時間設定
shops[].storeHours.{day} object 星期營業設定 (monday~sunday)
shops[].storeHours.{day}.isOpen boolean 是否營業
shops[].storeHours.{day}.periods array 營業時段陣列
shops[].storeHours.{day}.periods[].start string 開始時間 (HH:mm 格式)
shops[].storeHours.{day}.periods[].end string 結束時間 (HH:mm 格式)
shops[].customClosedDates array 自訂休假日陣列 (YYYY-MM-DD 格式)
shops[].delivery_distance_thresholds array 外送距離門檻設定陣列
shops[].delivery_distance_thresholds[].distance_km decimal 距離(公里)
shops[].delivery_distance_thresholds[].min_amount integer 最低消費金額
shops[].delivery_distance_thresholds[].extra_delivery_fee integer 額外運費
shops[].ui_visual_setting object 門市UI視覺設定
shops[].ui_visual_setting.primary_color string 主要色
shops[].ui_visual_setting.secondary_color string 次要色
shops[].ui_visual_setting.store_image string 門市圖片
shops[].ui_visual_setting.menu_page_image string 菜單頁圖片

Request Body Example

{
  "shops": [
    {
      "shop_id": "000030",
      "shop_name": "台北訓練機",
      "shop_nickname": "台北訓練機",
      "code": "TP001",
      "taxno": "12345678",
      "tel": "02-12345678",
      "fax": "02-87654321",
      "zip": "100",
      "address": "台北市中正區test路100號",
      "shop_ip": "192.168.1.100",
      "port": "8080",
      "shop_kind": 1,
      "prcarea_id": "001",
      "brand_id": "B001",
      "shipset_aid": "S001",
      "prod_model": "PM001",
      "gid": "G001",
      "pstarea_id": 1,
      "pstarea_sno": 1,
      "longitude": 121.2825580402,
      "latitude": 25.0098413255,
      "storeHours": {
        "monday": {
          "isOpen": true,
          "periods": [
            {
              "start": "08:00",
              "end": "12:00"
            },
            {
              "start": "13:00",
              "end": "18:00"
            }
          ]
        },
        "tuesday": {
          "isOpen": true,
          "periods": [
            {
              "start": "08:00",
              "end": "12:00"
            },
            {
              "start": "13:00",
              "end": "18:00"
            }
          ]
        },
        "wednesday": {
          "isOpen": false,
          "periods": []
        },
        "thursday": {
          "isOpen": true,
          "periods": [
            {
              "start": "08:00",
              "end": "12:00"
            },
            {
              "start": "13:00",
              "end": "18:00"
            }
          ]
        },
        "friday": {
          "isOpen": true,
          "periods": [
            {
              "start": "08:00",
              "end": "12:00"
            },
            {
              "start": "13:00",
              "end": "18:00"
            }
          ]
        },
        "saturday": {
          "isOpen": true,
          "periods": [
            {
              "start": "13:00",
              "end": "18:00"
            }
          ]
        },
        "sunday": {
          "isOpen": true,
          "periods": [
            {
              "start": "13:00",
              "end": "18:00"
            }
          ]
        }
      },
      "customClosedDates": [
        "2025-08-12",
        "2025-09-11",
        "2025-10-01",
        "2025-12-25"
      ],
      "delivery_distance_thresholds": [
        {
          "distance_km": 5.0,
          "min_amount": 300,
          "extra_delivery_fee": 50
        },
        {
          "distance_km": 8.0,
          "min_amount": 500,
          "extra_delivery_fee": 0
        }
      ],
      "ui_visual_setting": {
        "primary_color": "#FF5733",
        "secondary_color": "#FF5733",
        "store_image": "https://example.com/banner.jpg",
        "menu_page_image": "https://example.com/logo.jpg"
      }
    }
  ]
}

Response

Status-Code: 200 OK

Response Body Parameters

Name Type Description
message string 回應訊息
inserted_count integer 新增門市數量
inserted_shops array 新增成功的門市編號陣列
updated_count integer 更新門市數量
updated_shops array 更新成功的門市編號陣列
failed_count integer 失敗門市數量
failed_shops array 失敗的門市資訊陣列
failed_shops[].shop_id string 失敗的門市編號
failed_shops[].error string 失敗原因

Response Body Example

{
  "message": "門市設定更新完成",
  "inserted_count": 0,
  "inserted_shops": [],
  "updated_count": 1,
  "updated_shops": ["000030"],
  "failed_count": 0,
  "failed_shops": []
}