發送通知/取得發票通知方式設定(開發中)

使用流程說明

特店系統可使用此API來取得目前廠商後台的電子發票通知開關設定

應用場景

適用於取得目前廠商後台電子發票通知開關設定內容

API介接網址

  • 測試環境:https://einvoice-stage.ecpay.com.tw/B2CInvoice/GetInvoiceNotifySetting
  • 正式環境:https://einvoice.ecpay.com.tw/B2CInvoice/GetInvoiceNotifySetting

HTTPS傳輸協定

  • Content Type :application/json
  • HTTP Method :POST

特店傳入參數(Json格式)

PlatformID String(10)
特約合作平台商代號

  • 這個參數是專為與綠界簽約的指定平台商所設計,只有在申請開通後才能使用。
  • 如果您是一般廠商,請在介接時將此參數欄位保留為空。
  • 對於平台商,在使用時需要在MerchantID(特店編號)欄位中填入與您已經完成綁定子廠商的MerchantID(特定編號)。
    請注意,只能使用已綁定的子廠商編號,以避免操作失敗。綁定作業請洽所屬業務。

MerchantID String(10)
特店編號 必填

RqHeader Object
傳入資料 必填

Timestamp Number
傳入時間 必填

請將傳輸時間轉換為時間戳(GMT+8),綠界會利用此參數將當下的時間轉為Unix TimeStamp來驗證此次介接的時間區間。

❗ 注意事項

  • 驗證時間區間暫訂為 10 分鐘內有效,若超過此驗證時間則此次訂單將無法建立,參考資料:http://www.epochconverter.com/
  • 合作特店須進行主機「時間校正」,避免主機產生時差,導致API無法正常運作。

Data String
加密資料 必填

此為加密過JSON格式的資料。加密方法說明

特店傳入參數範例(Json格式)

				
					{
    "MerchantID": "2000132",
    "RqHeader": {
        "Timestamp": 1525168923
    },
    "Data": "加密資料"
}

				
			

Data參數說明(Json格式): 請先將Json字串進行urlencode後再進行AES加密

MerchantID String(10)
特店編號 必填

Data參數範例(Json格式)

				
					{
  "MerchantID": "2000132"
}
				
			

綠界回傳參數格式

  • Content Type :application/json
  • HTTP Method :POST

綠界回傳參數(Json格式)

PlatformID String(10)
特約合作平台商代號

MerchantID String(10)
特店編號 

RpHeader Object
回傳資料 

Timestamp Number
回傳時間

Unix timestamp(GMT+8)

TransCode Int
回傳代碼 

1 代表 API 傳輸資料(MerchantID, RqHeader, Data)接收成功,實際的 API 執行結果狀態請參考 RtnCode

TransMsg String(200)
回傳訊息 

Data String
加密資料 

回傳相關資料,此為加密過JSON格式的資料。加密方法說明

綠界回傳參數範例

				
					{
    "MerchantID": "2000132",
    "RpHeader": {
        "Timestamp": 1525169058
    },
    "TransCode": 1,
    "TransMsg": "",
    "Data": "加密資料"
}

				
			

Data參數說明(Json格式) : 請先將Data進行AES解密後再做urldecode

RtnCode Int
回應代碼

1 代表 API 執行成功,其餘代碼均為失敗。

RtnMsg String(200)
回應訊息

CostomerSetting Array[Object]
發送通知給消費者

NotifyType String(1)
通知類別

1:開立, 2:作廢, 3:折讓, 4:折讓作廢, 5:註銷, 6:中獎

NotifySwitch String(1)
通知方式開關設定

0:關閉
1:僅以Email通知
2:僅以簡訊通知
3:優先以Email通知 (無Email者自動改以簡訊通知)
4:優先以簡訊通知 (無手機號碼者自動改以Email通知)
5:Email及簡訊皆通知

NotifyName String(?)
通知類別名稱

SelfSetting Array[Object]
發送通知給自己

NotifyType String(1)
通知類別

1:開立, 2:作廢, 3:折讓, 4:折讓作廢, 5:註銷, 6:中獎, 7:開立失敗, 8:消費者索取紙本

NotifySwitch String(1)
通知方式開關設定

0:關閉, 1:開啟

NotifyName String(?)
通知類別名稱

EmailSetting String(?)
通知Email

發送通知給自己的通知Email
※多組email請以半形分號(;)分隔

Data參數範例

				
					{
   "RtnCode": 1,
   "RtnMsg": "Success",
   "CostomerSetting": [
        {
            "NotifyType": "1",
            "NotifySwitch": "1",
            "NotifyName": "開立"
        },
        {
            "NotifyType": "2",
            "NotifySwitch": "1",
            "NotifyName": "作廢"
        }
   ],
   "SelfSetting": [
        {
            "NotifyType": "1",
            "NotifySwitch": "1",
            "NotifyName": "開立"
        },
        {
            "NotifyType": "2",
            "NotifySwitch": "1",
            "NotifyName": "作廢"
        }
   ],
   "EmailSetting": "aa@aa.aa;bb@bb.bb"
}
				
			

YAML

提供的 YAML 文件用於定義 API 的配置、結構、操作和基礎設施管理等資訊,方便開發人員理解和使用 API。

				
					openapi: 3.1.0
info:
  title: 發送通知/取得發票通知方式設定
  version: 1.0.0
  x-source-url: https://developers.ecpay.com.tw/63356/
servers:
- url: https://einvoice-stage.ecpay.com.tw
  description: Testing Environment
- url: https://einvoice.ecpay.com.tw
  description: Production Environment
paths:
  /B2CInvoice/GetInvoiceNotifySetting:
    post:
      summary: 發送通知/取得發票通知方式設定
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - MerchantID
              - Timestamp
              - Data
              - MerchantID
              properties:
                PlatformID:
                  type: string
                  maxLength: 10
                  description: 特約合作平台商代號
                MerchantID:
                  type: string
                  maxLength: 10
                  description: 特店編號
                Timestamp:
                  type: number
                  description: 傳入時間
                Data:
                  type: string
                  description: 加密資料
                RtnCode:
                  type: integer
                  description: 回應代碼
                RtnMsg:
                  type: string
                  maxLength: 200
                  description: 回應訊息
                NotifyType:
                  type: string
                  maxLength: 1
                  description: 通知類別
                NotifySwitch:
                  type: string
                  maxLength: 1
                  description: 通知方式開關設定
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  PlatformID:
                    type: string
                    maxLength: 10
                    description: 特約合作平台商代號
                  MerchantID:
                    type: string
                    maxLength: 10
                    description: 特店編號
                  Timestamp:
                    type: number
                    description: 回傳時間
                  TransCode:
                    type: integer
                    description: 回傳代碼
                  TransMsg:
                    type: string
                    maxLength: 200
                    description: 回傳訊息
                  Data:
                    type: string
                    description: 加密資料
        '400':
          description: Invalid request
        '500':
          description: Server error

				
			

Copyright © Green World FinTech Service Co., Ltd. All rights reserved.

綠界官方網站