einvoice 1.5.0 → 2.0.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.coderabbit.yaml +6 -8
  3. data/.github/workflows/build.yml +6 -3
  4. data/.github/workflows/cron.yml +4 -2
  5. data/CHANGELOG.md +63 -44
  6. data/Gemfile +3 -10
  7. data/README.md +284 -325
  8. data/README.zh-TW.md +381 -0
  9. data/Rakefile +2 -51
  10. data/bin/console +3 -6
  11. data/einvoice.gemspec +17 -18
  12. data/lib/einvoice/amego/client.rb +116 -0
  13. data/lib/einvoice/amego/errors.rb +84 -0
  14. data/lib/einvoice/amego/payload.rb +270 -0
  15. data/lib/einvoice/amego/provider.rb +272 -0
  16. data/lib/einvoice/amego.rb +27 -0
  17. data/lib/einvoice/capability.rb +79 -0
  18. data/lib/einvoice/ecpay/client.rb +184 -0
  19. data/lib/einvoice/ecpay/crypto.rb +85 -0
  20. data/lib/einvoice/ecpay/errors.rb +115 -0
  21. data/lib/einvoice/ecpay/payload.rb +241 -0
  22. data/lib/einvoice/ecpay/provider.rb +371 -0
  23. data/lib/einvoice/ecpay.rb +31 -0
  24. data/lib/einvoice/error.rb +220 -0
  25. data/lib/einvoice/ezpay/client.rb +130 -0
  26. data/lib/einvoice/ezpay/crypto.rb +85 -0
  27. data/lib/einvoice/ezpay/errors.rb +72 -0
  28. data/lib/einvoice/ezpay/payload.rb +269 -0
  29. data/lib/einvoice/ezpay/provider.rb +253 -0
  30. data/lib/einvoice/ezpay.rb +19 -0
  31. data/lib/einvoice/input.rb +547 -0
  32. data/lib/einvoice/mock_provider.rb +191 -0
  33. data/lib/einvoice/mof/donation_codes.rb +157 -0
  34. data/lib/einvoice/mof.rb +16 -0
  35. data/lib/einvoice/number.rb +91 -0
  36. data/lib/einvoice/provider.rb +57 -13
  37. data/lib/einvoice/redaction.rb +54 -0
  38. data/lib/einvoice/taipei.rb +89 -0
  39. data/lib/einvoice/tax_split.rb +112 -0
  40. data/lib/einvoice/tradevan/default_api/client.rb +175 -0
  41. data/lib/einvoice/tradevan/default_api/crypto.rb +90 -0
  42. data/lib/einvoice/tradevan/default_api/errors.rb +54 -0
  43. data/lib/einvoice/tradevan/default_api/payload.rb +259 -0
  44. data/lib/einvoice/tradevan/default_api/provider.rb +353 -0
  45. data/lib/einvoice/tradevan/default_api/rules.rb +314 -0
  46. data/lib/einvoice/tradevan.rb +25 -0
  47. data/lib/einvoice/types.rb +365 -0
  48. data/lib/einvoice/version.rb +3 -1
  49. data/lib/einvoice.rb +21 -9
  50. metadata +52 -144
  51. data/docs/Tradevan E-Invoice APIs.md +0 -201
  52. data/docs/neweb.md +0 -347
  53. data/lib/einvoice/client.rb +0 -21
  54. data/lib/einvoice/configuration.rb +0 -49
  55. data/lib/einvoice/connection.rb +0 -31
  56. data/lib/einvoice/donation_unit_list.json +0 -2025
  57. data/lib/einvoice/result.rb +0 -21
  58. data/lib/einvoice/tradevan/model/base.rb +0 -34
  59. data/lib/einvoice/tradevan/model/issue_data.rb +0 -129
  60. data/lib/einvoice/tradevan/model/issue_item.rb +0 -41
  61. data/lib/einvoice/tradevan/model/void_data.rb +0 -35
  62. data/lib/einvoice/tradevan/provider.rb +0 -139
  63. data/lib/einvoice/tradevan/result.rb +0 -25
  64. data/lib/einvoice/tradevan/validator/issue_data_validator.rb +0 -80
  65. data/lib/faraday/response/decode_tradevan.rb +0 -37
  66. data/lib/faraday/response/parse_xml.rb +0 -14
@@ -1,201 +0,0 @@
1
- # Tradevan E-Invoice APIs
2
-
3
- ## Overview
4
-
5
- * Preparation
6
- * Encode Request
7
- * Decode Response
8
- * APIs
9
-
10
- ## Preparation
11
-
12
- After contacting with Tradevan, you'll get
13
-
14
- * acnt: your account name
15
- * acntp: your account password
16
- * key1: 1st AES encryption key
17
- * key2: 2nd AES encryption key
18
-
19
- ## Encode Request
20
-
21
- * Method: POST/GET
22
- * URL: "#{endpoint}/#{path}"
23
- * Parameters: "#{v}"
24
- * v: `Base64_strict.encode(AES.encrypt(key2, { acnt: "#{acnt}", acntp: "#{acntp}", api_key1: "#{encryption_of_api_value1}", api_key2: "#{encryption_of_api_value2}", ... }))`
25
- * `AES.encrypt(key, content)`:
26
- * mode: CBC-128
27
- * key: use `key2` for outter encryption, use `key1` for inner value encryption
28
- * iv: same as key
29
- * padding: no, but you should manually pad with `"\u0000"`(character space in bytes format) to fit correct CBC block size
30
- * encryption_of_api_value1: `Base64_strict.encode(AES.encrypt(key1, api_value1))`
31
-
32
- ## Decode Response
33
-
34
- * Format: JSON, i.e. `{ "Success": "Y", "Message": "#{encryption_of_message}" }`
35
- * Success: "Y" for OK, "N" for Failure, "E" for Error
36
- * Message:
37
- * Plain Text when `"Success": "E"`
38
- * Encryption Text when `"Success": "Y"` or `"Success": "N"`
39
- * Decryption: `AES.decrypt(key2, Base64_strict.decode(response["Message"]))`
40
- * `AES.decrypt(key, content)`:
41
- * mode: CBC-128
42
- * key: use `key2` for decrypt `response["Message"]` content
43
- * iv: key
44
- * padding: no
45
-
46
- ## APIs
47
-
48
- ### POST /DEFAULTAPI/post/issue
49
-
50
- You could use this API to do
51
-
52
- 1. issue an new invoice
53
- 2. issue an existed invoice
54
- 3. issue an allowance
55
- 4. issue an existed allowance
56
-
57
- #### Parameters
58
-
59
- * issueData
60
- * type: json
61
-
62
- ### POST /DEFAULTAPI/post/cancel
63
-
64
- You could use this API to do
65
-
66
- 1. cancel an existed invoice
67
- 2. cancel an allowance
68
-
69
- #### Parameters
70
-
71
- * voidData
72
- * type: json
73
-
74
- ### GET /DEFAULTAPI/get/searchInvoiceByMemberId
75
-
76
- #### Parameters
77
-
78
- * invoiceStartDate
79
- * description: begining of invoice issued date interval
80
- * type: string
81
- * require: false
82
- * format: yyyyMMdd
83
- * invoiceEndDate
84
- * description: end of invoice issued date interval
85
- * type: string
86
- * require: false
87
- * format: yyyyMMdd
88
- * companyUn
89
- * description: company universal business number(ubn) of Taiwan
90
- * type: string
91
- * require: true
92
- * memberId
93
- * description: customer's member id of your service
94
- * type: string
95
- * require: true if `sellTargetCode` and `carrierId` are empty
96
- * carrierId
97
- * description: customer's carrier id of invoices
98
- * type: string
99
- * require: true if `memberId` and `sellTargetCode` are empty
100
- * sellTargetCode
101
- * description: ?
102
- * type: string
103
- * require: true if `memberId` and `carrierId` are empty
104
-
105
- ### GET /DEFAULTAPI/get/searchInvoiceDetail
106
-
107
- #### Parameters
108
-
109
- * invoiceNumber
110
- * description: invoice number
111
- * type: string
112
- * require: true
113
-
114
- ### GET /DEFAULTAPI/get/sendCardInfotoCust
115
-
116
- #### Parameters
117
-
118
- * companyUn
119
- * description: company universal business number(ubn) of Taiwan
120
- * type: string
121
- * require: true
122
- * sellTargetCode
123
- * description: ?
124
- * type: string
125
- * require: true
126
- * invoiceStartYM
127
- * description: begining of invoice issued year and month interval
128
- * type: string
129
- * require: false
130
- * format: yyyyMM
131
- * invoiceEndYM
132
- * description: end of invoice issued year and month interval
133
- * type: string
134
- * require: false
135
- * format: yyyyMM
136
- * receiverEmail
137
- * description: receiver's email
138
- * type: string
139
- * require: true if `receiverMobile` is empty
140
- * receiverMobile
141
- * description: receiver's mobile
142
- * type: string
143
- * require: true if `receiverEmail` is empty
144
-
145
- ### GET /DEFAULTAPI/get/getInvoiceMarkInfo
146
-
147
- #### Parameters
148
-
149
- * companyUn
150
- * description: your company universal business number(ubn) of Taiwan
151
- * type: string
152
- * require: true
153
- * orgId
154
- * description: your orgId
155
- * type: string
156
- * require: true
157
- * uniFiedNumber
158
- * description: your company or branch ubn used to issue invoices
159
- * type: string
160
- * require: true
161
- * bookType
162
- * description: your book type
163
- * type: string
164
- * require: true
165
- * period
166
- * description: query year with or without months
167
- * type: string
168
- * require: true
169
- * format: yyyymm
170
-
171
- ### GET /DEFAULTAPI/get/getDonateUnitList
172
-
173
- #### Parameters
174
-
175
- * companyUn
176
- * description: company universal business number(ubn) of Taiwan
177
- * type: string
178
- * require: true
179
-
180
- ### GET /DEFAULTAPI/get/getInvoiceContent
181
-
182
- #### Parameters
183
-
184
- * invoiceNumber
185
- * description: invoice number
186
- * type: string
187
- * require: true if `sellTargetCode` is empty
188
- * sellTargetCode
189
- * description: ?
190
- * type: string
191
- * require: true if `invoiceNumber` is empty
192
- * invoiceStartDate
193
- * description: begining of invoice issued date interval
194
- * type: string
195
- * require: false
196
- * format: yyyyMMdd
197
- * invoiceEndDate
198
- * description: end of invoice issued date interval
199
- * type: string
200
- * require: false
201
- * format: yyyyMMdd
data/docs/neweb.md DELETED
@@ -1,347 +0,0 @@
1
- # Neweb Technologies Co., Ltd. 藍新科技電子發票 API 說明
2
-
3
- ## Overview
4
-
5
- ### Request
6
-
7
- * 由商家申請後,由藍新提供正式主機與測試主機 `hostname` & `code`。
8
- * Request URL:"#{hostname} + #{action}"
9
- * 傳送方式:(1) 以 Form Post 方式傳送 (2) UTF-8 編碼
10
- * 參數:
11
- * `storecode`:商家代碼
12
- * `xmldata`:URLEncoded XML
13
- * `hash`:驗證碼 = MD5(urlencoded_xmldata + `code`)
14
- * 範例(以 [httpie](https://github.com/jkbrzt/httpie) 為例):
15
-
16
- ```shell
17
- http --form POST ${HOSTNAME}/IN_PreInvoiceS.action storecode=${STORECODE} hash="d537a4807813c36816517b2a32994a35" xmldata="<InvoiceRoot><Invoice><InvoiceItem><Description>item1</Description><Quantity>1</Quantity><UnitPrice>10.0</UnitPrice><Amount>10.0</Amount><SequenceNumber>1</SequenceNumber></InvoiceItem><InvoiceItem><Description>item2</Description><Quantity>1</Quantity><UnitPrice>10.0</UnitPrice><Amount>10.0</Amount><SequenceNumber>2</SequenceNumber><Unit></Unit><Remark></Remark></InvoiceItem><DataNumber>12345</DataNumber><DataDate>2016/01/20</DataDate><SellerId>12345678</SellerId><BuyerName>name</BuyerName><BuyerId>0000000000</BuyerId><CustomsClearanceMark>1</CustomsClearanceMark><InvoiceType>07</InvoiceType><DonateMark>0</DonateMark><CarrierType></CarrierType><CarrierId1></CarrierId1><CarrierId2></CarrierId2><PrintMark>N</PrintMark><NPOBAN></NPOBAN><RandomNumber>AAAA</RandomNumber><SalesAmount>19</SalesAmount><FreeTaxSalesAmount>0</FreeTaxSalesAmount><ZeroTaxSalesAmount>0</ZeroTaxSalesAmount><TaxType>1</TaxType><TaxRate>0.05</TaxRate><TaxAmount>1</TaxAmount><TotalAmount>20</TotalAmount><Contact><Name>name</Name><Address>Taipei City</Address><TEL>0212341234</TEL><Email></Email></Contact></Invoice></InvoiceRoot>"
18
- ```
19
-
20
- ### Response
21
-
22
- * 回應結構(各 APIs 略有不同):
23
- * Result
24
- * statcode
25
- * statdesc
26
- * data
27
- * 範例:
28
-
29
- ```xml
30
- <Result>
31
- <statcode>0000</statcode>
32
- <statdesc></statdesc>
33
- </Result>
34
- ```
35
- * 一般性回應碼與訊息對照表:
36
-
37
- statcode | statdesc
38
- ---------|---------
39
- 0000 | OK
40
- 6001 | 某 node 值不符合長度要求
41
- 6002 | 某 node 值不符合型別要求(只檢查數型態)
42
- 6003 | 某 node 值為必填,卻發生空值或是 node 不存在
43
- 7001 | Xmldata 參數為空
44
- 7002 | Hash 參數為空
45
- 7003 | StoreCode 參數為空
46
- 8001 | Hash 值不符合
47
- 9998 | xmldata 結構有誤
48
- 9999 | 系統異常
49
-
50
- ## Issue an new invoice
51
-
52
- * Request:
53
- * Action:`IN_PreInvoiceS.action`
54
- * XmlData:
55
-
56
- Tag | Name | Required | Type | Length | Description
57
- :---|:-----|:--------:|:----:|:------:|:-----------
58
- InvoiceRoot | - | Y | - | - | -
59
- &nbsp;&nbsp;&nbsp;&nbsp;Invoice | - | Y | - | - | -
60
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataNumber | 單據號碼 | Y | 英數 | 20 | (SellerId & DataNumber) 需唯一
61
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataDate | 單據日期 | Y | 英數 | 10 | 格式:`YYYY/MM/DD`
62
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SellerId | 賣方統一編號 | Y | 英數 | 10 | -
63
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BuyerName | 買方名稱 | Y | 英數 | 60 | * B2B:買方-營業人名稱。<br/>* B2C:買方-業者通知消費者之個人識別碼資料,共 4 位 ASCII 或 2 位全型中文。
64
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BuyerId | 買方統一編號 | Y | 英數 | 10 | * B2B:買方-營業人統一編號(BAN)。<br/>* B2C:買方-填滿 10 位數 字的 "0"。
65
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CustomsClearanceMark | 通關方式註記 | N | 數 | 1 | * '1': 非經海關出口<br/>* '2': 經海關出口(若為零稅率發票,此為必填欄位)
66
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceType | 發票類別 | Y | 英數 | 2 | * '01': 三聯式<br/>* '02': 二聯式<br/>* '03': 二聯式收銀機<br/>* '04': 特種稅額<br/>* '05': 電子計算機<br/>* '06': 三聯式收銀機<br/>* '07': 一般稅額計算之電子發票<br/>* '08': 特種稅額計算之電子發票<br/>* 電子發票僅適用第 7 項及 第 8 項
67
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DonateMark | 捐贈註記 | Y | 英數 | 1 | * '0':表示「非捐贈發票」<br/>* '1':表示為「捐贈發票」<br/>* 此部分資料須由消費者決定,網購業者可於網站畫面上新增欄位,讓消費者輸入資訊,範例請參考「電子發票網頁說明資訊.doc」,倘消費者於愛心碼欄位有輸入資訊,則此欄位值帶 '1',其餘皆帶 '0'。
68
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CarrierType | 載具類別 | N | 英數 | 6 | 填入平台配發的載具類別號碼,編碼規則:AA0000,第一碼行業別(英文),第二碼載具類別(英數),後四碼載具類別(序號)若現金消費無使用載具,請免填。消費者使用手機條碼索取含買方統編發票,則不論是否已列印紙本皆為必填。手機條碼:3J0002 手機載具相關資訊請參考財政部網頁若需使用網優載具進行發票代管服務,則此欄空白,由 EIVO 系統自動帶出值
69
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CarrierId1 | 載具顯碼id | N | 英數 | 64 | 填入載具外顯碼號碼,卡片上載列之卡片號碼資訊。若紙本電子發票已列印註記為 Y,此欄位必須為空白;若此欄位非空 白,則紙本電子發票已列印註記必須為 N。消費者使用手機條碼索取含買方統編發票,則不論是否已列印紙本皆為必填。若消費者使用手機載具索取發票,則須將消費者填寫之手機載具資訊帶入此欄,範例請參考「電子發票網頁說明資訊.doc」若需使用網優載具進行發票代管服務,則此欄空白,由本系統自動帶出值
70
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CarrierId2 | 載具隱碼id | N | 英數 | 64 | 填入載具內碼號碼,營業人應載入讀取工具所讀取之原始資訊。若紙本電子發票已列印註記為 Y,此欄位必須為空白;若此欄位非空白,則紙本電子發票已列印註記必須為 N。消費者使用手機條碼索取含買方統編發票,則不論是否已列印紙本皆為必填。若消費者使用手機載具索取發票,則須將消費者填寫之手機載具資訊帶入此欄,範例請參考「電子發票網頁說明資訊.doc」若需使用網優載具進行發票代管服務,則此欄空白,由本系統自動帶出值
71
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PrintMark | 紙本電子發票已列印註記 | Y | 英 | 1 | * 'Y'/'N'<br/> * PrintMark 為 Y 時載具類別號碼,載具顯碼 ID, 載具隱碼 ID 必須為空白,捐贈註記必為 N。<br/>* 消費者使用手機條碼索取含買方統編發票,則不論是否已列印紙本,其載具類別號碼、載具顯碼 ID 和載具隱碼 ID 皆為必填。
72
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NPOBAN | 發票捐贈對象統一 | N | 英數 | 10 | 受捐贈者統一編號 BAN 捐贈愛心碼請將愛心碼資料 3-7 碼「完整」填入。愛心碼申請方式請參考財政部網頁
73
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RandomNumber | 發票防偽隨機碼 | N | 英數 | 4 | 交易當下隨機產生 4 位數值,少於 4 位者踢退;若為虛擬通路,則限填 "AAAA"
74
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceItem | - | - | - | - | 可重複
75
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description | 品名 | Y | 英數 | 256 | - | - | - |
76
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quantity | 數量 | Y | 數 | 17 | * 商品數量:整數 12 位,小數 4 位。<br/>* 整數部分第一位不能有零,小數為零時不顯示小數點,負號請接於整數第一位前 Ex:999999999999.9999 Ex:-2356
77
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unit | 單位 | 選 | 英數 | 6 | 可為空白,商品單位, 除鋼鐵業外, 一般空白
78
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UnitPrice | 單價 | Y | 數 | 17 | 商品單價 (未稅) 原幣報價,整數 12 位,小數 4 位。整數部分第一位不能有零,小數為零時不顯示小數點,負號請接於整數第一位前 Ex:999999999999.9999 Ex:-2356
79
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amount | 金額 | Y | 數 | 17 | * 商品單價(未稅) * 數量:整數 12 位,小數 4 位。<br/>* 整數部分第一位不能有零,小數為零時不顯示小數點,負號請接於整數第一位前 Ex:999999999999.9999 Ex:-2356
80
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SequenceNumber | 明細排列序號 | Y | 英數 | 3 | 系統使用,不重複發票明細項目之排列序號, 第一筆商品標示 '1', 其餘接續編號
81
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remark | 單一欄位備註 | N | 英數 | 40 | 可為空白,若為健康捐請於本項填寫"健康捐"
82
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SalesAmount | 應稅銷售額合計(新台幣) | Y | 數 | 12 | 整張發票應稅品銷售額合計 (未稅) 整數(小數點以下四捨五入),請注意銷售額合計不應為負數。
83
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FreeTaxSalesAmount | 免稅銷售額合計(新台幣) | Y | 數 | 12 | 整張發票免稅品銷售額合計整數(小數點以下四捨五入),若無需求則填 0,請注意銷售額合計不應為負數。
84
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZeroTaxSalesAmount | 零稅率銷售額合計(新台幣) | Y | 數 | 12 | 整張發票零稅率品項銷售額合計整數(小數點以下四捨五入),若無需求則填 0,請注意銷售額合計不應為負數。
85
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TaxType | 課稅別 | Y | 英數 | 1 | <br/>* '1':應稅<br/>* '2':零稅率<br/>* '3':免稅<br/>* '4':應稅(特種稅率)<br/>* '9':混合應稅與免稅或零稅率 (限收銀機發票無法分辨時使用)
86
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TaxRate | 稅率 | Y | 數 | 6 | 範例: 稅率為 5% 時本欄位值為 0.05
87
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TaxAmount | 營業稅額 | Y | 數 | 12 | 整數(小數點以下四捨五入),填寫方式參閱註 1,請注意此項稅額不應為負數
88
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TotalAmount | 總計 | Y | 數 | 12 | 整數 (應稅銷售額合計 + 免稅銷售額合計 + 零稅率銷售額合計 + 營業稅額 = 此總計欄位),整數部分第一位不能有零,請注意此項總額不應為負數
89
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Contact | 郵件聯絡人資訊 | - | - | - | -
90
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name | 姓名 | Y | 英數 | 64 | 郵寄信封上收件人
91
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Address | 地址 | Y | 英數 | 128 | 郵寄信封上收件人地址
92
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TEL | 電話 | N | 英數 | 64 | 聯絡人電話,若啟動簡訊通知服務則為收取簡訊電話,則此欄位必填
93
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email | email | N | 英數 | 512 | 聯絡人 Email,若啟動 Email 通知服務則此欄位必填,若須設定多筆 Email 則 以;符號間隔,例: aa@aa.net;bb@bb.net
94
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CustomerDefined | 針對有印花稅需求者 | - | - | - | -
95
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProjectNo | 專案編號 | N | 英數 | 64 | -
96
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PurchaseNo | 採購案號 | N | 英數 | 64 | -
97
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StampDutyFlag | 顯示印花稅圖章 | N | 數 | 1 | 0:不需要 1:需要
98
-
99
- 註一、營業稅額欄位之填寫方式,應依照加值型及非加值型營業稅法第三十二條規定:「營業人依第十四條規定計算之銷項稅額,買受人為營業人者,應與銷售額於統一發票上分別載明之;買受人為非營業人者,應與銷售額合計開立統一發票。」填寫。上傳整合服務平台的發票內容應與開立內容一致。
100
-
101
- * Response:
102
- * 回應結構與訊息對照表:
103
-
104
- Tag | Name | Required | Type | Length | Description
105
- :---|:-----|:--------:|:----:|:------:|:-----------
106
- Result | - | Y | - | - | -
107
- &nbsp;&nbsp;&nbsp;&nbsp;statcode | 錯誤代碼 | Y | - | - | -
108
- &nbsp;&nbsp;&nbsp;&nbsp;statdesc | 錯誤描述 | Y | - | - | -
109
-
110
- ----
111
-
112
- statcode | statdesc | description
113
- :-------:|:---------|:-----------
114
- 7001 | SellerId 不符 | StoreCode 取得商店統一編號與 <SellerId/>是否相同或該 <SellerId/> 必須存在於該商家的分支統編中
115
- 7002 | 單據號碼重複 | 以 <SellerId/> And <DataNumber/> 為條件確認資料庫資料不可有重複。
116
- 7003 | B2C 模式 BuyerName 不符合 | 若 <BuyerId/> 值等於 10 位的 '0',則 <BuyerName/> 必須符合共 4 位 ASCII 或 2 位全型中文。
117
- 7004 | CustomsClearanceMark 資料不符 | <CustomsClearanceMark/>若有填寫,必須為 1 或 2
118
- 7005 | InvoiceType 資料不符 | <InvoiceType/>值必須為「01、02、03、04、05、06」其中一個
119
- 7006 | DonateMark 資料不符 | <DonateMark/>必須為 0 或 1
120
- 7007 | 捐贈發票 NPOBAN 資料不可為空 | <DonateMark/> 當值等於 '1' 時,則 <NPOBAN/> 不可為空值
121
- 7008 | PrintMark 為紙本電子發票已列印時, CarrierId1, CarrierId2, DonateMark 不符合要求 | <PrintMark/> 值=Y,則<CarrierId1/>載具顯碼 ID, <CarrierId2/> 載具隱碼 ID 必須為空白, <DonateMark/>捐贈註記必為 N
122
- 7009 | RandomNumber 資料長度不符 | <RandomNumber/> 若非為空值時,則長度不可小於四位。
123
- 7010 | SequenceNumber 不可重複 | <SequenceNumber/> 不可重複
124
- 7011 | SalesAmount 為負值 | <SalesAmount/> 不可為負數
125
- 7012 | FreeTaxSalesAmount 為負值 | <FreeTaxSalesAmount/> 不可為負數
126
- 7013 | ZeroTaxSalesAmount 為負值 | <ZeroTaxSalesAmount/> 不可為負數
127
- 7014 | TaxType 資料不符 | <TaxType/> 值限為「1、2、3、4、9」其中一項
128
- 7015 | TaxAmount 為負值 | <TaxAmount/> 不可為負數
129
- 7016 | TotalAmount 為負值 | <TotalAmount/> 不可為負數
130
-
131
- ## Issue an existed invoice
132
-
133
- * Request:
134
- * Action:`IN_SellerInvoiceS.action`
135
- * XmlData:
136
-
137
- Tag | Description | Required | Type | Length | Detail
138
- ----|-------------|----------|------|--------|-------
139
- InvoiceRoot | - | Y | - | - | -
140
- &nbsp;&nbsp;&nbsp;&nbsp;Invoice | - | Y | - | - | -
141
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceNumber | 發票號碼 | Y | 英數 | 10 | (SellerId & DataNumber) 需唯一
142
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceDate | 發票日期 | Y | 英數 | 8 | `YYYY/MM/DD` 西元年月日,平台僅接收 2006/12/06 後的所有發票
143
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceTime | 發票時間 | Y | 英數 | 8 | HH:MM:SS(24hr);[00-23]:[0 0-59]:[00-59] 範例:23:59:59
144
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SellerId | 賣方統一編號 | Y | 英數 | 10 | -
145
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BuyerName | 買方名稱 | Y | 英數 | 60 | * B2B:買方-營業人名稱。<br/>* B2C:買方-業者通知消費者之個人識別碼資料,共 4 位 ASCII 或 2 位全型中文。
146
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BuyerId | 買方統一編號 | Y | 英數 | 10 | * B2B:買方-營業人統一編號(BAN)。<br/>* B2C:買方-填滿 10 位數 字的 "0"。
147
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CustomsClearanceMark | 通關方式註記 | N | 數 | 1 | * '1': 非經海關出口<br/>* '2': 經海關出口(若為零稅率發票,此為必填欄位)
148
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceType | 發票類別 | Y | 英數 | 2 | * '01': 三聯式<br/>* '02': 二聯式<br/>* '03': 二聯式收銀機<br/>* '04': 特種稅額<br/>* '05': 電子計算機<br/>* '06': 三聯式收銀機<br/>* '07': 一般稅額計算之電子發票<br/>* '08': 特種稅額計算之電子發票<br/>* 電子發票僅適用第 7 項及 第 8 項
149
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DonateMark | 捐贈註記 | Y | 英數 | 1 | * '0':表示「非捐贈發票」<br/>* '1':表示為「捐贈發票」<br/>* 此部分資料須由消費者決定,網購業者可於網站畫面上新增欄位,讓消費者輸入資訊,範例請參考「電子發票網頁說明資訊.doc」,倘消費者於愛心碼欄位有輸入資訊,則此欄位值帶 '1',其餘皆帶 '0'。
150
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CarrierType | 載具類別 | N | 英數 | 6 | 填入平台配發的載具類別號碼,編碼規則:AA0000,第一碼行業別(英文),第二碼載具類別(英數),後四碼載具類別(序號)若現金消費無使用載具,請免填。消費者使用手機條碼索取含買方統編發票,則不論是否已列印紙本皆為必填。手機條碼:3J0002 手機載具相關資訊請參考財政部網頁若需使用網優載具進行發票代管服務,則此欄空白,由 EIVO 系統自動帶出值
151
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CarrierId1 | 載具顯碼id | N | 英數 | 64 | 填入載具外顯碼號碼,卡片上載列之卡片號碼資訊。若紙本電子發票已列印註記為 Y,此欄位必須為空白;若此欄位非空 白,則紙本電子發票已列印註記必須為 N。消費者使用手機條碼索取含買方統編發票,則不論是否已列印紙本皆為必填。若消費者使用手機載具索取發票,則須將消費者填寫之手機載具資訊帶入此欄,範例請參考「電子發票網頁說明資訊.doc」若需使用網優載具進行發票代管服務,則此欄空白,由本系統自動帶出值
152
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CarrierId2 | 載具隱碼id | N | 英數 | 64 | 填入載具內碼號碼,營業人應載入讀取工具所讀取之原始資訊。若紙本電子發票已列印註記為 Y,此欄位必須為空白;若此欄位非空白,則紙本電子發票已列印註記必須為 N。消費者使用手機條碼索取含買方統編發票,則不論是否已列印紙本皆為必填。若消費者使用手機載具索取發票,則須將消費者填寫之手機載具資訊帶入此欄,範例請參考「電子發票網頁說明資訊.doc」若需使用網優載具進行發票代管服務,則此欄空白,由本系統自動帶出值
153
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PrintMark | 紙本電子發票已列印註記 | Y | 英 | 1 | * 'Y'/'N'<br/> * PrintMark 為 Y 時載具類別號碼,載具顯碼 ID, 載具隱碼 ID 必須為空白,捐贈註記必為 N。<br/>* 消費者使用手機條碼索取含買方統編發票,則不論是否已列印紙本,其載具類別號碼、載具顯碼 ID 和載具隱碼 ID 皆為必填。
154
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NPOBAN | 發票捐贈對象統一 | N | 英數 | 10 | 受捐贈者統一編號 BAN 捐贈愛心碼請將愛心碼資料 3-7 碼「完整」填入。愛心碼申請方式請參考財政部網頁
155
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RandomNumber | 發票防偽隨機碼 | N | 英數 | 4 | 交易當下隨機產生 4 位數值,少於 4 位者踢退;若為虛擬通路,則限填 "AAAA"
156
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceItem | - | - | - | - | 可重複
157
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description | 品名 | Y | 英數 | 256 | - | - | - |
158
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quantity | 數量 | Y | 數 | 17 | * 商品數量:整數 12 位,小數 4 位。<br/>* 整數部分第一位不能有零,小數為零時不顯示小數點,負號請接於整數第一位前 Ex:999999999999.9999 Ex:-2356
159
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unit | 單位 | 選 | 英數 | 6 | 可為空白,商品單位, 除鋼鐵業外, 一般空白
160
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UnitPrice | 單價 | Y | 數 | 17 | 商品單價 (未稅) 原幣報價,整數 12 位,小數 4 位。整數部分第一位不能有零,小數為零時不顯示小數點,負號請接於整數第一位前 Ex:999999999999.9999 Ex:-2356
161
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Amount | 金額 | Y | 數 | 17 | * 商品單價(未稅) * 數量:整數 12 位,小數 4 位。<br/>* 整數部分第一位不能有零,小數為零時不顯示小數點,負號請接於整數第一位前 Ex:999999999999.9999 Ex:-2356
162
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SequenceNumber | 明細排列序號 | Y | 英數 | 3 | 系統使用,不重複發票明細項目之排列序號, 第一筆商品標示 '1', 其餘接續編號
163
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remark | 單一欄位備註 | N | 英數 | 40 | 可為空白,若為健康捐請於本項填寫"健康捐"
164
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SalesAmount | 應稅銷售額合計(新台幣) | Y | 數 | 12 | 整張發票應稅品銷售額合計 (未稅) 整數(小數點以下四捨五入),請注意銷售額合計不應為負數。
165
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FreeTaxSalesAmount | 免稅銷售額合計(新台幣) | Y | 數 | 12 | 整張發票免稅品銷售額合計整數(小數點以下四捨五入),若無需求則填 0,請注意銷售額合計不應為負數。
166
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZeroTaxSalesAmount | 零稅率銷售額合計(新台幣) | Y | 數 | 12 | 整張發票零稅率品項銷售額合計整數(小數點以下四捨五入),若無需求則填 0,請注意銷售額合計不應為負數。
167
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TaxType | 課稅別 | Y | 英數 | 1 | <br/>* '1':應稅<br/>* '2':零稅率<br/>* '3':免稅<br/>* '4':應稅(特種稅率)<br/>* '9':混合應稅與免稅或零稅率 (限收銀機發票無法分辨時使用)
168
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TaxRate | 稅率 | Y | 數 | 6 | 範例: 稅率為 5% 時本欄位值為 0.05
169
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TaxAmount | 營業稅額 | Y | 數 | 12 | 整數(小數點以下四捨五入),填寫方式參閱註 1,請注意此項稅額不應為負數
170
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TotalAmount | 總計 | Y | 數 | 12 | 整數 (應稅銷售額合計 + 免稅銷售額合計 + 零稅率銷售額合計 + 營業稅額 = 此總計欄位),整數部分第一位不能有零,請注意此項總額不應為負數
171
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Contact | 郵件聯絡人資訊 | - | - | - | -
172
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name | 姓名 | Y | 英數 | 64 | 郵寄信封上收件人
173
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Address | 地址 | Y | 英數 | 128 | 郵寄信封上收件人地址
174
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TEL | 電話 | N | 英數 | 64 | 聯絡人電話,若啟動簡訊通知服務則為收取簡訊電話,則此欄位必填
175
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email | email | N | 英數 | 512 | 聯絡人 Email,若啟動 Email 通知服務則此欄位必填,若須設定多筆 Email 則 以;符號間隔,例: aa@aa.net;bb@bb.net
176
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CustomerDefined | 針對有印花稅需求者 | - | - | - | -
177
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProjectNo | 專案編號 | N | 英數 | 64 | -
178
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PurchaseNo | 採購案號 | N | 英數 | 64 | -
179
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StampDutyFlag | 顯示印花稅圖章 | N | 數 | 1 | 0:不需要 1:需要
180
-
181
- 註一、營業稅額欄位之填寫方式,應依照加值型及非加值型營業稅法第三十二條規定:「營業人依第十四條規定計算之銷項稅額,買受人為營業人者,應與銷售額於統一發票上分別載明之;買受人為非營業人者,應與銷售額合計開立統一發票。」填寫。上傳整合服務平台的發票內容應與開立內容一致。
182
-
183
- * Response:
184
- * 回應結構與訊息對照表:
185
-
186
- Tag | Name | Required | Type | Length | Description
187
- :---|:-----|:--------:|:----:|:------:|:-----------
188
- Result | - | Y | - | - | -
189
- &nbsp;&nbsp;&nbsp;&nbsp;statcode | 錯誤代碼 | Y | - | - | -
190
- &nbsp;&nbsp;&nbsp;&nbsp;statdesc | 錯誤描述 | Y | - | - | -
191
-
192
- ----
193
-
194
- statcode | statdesc | description
195
- :-------:|:---------|:-----------
196
- 7001 | SellerId 不符 | StoreCode 取得商店統一編號與 <SellerId/>是否相同或該 <SellerId/> 必須存在於該商家的分支統編中
197
- 7002 | 發票號碼重複 | 以 <InvoiceNumber/> 為條件確認資料庫資料不可有重複。
198
- 7003 | B2C 模式 BuyerName 不符合 | 若 <BuyerId/> 值等於 10 位的 '0',則 <BuyerName/> 必須符合共 4 位 ASCII 或 2 位全型中文。
199
- 7004 | CustomsClearanceMark 資料不符 | <CustomsClearanceMark/>若有填寫,必須為 1 或 2
200
- 7005 | InvoiceType 資料不符 | <InvoiceType/>值必須為「01、02、03、04、05、06」其中一個
201
- 7006 | DonateMark 資料不符 | <DonateMark/>必須為 0 或 1
202
- 7007 | 捐贈發票 NPOBAN 資料不可為空 | <DonateMark/> 當值等於 '1' 時,則 <NPOBAN/> 不可為空值
203
- 7008 | PrintMark 為紙本電子發票已列印時, CarrierId1, CarrierId2, DonateMark 不符合要求 | <PrintMark/> 值=Y,則<CarrierId1/>載具顯碼 ID, <CarrierId2/> 載具隱碼 ID 必須為空白, <DonateMark/>捐贈註記必為 N
204
- 7009 | RandomNumber 資料長度不符 | <RandomNumber/> 若非為空值時,則長度不可小於四位。
205
- 7010 | SequenceNumber 不可重複 | <SequenceNumber/> 不可重複
206
- 7011 | SalesAmount 為負值 | <SalesAmount/> 不可為負數
207
- 7012 | FreeTaxSalesAmount 為負值 | <FreeTaxSalesAmount/> 不可為負數
208
- 7013 | ZeroTaxSalesAmount 為負值 | <ZeroTaxSalesAmount/> 不可為負數
209
- 7014 | TaxType 資料不符 | <TaxType/> 值限為「1、2、3、4、9」其中一項
210
- 7015 | TaxAmount 為負值 | <TaxAmount/> 不可為負數
211
- 7016 | TotalAmount 為負值 | <TotalAmount/> 不可為負數
212
-
213
- ## Query issued invoices
214
-
215
- * Request:
216
- * Action:`IN_InvoiceMapS.action`
217
- * XmlData:
218
-
219
- Tag | Name | Required | Type | Length | Description
220
- :---|:-----|:--------:|:----:|:------:|:-----------
221
- QryEvent | - | Y | - | - | -
222
- &nbsp;&nbsp;&nbsp;&nbsp;InvoiceDateTimeS | 發票日期時間 (查詢開始) | N | 數 | 14 | yyyyMMddHHmmss
223
- &nbsp;&nbsp;&nbsp;&nbsp;InvoiceDateTimdE | 發票日期時間 (結束) | N | 數 | 14 | yyyyMMddHHmmss
224
- &nbsp;&nbsp;&nbsp;&nbsp;DataNumberS | 單據號碼 (查詢開始) | N | 英數 | 20 | -
225
- &nbsp;&nbsp;&nbsp;&nbsp;DataNumberE | 單據號碼 (結束) | N | 英數 | 20 | -
226
- &nbsp;&nbsp;&nbsp;&nbsp;SyncStatusUpdate | 是否更新同步狀態 | N | 英 | 1 | 'Y' or 'N'(default)
227
-
228
- 註:若不放條件,請將 Node 的值為空,不可省略節點。
229
-
230
- * Response:
231
- * 回應結構與訊息對照表:
232
-
233
- Tag | Name | Required | Type | Length | Description
234
- :---|:-----|:--------:|:----:|:------:|:-----------
235
- Result | - | Y | - | - | -
236
- &nbsp;&nbsp;&nbsp;&nbsp;statcode | 錯誤代碼 | Y | - | - | -
237
- &nbsp;&nbsp;&nbsp;&nbsp;statdesc | 錯誤描述 | Y | - | - | -
238
- &nbsp;&nbsp;&nbsp;&nbsp;data | 資料區塊 | N | - | - | 狀態碼=0000 時,才有此 Node
239
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceMapRoot | - | Y | - | - | -
240
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceMap | 逐筆發票對應資料集合 | Y | - | - | 若有多筆發票對應資料,此 TAG 可重複
241
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataNumber | 單據號碼 | Y | 英數 | 20 | 為未配號發票檔中單據號碼
242
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceNumber | 發票號碼 | Y | 英數 | 10 | 客戶須於本系統維護發票號碼後,本系統方可配號,並回傳此一值給營業人
243
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceDate | 發票日期 | Y | 英數 | 10 | `YYYY/MM/DD` 西元年月日
244
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceTime | 發票時間 | Y | 英數 | 8 | HH:MM:SS(24hr);[00-23]:[00-59]:[0 0-59] 範例:23:59:59
245
-
246
- ## Cancel an issued invoice
247
-
248
- * Request:
249
- * Action:`IN_CancelInvoiceS.action`
250
- * XmlData:
251
-
252
- Tag | Name | Required | Type | Length | Description
253
- :---|:-----|:--------:|:----:|:------:|:-----------
254
- CancelInvoiceRoot | - | Y | - | - | -
255
- &nbsp;&nbsp;&nbsp;&nbsp;CancelInvoice | 逐筆作廢發票資料集合 | Y | - | - | -
256
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InvoiceDate | 發票日期 | Y | 英數 | 10 | `YYYY/MM/DD` 西元年月日,發票當初開立之日期
257
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SellerId | 賣方識別碼 | Y | 英數 | 10 | 賣方營業人統一編號
258
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CancelDate | 作廢日期 | Y | 英數 | 10 | `YYYY/MM/DD` 西元年月日
259
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CancelTime | 作費時間 | Y | 英數 | 8 | HH:MM:SS; (24hr);[00-23]:[00-59]:[00 -59] 範例:23:59:59
260
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CancelReason | 作費原因 | Y | 英數 | 20 | 長度至少為 1
261
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ReturnTaxDocumentNumber | 專案作費核准文號 | N | 英數 | 60 | 若發票的作廢時間超過申報期間,則此欄位為必填欄位。若不填寫由上傳營業人自行負責。一般營業人二個月申報一次營業稅,則申報期為單月 15 號,超過申報期限則須與轄區國稅局申請專案核准文號方可作廢此張發票
262
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remark | 備註 | Y | 英數 | 200 | -
263
-
264
- * Response:
265
- * 回應結構與訊息對照表:
266
-
267
- Tag | Name | Required | Type | Length | Description
268
- :---|:-----|:--------:|:----:|:------:|:-----------
269
- Result | - | Y | - | - | -
270
- &nbsp;&nbsp;&nbsp;&nbsp;statcode | 錯誤代碼 | Y | - | - | -
271
- &nbsp;&nbsp;&nbsp;&nbsp;statdesc | 錯誤描述 | Y | - | - | -
272
-
273
- ----
274
-
275
- statcode | statdesc | description
276
- :-------:|:---------|:-----------
277
- 7001 | SellerId 不符 | StoreCode 取得商店統一編號與 <SellerId/> 是否相同且該 <SellerId/> 必須存在於該商家的分支統編中
278
- 7002 | CancelReason 資料長度最少一位 | <CancelReason/> 資料長度最少一位
279
-
280
- ## Allowance of an invoice
281
-
282
- * Request:
283
- * Action:`IN_AllowanceS.action`
284
- * XmlData:
285
-
286
- Tag | Name | Required | Type | Length | Description
287
- :---|:-----|:--------:|:----:|:------:|:-----------
288
-
289
- * Response:
290
- * 回應結構與訊息對照表:
291
-
292
- Tag | Name | Required | Type | Length | Description
293
- :---|:-----|:--------:|:----:|:------:|:-----------
294
- Result | - | Y | - | - | -
295
- &nbsp;&nbsp;&nbsp;&nbsp;statcode | 錯誤代碼 | Y | - | - | -
296
- &nbsp;&nbsp;&nbsp;&nbsp;statdesc | 錯誤描述 | Y | - | - | -
297
-
298
- ----
299
-
300
- statcode | statdesc | description
301
- :-------:|:---------|:-----------
302
-
303
- ## Cancel allowance of an invoice
304
-
305
- * Request:
306
- * Action:`IN_CancelAllowanceS.action`
307
- * XmlData:
308
-
309
- Tag | Name | Required | Type | Length | Description
310
- :---|:-----|:--------:|:----:|:------:|:-----------
311
-
312
- * Response:
313
- * 回應結構與訊息對照表:
314
-
315
- Tag | Name | Required | Type | Length | Description
316
- :---|:-----|:--------:|:----:|:------:|:-----------
317
- Result | - | Y | - | - | -
318
- &nbsp;&nbsp;&nbsp;&nbsp;statcode | 錯誤代碼 | Y | - | - | -
319
- &nbsp;&nbsp;&nbsp;&nbsp;statdesc | 錯誤描述 | Y | - | - | -
320
-
321
- ----
322
-
323
- statcode | statdesc | description
324
- :-------:|:---------|:-----------
325
-
326
- ## Assign invoice number for branches
327
-
328
- * Request:
329
- * Action:`IN_BranchTrackS.action`
330
- * XmlData:
331
-
332
- Tag | Name | Required | Type | Length | Description
333
- :---|:-----|:--------:|:----:|:------:|:-----------
334
-
335
- * Response:
336
- * 回應結構與訊息對照表:
337
-
338
- Tag | Name | Required | Type | Length | Description
339
- :---|:-----|:--------:|:----:|:------:|:-----------
340
- Result | - | Y | - | - | -
341
- &nbsp;&nbsp;&nbsp;&nbsp;statcode | 錯誤代碼 | Y | - | - | -
342
- &nbsp;&nbsp;&nbsp;&nbsp;statdesc | 錯誤描述 | Y | - | - | -
343
-
344
- ----
345
-
346
- statcode | statdesc | description
347
- :-------:|:---------|:-----------
@@ -1,21 +0,0 @@
1
- module Einvoice
2
- class Client
3
- attr_accessor :provider
4
-
5
- def initialize(provider)
6
- @provider = provider
7
- end
8
-
9
- def method_missing(m, *args, &block)
10
- if provider.respond_to?(m)
11
- provider.public_send(m, *args, &block)
12
- else
13
- super
14
- end
15
- end
16
-
17
- def respond_to_missing?(m, include_private = false)
18
- provider.respond_to?(m) || super
19
- end
20
- end
21
- end
@@ -1,49 +0,0 @@
1
- require "faraday"
2
-
3
- module Einvoice
4
- module Configuration
5
- VALID_OPTIONS_KEYS = [
6
- :endpoint,
7
- :endpoint_url,
8
- :client_id,
9
- :client_secret,
10
- :encryption_keys,
11
- :format,
12
- :ssl_verify
13
- ].freeze
14
-
15
- DEFAULT_CLIENT_ID = nil
16
- DEFAULT_CLIENT_SECRET = nil
17
- DEFAULT_ENDPOINT = "".freeze
18
- DEFAULT_ENDPOINT_URL = nil
19
- DEFAULT_FORMAT = ""
20
- DEFAULT_ENCRYPTION_KEYS = {}
21
- DEFAULT_SSL_VERIFY = true
22
-
23
- attr_accessor(*VALID_OPTIONS_KEYS)
24
-
25
- def self.extended(base)
26
- base.reset
27
- end
28
-
29
- def configure
30
- yield self
31
- end
32
-
33
- def options
34
- VALID_OPTIONS_KEYS.inject({}) do |option, key|
35
- option.merge!(key => send(key))
36
- end
37
- end
38
-
39
- def reset
40
- self.client_id = DEFAULT_CLIENT_ID
41
- self.client_secret = DEFAULT_CLIENT_SECRET
42
- self.endpoint = DEFAULT_ENDPOINT
43
- self.endpoint_url = DEFAULT_ENDPOINT_URL
44
- self.encryption_keys = DEFAULT_ENCRYPTION_KEYS
45
- self.format = DEFAULT_FORMAT
46
- self.ssl_verify = DEFAULT_SSL_VERIFY
47
- end
48
- end
49
- end