{
  "swagger": "2.0",
  "info": {
    "version": "v1",
    "title": "Product.EInvoice.WebApi - 對外服務 API"
  },
  "host": "jpe-sl-einvoice-erpapi-stage.azurewebsites.net",
  "schemes": [
    "https"
  ],
  "paths": {
    "/Append/Order": {
      "post": {
        "tags": [
          "Append"
        ],
        "summary": "新增單筆訂單轉發票",
        "description": "接收單筆訂單資料，自動轉換為電子發票並開立，回傳發票號碼、隨機碼等資訊",
        "operationId": "Append_Order",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AppendOrder",
            "in": "body",
            "description": "訂單資料模型，包含買賣方資訊、商品明細、金額、載具資訊等",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceModel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/Product.EInvoice.Model.Api.Response.ResponseAppendInvoiceModel"
            }
          }
        }
      }
    },
    "/Append/Orders": {
      "post": {
        "tags": [
          "Append"
        ],
        "summary": "批次新增多筆訂單轉發票",
        "description": "接收多筆訂單資料，批次轉換為電子發票並開立，提高處理效率",
        "operationId": "Append_Orders",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AppendOrders",
            "in": "body",
            "description": "訂單資料清單，每筆訂單包含買賣方資訊、商品明細、金額等",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Append/Invoice": {
      "post": {
        "tags": [
          "Append"
        ],
        "summary": "新增已開立發票資料",
        "description": "用於匯入已由外部系統開立完成的發票資料，將發票資訊同步至電子發票系統",
        "operationId": "Append_Invoice",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AppendInvoice",
            "in": "body",
            "description": "已開立發票資料模型，必須包含發票號碼、隨機碼、開立時間、商品明細等完整資訊",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceModel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Append/Invoices": {
      "post": {
        "tags": [
          "Append"
        ],
        "summary": "批次新增已開立發票資料",
        "description": "用於批次匯入已由外部系統開立完成的多筆發票資料，提高資料同步效率",
        "operationId": "Append_Invoices",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AppendInvoices",
            "in": "body",
            "description": "已開立發票資料清單，每筆必須包含完整的發票資訊",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Append/PrintInvoices": {
      "post": {
        "tags": [
          "Append"
        ],
        "summary": "傳入訂單開立發票並加入雲端列印",
        "operationId": "Append_PrintInvoices",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AppendInvoices",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Append/BlankCancel": {
      "post": {
        "tags": [
          "Append"
        ],
        "summary": "作廢空白發票",
        "operationId": "Append_BlankCancel",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "CancelInvoices",
            "in": "body",
            "description": "作廢空白發票清單",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.CancelModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Append/TrackBlank": {
      "post": {
        "tags": [
          "Append"
        ],
        "summary": "新增空白發票號",
        "operationId": "Append_TrackBlank",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "TrackBlanks",
            "in": "body",
            "description": "空白發票清單",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.TrackBlankModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Append/InvoiceWithCancel": {
      "post": {
        "tags": [
          "Append"
        ],
        "summary": "新增發票並作廢",
        "operationId": "Append_InvoiceWithCancel",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AppendInvoice",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceModel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Inquire/GetInvoiceIDList": {
      "post": {
        "tags": [
          "Inquire"
        ],
        "summary": "查詢發票號碼清單",
        "description": "根據公司編號、期別年度與期別月份，查詢該期別已分配的發票號碼清單",
        "operationId": "Inquire_GetInvoiceIDList",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "InquireAssagnNo",
            "in": "body",
            "description": "發票號查詢請求清單，包含公司編號、期別年月、簽章等資訊",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.RequestAssagnNoModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Inquire/GetInvoicesStatus": {
      "post": {
        "tags": [
          "Inquire"
        ],
        "summary": "批次查詢發票處理狀態",
        "description": "批次查詢多張發票的處理狀態，包括發票是否已開立、作廢、上傳財政部等狀態資訊",
        "operationId": "Inquire_GetInvoicesStatus",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "Invoices",
            "in": "body",
            "description": "發票狀態查詢請求清單，包含發票號碼、簽章等資訊",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.RequestInvoiceStatus"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Inquire/GetInvoicesAppendStatus": {
      "post": {
        "tags": [
          "Inquire"
        ],
        "summary": "批次查詢發票新增狀態",
        "description": "批次查詢多張發票的新增（Append）狀態，用於確認發票資料是否已成功新增至系統",
        "operationId": "Inquire_GetInvoicesAppendStatus",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "Invoices",
            "in": "body",
            "description": "發票新增狀態查詢請求清單，包含發票號碼、簽章等資訊",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.RequestInvoiceStatus"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/Invoices": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "批次更新發票資料",
        "description": "用於更新已開立發票的資訊，例如修改買方資訊、商品明細、備註等",
        "operationId": "Update_Invoices",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AppendInvoices",
            "in": "body",
            "description": "要更新的發票資料清單，必須包含發票號碼與要更新的欄位資訊",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/SetBlankInvoiceID": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "上傳空白發票號碼資料",
        "description": "將財政部配發的空白發票號碼上傳至系統，供後續發票開立使用",
        "operationId": "Update_SetBlankInvoiceID",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "BlankInvoices",
            "in": "body",
            "description": "空白發票號碼資料清單，包含公司編號、期別、字軒、起訖號碼等",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.UpdateBlankIDModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/SplitInvoiceID": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "設定發票號碼分割規則",
        "description": "用於設定發票號碼的分割使用規則，例如不同門市、部門使用不同號碼段（功能開發中）",
        "operationId": "Update_SplitInvoiceID",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AppendInvoices",
            "in": "body",
            "description": "發票號碼分割設定資料清單",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/CancelInvoices": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "批次作廢發票",
        "description": "批次作廢已開立的發票，作廢後發票將無法再使用，並會通知財政部",
        "operationId": "Update_CancelInvoices",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "CancelInvoices",
            "in": "body",
            "description": "要作廢的發票清單，包含發票號碼、作廢原因、作廢時間等資訊",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.CancelModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/AllowanceInvoices": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "批次新增發票折讓單",
        "description": "批次新增發票折讓單，用於處理退貨、折讓等業務，系統會自動產生折讓單號碼",
        "operationId": "Update_AllowanceInvoices",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AllowanceInvoices",
            "in": "body",
            "description": "折讓單資料清單，包含原發票號碼、折讓項目、折讓金額等",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.Model.Api.Allowance.AllowanceModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/AllowanceInvoice": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "新增發票折讓單",
        "description": "新增發票折讓單，用於處理退貨、折讓等業務，系統會自動產生折讓單號碼並通知財政部",
        "operationId": "Update_AllowanceInvoice",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "AllowanceInvoices",
            "in": "body",
            "description": "折讓單資料清單，包含原發票號碼、折讓項目、折讓金額、買賣方資訊等",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.Model.Api.Allowance.AllowanceModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/CancelAllowances": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "批次作廢折讓單",
        "description": "批次作廢已開立的折讓單，作廢後折讓單將無效並通知財政部",
        "operationId": "Update_CancelAllowances",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "CancelAllowances",
            "in": "body",
            "description": "要作廢的折讓單清單，包含折讓單號碼、作廢原因等",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.AllowanceCancelModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/CancelAllowance": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "作廢折讓單",
        "description": "作廢已開立的折讓單，作廢後折讓單將無效並通知財政部",
        "operationId": "Update_CancelAllowance",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "CancelAllowances",
            "in": "body",
            "description": "要作廢的折讓單清單，包含折讓單號碼、作廢原因、作廢時間等資訊",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Product.EInvoice.WebApi.Models.AllowanceCancelModel"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/RePrint": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "發票重新列印",
        "operationId": "Update_RePrint",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "PrintInvoices",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Product.EInvoice.WebApi.Models.RePrintModel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/Update/SecPrint": {
      "post": {
        "tags": [
          "Update"
        ],
        "summary": "發票補列印",
        "operationId": "Update_SecPrint",
        "consumes": [
          "application/json",
          "text/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "name": "PrintInvoices",
            "in": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Product.EInvoice.WebApi.Models.RePrintModel"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Product.EInvoice.WebApi.Models.InvoiceModel": {
      "description": "Invoice Data Model",
      "required": [
        "Data",
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.Model.Append.InvoiceMain",
          "description": "Invoice Data Model [Append Order has the same restrictions or selection criteria as Append Invoices except that the Invoice Number and Invoice DateTime fields do not need to transmit values.]"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Append.InvoiceMain": {
      "required": [
        "CompanyID",
        "CompanyIdentifier",
        "CheckNumber",
        "RandomNumber",
        "InvoiceFor",
        "Details"
      ],
      "type": "object",
      "properties": {
        "InvoiceID": {
          "pattern": "^[A-Z]{2}[0-9]{8}$",
          "type": "string"
        },
        "InvoiceNumber": {
          "type": "string"
        },
        "CompanyID": {
          "pattern": "^[0-9]{8}$",
          "type": "string"
        },
        "CompanyIdentifier": {
          "pattern": "^[0-9]{8}$",
          "type": "string"
        },
        "UTCInvoiceDateTime": {
          "format": "date-time",
          "type": "string"
        },
        "InvoiceDateTime": {
          "format": "date-time",
          "type": "string"
        },
        "BillingNo": {
          "type": "string"
        },
        "BuyerAddress": {
          "type": "string"
        },
        "BuyerCustomerNumber": {
          "type": "string"
        },
        "BuyerEmailAddress": {
          "type": "string"
        },
        "BuyerEmail": {
          "type": "string"
        },
        "BuyerFacsimileNumber": {
          "type": "string"
        },
        "BuyerID": {
          "pattern": "^[0-9]{8,10}$",
          "type": "string"
        },
        "BuyerIdentifier": {
          "pattern": "^[0-9]{8,10}$",
          "type": "string"
        },
        "BuyerInvoiceTitle": {
          "type": "string"
        },
        "BuyerName": {
          "type": "string"
        },
        "BuyerTelNo": {
          "type": "string"
        },
        "BuyerRoleMark": {
          "type": "string"
        },
        "BuyerRemark": {
          "type": "string"
        },
        "CarrierType": {
          "pattern": "^3J0002|CQ0001|ER0010|5G0001|1K0001|2G0001|1H0001|BK0001|EK0002|EJ1520",
          "type": "string"
        },
        "CarrierId": {
          "type": "string"
        },
        "CarrierId1": {
          "type": "string"
        },
        "CarrierId2": {
          "type": "string"
        },
        "CheckNumber": {
          "pattern": "^[0-9]{4}",
          "type": "string"
        },
        "RandomNumber": {
          "pattern": "^[0-9]{4}",
          "type": "string"
        },
        "InvoiceFor": {
          "pattern": "^[B|C|E|3]$",
          "type": "string"
        },
        "DonateMark": {
          "pattern": "^[0|1|Y|N]$",
          "type": "string"
        },
        "NPOBAN": {
          "type": "string"
        },
        "PrintMark": {
          "type": "string"
        },
        "RelateNumber": {
          "type": "string"
        },
        "MainRemark": {
          "type": "string"
        },
        "TaxType": {
          "type": "string"
        },
        "TaxRate": {
          "format": "double",
          "type": "number"
        },
        "TaxAmount": {
          "format": "int64",
          "type": "integer"
        },
        "SalesAmount": {
          "format": "int64",
          "type": "integer"
        },
        "ZeroTaxSalesAmount": {
          "format": "int64",
          "type": "integer"
        },
        "FreeTaxSalesAmount": {
          "format": "int64",
          "type": "integer"
        },
        "DiscountAmount": {
          "format": "int64",
          "type": "integer"
        },
        "TotalAmount": {
          "format": "int64",
          "type": "integer"
        },
        "OriginalCurrencyAmount": {
          "format": "double",
          "type": "number"
        },
        "Currency": {
          "type": "string"
        },
        "ExchangeRate": {
          "format": "double",
          "type": "number"
        },
        "Note": {
          "type": "string"
        },
        "InvoiceType": {
          "type": "string"
        },
        "BondedAreaConfirm": {
          "pattern": "^[1|2|3]$",
          "type": "string"
        },
        "CustomsClearanceMark": {
          "pattern": "^[1|2]$",
          "type": "string"
        },
        "Category": {
          "type": "string"
        },
        "GroupMark": {
          "type": "string"
        },
        "Attachment": {
          "type": "string"
        },
        "ItemTaxDiff": {
          "pattern": "^[Y|N]$",
          "type": "string"
        },
        "DeptID": {
          "type": "string"
        },
        "UseFor": {
          "type": "string"
        },
        "PrinterNo": {
          "type": "string"
        },
        "PrintWithDetail": {
          "pattern": "^[1|2|3]$",
          "type": "string"
        },
        "SalesID": {
          "type": "string"
        },
        "DataFrom": {
          "type": "string"
        },
        "PrintDetail": {
          "type": "boolean",
          "readOnly": true
        },
        "CutDetail": {
          "type": "boolean"
        },
        "CreateUser": {
          "type": "string"
        },
        "MessageType": {
          "type": "string"
        },
        "Details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product.EInvoice.Model.Append.InvoiceDetail"
          }
        },
        "SubLists": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product.EInvoice.Model.Append.InvoiceSubList"
          }
        },
        "MailTo": {
          "type": "string"
        },
        "MailCC": {
          "type": "string"
        },
        "MailBCC": {
          "type": "string"
        },
        "HasCarrierMemberInfo": {
          "type": "boolean",
          "readOnly": true
        }
      }
    },
    "Product.EInvoice.Model.Append.InvoiceDetail": {
      "required": [
        "ProductName",
        "Quantity",
        "UnitPrice",
        "SubTotal"
      ],
      "type": "object",
      "properties": {
        "InvoiceNumber": {
          "type": "string"
        },
        "DetailID": {
          "type": "string"
        },
        "SequenceNumber": {
          "type": "string"
        },
        "ProductName": {
          "type": "string"
        },
        "Description": {
          "type": "string"
        },
        "Quantity": {
          "format": "double",
          "type": "number"
        },
        "Unit": {
          "type": "string"
        },
        "UnitPrice": {
          "format": "double",
          "type": "number"
        },
        "SubTotal": {
          "format": "double",
          "type": "number"
        },
        "Amount": {
          "format": "double",
          "type": "number"
        },
        "ProductID": {
          "type": "string"
        },
        "RelateNumber": {
          "type": "string"
        },
        "Remark": {
          "type": "string"
        },
        "EANCode": {
          "type": "string"
        },
        "CustomerStoreNo": {
          "type": "string"
        },
        "CompanyIdentifier": {
          "type": "string"
        },
        "ItemTaxType": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Append.InvoiceSubList": {
      "type": "object",
      "properties": {
        "InvoiceNumber": {
          "type": "string"
        },
        "DetailID": {
          "pattern": "^[0-9]{3}",
          "type": "string"
        },
        "ProductName": {
          "type": "string"
        },
        "SubListItem": {
          "type": "string"
        },
        "SubListQuantity": {
          "format": "int32",
          "type": "integer"
        },
        "Note": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.Response.ResponseAppendInvoiceModel": {
      "type": "object",
      "properties": {
        "InvoiceID": {
          "type": "string"
        },
        "InvoiceNumber": {
          "type": "string",
          "readOnly": true
        },
        "InvoiceDateTime": {
          "format": "date-time",
          "type": "string"
        },
        "AuthCode": {
          "type": "string"
        },
        "ResultMessage": {
          "type": "string",
          "readOnly": true
        },
        "CheckedErrorResult": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "RelateNumber": {
          "type": "string"
        },
        "BillingNo": {
          "type": "string"
        },
        "ShortCode": {
          "type": "string"
        },
        "StatusCode": {
          "format": "int32",
          "type": "integer"
        },
        "Message": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.CancelModel": {
      "description": "作廢發票模型",
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.WebApi.Models.CancelInoviceModel",
          "description": "作廢發票資料"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.CancelInoviceModel": {
      "description": "作廢發票Model",
      "required": [
        "SellerID",
        "InvoiceNumber"
      ],
      "type": "object",
      "properties": {
        "SellerID": {
          "description": "公司ID(必填)",
          "maxLength": 8,
          "minLength": 0,
          "type": "string"
        },
        "InvoiceNumber": {
          "description": "發票號碼",
          "pattern": "^[a-zA-Z]{2}[0-9]{8}$",
          "type": "string"
        },
        "SalesID": {
          "description": "發票相關使用者ID，如業務或會計",
          "type": "string"
        },
        "CancelDate": {
          "format": "date-time",
          "description": "作廢日期時間: 帶空值會以執行時間為作廢日期時間",
          "type": "string"
        },
        "CancelReason": {
          "description": "作廢原因: 帶空值會自動填入 [發票作廢]",
          "maxLength": 20,
          "minLength": 0,
          "type": "string"
        },
        "ReturnTaxDocumentNumber": {
          "description": "專案作廢核准文號:若發票的作廢時間超過申報期間，則此欄位為必填欄位。",
          "maxLength": 60,
          "minLength": 0,
          "type": "string"
        },
        "Remark": {
          "description": "備註",
          "maxLength": 200,
          "minLength": 0,
          "type": "string"
        },
        "BlankCancel": {
          "description": "空白作廢",
          "pattern": "^[Y|N]$",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.TrackBlankModel": {
      "description": "空白號Model",
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.WebApi.Models.TrackBlank",
          "description": "空白字軌"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.TrackBlank": {
      "required": [
        "HeadBan",
        "BranchBan",
        "InvoiceType",
        "YearMonth",
        "InvoiceTrack",
        "Items"
      ],
      "type": "object",
      "properties": {
        "HeadBan": {
          "pattern": "\\d{8}",
          "type": "string"
        },
        "BranchBan": {
          "pattern": "\\d{8}",
          "type": "string"
        },
        "InvoiceType": {
          "pattern": "0[7|8]",
          "type": "string"
        },
        "YearMonth": {
          "pattern": "\\d{3}0[2|4|6|8]|\\d{3}1[0|2]",
          "type": "string"
        },
        "InvoiceTrack": {
          "pattern": "[A-Z]{2}",
          "type": "string"
        },
        "Items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product.EInvoice.WebApi.Models.BlankItem"
          }
        }
      }
    },
    "Product.EInvoice.WebApi.Models.BlankItem": {
      "required": [
        "InvoiceBeginNo",
        "InvoiceEndNo"
      ],
      "type": "object",
      "properties": {
        "InvoiceBeginNo": {
          "pattern": "\\d{8}",
          "type": "string"
        },
        "InvoiceEndNo": {
          "pattern": "\\d{8}",
          "type": "string"
        },
        "Message": {
          "type": "string"
        },
        "Status": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.AuthMisUserModel": {
      "type": "object",
      "properties": {
        "UserName": {
          "description": "使用者帳號",
          "type": "string"
        },
        "Password": {
          "description": "使用者密碼",
          "type": "string"
        },
        "DeviceID": {
          "description": "查詢裝置代號",
          "type": "string"
        },
        "FCMID": {
          "description": "Firebase Cloud Messaging Identifier",
          "type": "string"
        },
        "Status": {
          "description": "更新狀態僅能為: N(新使用者登入); R(現有使用者重新登入)",
          "pattern": "^N|R$",
          "type": "string"
        },
        "IsAuth": {
          "description": "確認是否驗證",
          "type": "boolean",
          "readOnly": true
        }
      }
    },
    "Product.EInvoice.Model.Api.EInvService.CorsEInvServiceCheckModel": {
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.Model.Api.EInvService.EInvServiceCheckModel"
        },
        "CompanyIdentifier": {
          "type": "string"
        },
        "DeviceNo": {
          "type": "string"
        },
        "Key": {
          "type": "string"
        },
        "CompanyID": {
          "type": "string"
        },
        "Timestamp": {
          "type": "string"
        },
        "Signature": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.EInvService.EInvServiceCheckModel": {
      "type": "object",
      "properties": {
        "PhoneBarCode": {
          "type": "string"
        },
        "PreservCode": {
          "type": "string"
        },
        "CompanyIdentifier": {
          "type": "string"
        },
        "Signature": {
          "type": "string"
        },
        "InvoiceStartDate": {
          "format": "date-time",
          "type": "string"
        },
        "DayRange": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.RequestAssagnNoModel": {
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.WebApi.Models.AssagnNoModel",
          "description": "查詢發票號資料"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.AssagnNoModel": {
      "required": [
        "CompanyID",
        "StageYear"
      ],
      "type": "object",
      "properties": {
        "CompanyID": {
          "description": "賣方公司統編",
          "pattern": "^[0-9]{8}$",
          "type": "string"
        },
        "StageYear": {
          "description": "發票號西元年度",
          "pattern": "^20[0-9]{2}$",
          "type": "string"
        },
        "StageMonth": {
          "description": "發票號期別偶數月份",
          "pattern": "^[2468]|10|12$",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.RequestInvoiceStatus": {
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.WebApi.Models.InvoiceStatusModel"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.InvoiceStatusModel": {
      "required": [
        "CompanyID"
      ],
      "type": "object",
      "properties": {
        "CompanyID": {
          "description": "賣方公司統編",
          "pattern": "^[0-9]{8}$",
          "type": "string"
        },
        "InvoiceID": {
          "description": "發票號碼",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.CloseDetailModel": {
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.WebApi.Models.CloseDetail"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.CloseDetail": {
      "type": "object",
      "properties": {
        "SellerID": {
          "type": "string"
        },
        "PrinterNo": {
          "type": "string"
        },
        "PrintLogo": {
          "type": "string"
        },
        "CompanyName": {
          "type": "string"
        },
        "CloseDateTime": {
          "format": "date-time",
          "type": "string"
        },
        "SalesBeginDateTime": {
          "format": "date-time",
          "type": "string"
        },
        "SalesEndDateTime": {
          "format": "date-time",
          "type": "string"
        },
        "TotalSaleAmount": {
          "format": "int32",
          "type": "integer"
        },
        "TotalSaleUnit": {
          "format": "int32",
          "type": "integer"
        },
        "CashAmount": {
          "format": "int32",
          "type": "integer"
        },
        "CreditCardAmount": {
          "format": "int32",
          "type": "integer"
        },
        "TodayRejectAmount": {
          "format": "int32",
          "type": "integer"
        },
        "TodayRejectCashAmount": {
          "format": "int32",
          "type": "integer"
        },
        "OtherDayRejectAmount": {
          "format": "int32",
          "type": "integer"
        },
        "OtherDayRejectCashAmount": {
          "format": "int32",
          "type": "integer"
        },
        "Suppiers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product.EInvoice.WebApi.Models.SuppiersModel"
          }
        },
        "InvoiceStartNumber": {
          "type": "string"
        },
        "InvoiceEndNumber": {
          "type": "string"
        },
        "InvoiceCount": {
          "format": "int32",
          "type": "integer"
        },
        "CancelInvoiceCount": {
          "format": "int32",
          "type": "integer"
        },
        "CancelInvoiceAmount": {
          "format": "int32",
          "type": "integer"
        },
        "InvoiceAmount": {
          "format": "int32",
          "type": "integer"
        },
        "NonInvoiceAmount": {
          "format": "int32",
          "type": "integer"
        },
        "SupplementaryPay": {
          "format": "int32",
          "type": "integer"
        },
        "OtherCancelCount": {
          "format": "int32",
          "type": "integer"
        },
        "OtherCancelAmount": {
          "format": "int32",
          "type": "integer"
        },
        "SalesID": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.SuppiersModel": {
      "type": "object",
      "properties": {
        "SuppierName": {
          "type": "string"
        },
        "Count": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "Product.EInvoice.Model.Api.PrinterInvoiceDetailModel": {
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.Model.Api.InvoiceDetail"
        },
        "CompanyIdentifier": {
          "type": "string"
        },
        "DeviceNo": {
          "type": "string"
        },
        "Key": {
          "type": "string"
        },
        "CompanyID": {
          "type": "string"
        },
        "Timestamp": {
          "type": "string"
        },
        "Signature": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.InvoiceDetail": {
      "type": "object",
      "properties": {
        "SellerID": {
          "type": "string"
        },
        "PrinterNo": {
          "type": "string"
        },
        "PrintLogo": {
          "type": "string"
        },
        "CompanyName": {
          "type": "string"
        },
        "OrderIdentifier": {
          "type": "string"
        },
        "OrderName": {
          "type": "string"
        },
        "InvoiceNumber": {
          "type": "string"
        },
        "SalesAmount": {
          "format": "double",
          "type": "number"
        },
        "TaxAmount": {
          "format": "double",
          "type": "number"
        },
        "TaxRate": {
          "format": "double",
          "type": "number"
        },
        "TaxType": {
          "type": "string"
        },
        "Details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product.EInvoice.Model.Api.Detail"
          }
        },
        "DiscountAmount": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "Product.EInvoice.Model.Api.Detail": {
      "required": [
        "ProductName",
        "Quantity",
        "UnitPrice",
        "SubTotal"
      ],
      "type": "object",
      "properties": {
        "ProductID": {
          "type": "string"
        },
        "ProductName": {
          "type": "string"
        },
        "Description": {
          "type": "string"
        },
        "Quantity": {
          "format": "double",
          "type": "number"
        },
        "Unit": {
          "type": "string"
        },
        "UnitPrice": {
          "format": "double",
          "type": "number"
        },
        "SubTotal": {
          "format": "double",
          "type": "number"
        },
        "Discount": {
          "format": "double",
          "type": "number"
        }
      }
    },
    "Product.EInvoice.Model.Api.CustomerPrintModel": {
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.Model.Api.CustomerPrintDataModel"
        },
        "CompanyIdentifier": {
          "type": "string"
        },
        "DeviceNo": {
          "type": "string"
        },
        "Key": {
          "type": "string"
        },
        "CompanyID": {
          "type": "string"
        },
        "Timestamp": {
          "type": "string"
        },
        "Signature": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.CustomerPrintDataModel": {
      "type": "object",
      "properties": {
        "SellerID": {
          "type": "string"
        },
        "PrinterNo": {
          "type": "string"
        },
        "PrintLines": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product.EInvoice.Model.Api.CustomerDetail"
          }
        }
      }
    },
    "Product.EInvoice.Model.Api.CustomerDetail": {
      "required": [
        "PrintType"
      ],
      "type": "object",
      "properties": {
        "PrintType": {
          "pattern": "^[T|L|B|Q]$",
          "type": "string"
        },
        "FontWidthSize": {
          "pattern": "^[1|2]$",
          "type": "string"
        },
        "FontHeightSize": {
          "pattern": "^[1|2]$",
          "type": "string"
        },
        "FontAlign": {
          "pattern": "^[L|C|R]$",
          "type": "string"
        },
        "DataText": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.RePrintModel": {
      "description": "重新列印發票",
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.WebApi.Models.RequestExportInvoice",
          "description": "資料"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.RequestExportInvoice": {
      "description": "匯出Request Model",
      "required": [
        "Invoices",
        "SellerID"
      ],
      "type": "object",
      "properties": {
        "Invoices": {
          "description": "發票號碼清單",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ReportFileName": {
          "description": "Report檔名",
          "type": "string"
        },
        "ReportFileSize": {
          "description": "Report檔案大小",
          "type": "string"
        },
        "StartDate": {
          "description": "查詢日期區間(起):預設為當月第一天(必填)",
          "pattern": "^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]$",
          "type": "string"
        },
        "EndDate": {
          "description": "查詢日期區間(迄):預設為當月最後一天(必填)",
          "pattern": "^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]$",
          "type": "string"
        },
        "CutDetail": {
          "description": "切斷明細",
          "type": "boolean"
        },
        "SellerID": {
          "description": "公司ID(必填)",
          "maxLength": 8,
          "minLength": 0,
          "type": "string"
        },
        "SalesID": {
          "description": "發票相關使用者ID，如業務或會計",
          "type": "string"
        },
        "DeptID": {
          "description": "部門代號",
          "type": "string"
        },
        "PrinterNo": {
          "description": "印表機編號",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.Printer.RequestPrinterStatusModel": {
      "required": [
        "PrinterNo"
      ],
      "type": "object",
      "properties": {
        "PrinterNo": {
          "pattern": "^[0-9]{2,4}$",
          "type": "string"
        },
        "CompanyIdentifier": {
          "type": "string"
        },
        "DeviceNo": {
          "type": "string"
        },
        "Key": {
          "type": "string"
        },
        "CompanyID": {
          "type": "string"
        },
        "Timestamp": {
          "type": "string"
        },
        "Signature": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.PrinterModel": {
      "type": "object",
      "properties": {
        "CompanyIdentifier": {
          "type": "string"
        },
        "DeviceID": {
          "type": "string"
        },
        "SerialNumber": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.CashBoxModel": {
      "type": "object",
      "properties": {
        "CompanyIdentifier": {
          "type": "string"
        },
        "PrinterNo": {
          "type": "string"
        },
        "SalesId": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.Printer.SetMachineInfoModel": {
      "type": "object",
      "properties": {
        "IndexKey": {
          "format": "int32",
          "type": "integer"
        },
        "MachineID": {
          "type": "string"
        },
        "MachineName": {
          "type": "string"
        },
        "DeptNo": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.Invoice.AppendOrderModel": {
      "required": [
        "Details"
      ],
      "type": "object",
      "properties": {
        "ByuerIdentifier": {
          "type": "string"
        },
        "BuyerIdentifier": {
          "type": "string"
        },
        "BuyerCustomerNumber": {
          "type": "string"
        },
        "BuyerEmailAddress": {
          "type": "string"
        },
        "BuyerTelNo": {
          "type": "string"
        },
        "RelateNumber": {
          "type": "string"
        },
        "TaxAmount": {
          "format": "int64",
          "type": "integer"
        },
        "SalesAmount": {
          "format": "int64",
          "type": "integer"
        },
        "TotalAmount": {
          "format": "int64",
          "type": "integer"
        },
        "TaxType": {
          "type": "string"
        },
        "SalesID": {
          "type": "string"
        },
        "CarrierType": {
          "pattern": "^3J0002|CQ0001|ER0010|1K0001|2G0001|1H0001|BK0001|EK0002|EJ1520$",
          "type": "string"
        },
        "CarrierId": {
          "type": "string"
        },
        "CarrierId1": {
          "type": "string"
        },
        "CarrierId2": {
          "type": "string"
        },
        "NPOBAN": {
          "type": "string"
        },
        "PrintMark": {
          "type": "string"
        },
        "Details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product.EInvoice.Model.Api.Invoice.AppendOrderDetailModel"
          }
        },
        "UseFor": {
          "type": "string"
        },
        "CompanyIdentifier": {
          "type": "string"
        },
        "DeviceNo": {
          "type": "string"
        },
        "Key": {
          "type": "string"
        },
        "CompanyID": {
          "type": "string"
        },
        "Timestamp": {
          "type": "string"
        },
        "Signature": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.Invoice.AppendOrderDetailModel": {
      "required": [
        "ProductName",
        "Quantity",
        "UnitPrice",
        "SubTotal"
      ],
      "type": "object",
      "properties": {
        "DetailID": {
          "pattern": "^[0-9]{3}",
          "type": "string"
        },
        "ProductID": {
          "type": "string"
        },
        "ProductName": {
          "type": "string"
        },
        "Quantity": {
          "format": "double",
          "type": "number"
        },
        "Unit": {
          "type": "string"
        },
        "UnitPrice": {
          "format": "double",
          "type": "number"
        },
        "SubTotal": {
          "format": "double",
          "type": "number"
        },
        "Remark": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.UpdateBlankIDModel": {
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.WebApi.Models.UpdateBlankId",
          "description": "空白發票號資料"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.UpdateBlankId": {
      "required": [
        "CompanyID",
        "Word",
        "StageYear",
        "StageMonth",
        "StartNumber",
        "EndNumber",
        "NextNumber"
      ],
      "type": "object",
      "properties": {
        "CompanyID": {
          "description": "公司統一編號",
          "maxLength": 8,
          "minLength": 0,
          "type": "string"
        },
        "Word": {
          "description": "發票字軌",
          "pattern": "^[A-Z]{2}$",
          "type": "string"
        },
        "StageYear": {
          "description": "發票期別年度",
          "pattern": "20[0-9]{2}",
          "type": "string"
        },
        "StageMonth": {
          "description": "發票期別偶數月",
          "pattern": "2|4|6|8|10|12",
          "type": "string"
        },
        "StartNumber": {
          "description": "發票該期起始號碼",
          "pattern": "^[0-9]{8}$",
          "type": "string"
        },
        "EndNumber": {
          "description": "發票該期結束號碼",
          "pattern": "^[0-9]{8}$",
          "type": "string"
        },
        "NextNumber": {
          "description": "發票該期下一個使用號",
          "pattern": "^[0-9]{8}$",
          "type": "string"
        },
        "Code": {
          "description": "發票號分號編碼",
          "type": "string"
        },
        "AssignNoKey": {
          "description": "發票KeyID",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.Allowance.AllowanceModel": {
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.Model.Api.Allowance.InsertAllowanceModel"
        },
        "CompanyID": {
          "type": "string"
        },
        "Timestamp": {
          "type": "string"
        },
        "Signature": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.Model.Api.Allowance.InsertAllowanceModel": {
      "required": [
        "SellerID",
        "SalesID",
        "BuyerID",
        "TaxAmount",
        "TotalAmount"
      ],
      "type": "object",
      "properties": {
        "AllowanceNumber": {
          "type": "string",
          "readOnly": true
        },
        "AllowanceNumberPrefix": {
          "maxLength": 16,
          "minLength": 0,
          "type": "string"
        },
        "AllowanceDateTime": {
          "format": "date-time",
          "type": "string"
        },
        "SellerID": {
          "maxLength": 8,
          "minLength": 0,
          "type": "string"
        },
        "SellerName": {
          "type": "string"
        },
        "SellerAddress": {
          "type": "string"
        },
        "SalesID": {
          "type": "string"
        },
        "BuyerID": {
          "maxLength": 10,
          "minLength": 0,
          "type": "string"
        },
        "BuyerName": {
          "type": "string"
        },
        "BuyerAddress": {
          "type": "string"
        },
        "AllowanceType": {
          "maxLength": 1,
          "minLength": 1,
          "type": "string"
        },
        "TaxAmount": {
          "format": "int32",
          "type": "integer"
        },
        "TotalAmount": {
          "format": "int32",
          "type": "integer"
        },
        "Remark": {
          "type": "string"
        },
        "AllowanceNoMode": {
          "type": "string"
        },
        "OriginalCurrencyTotalAmount": {
          "format": "double",
          "type": "number"
        },
        "ExportStage": {
          "type": "string"
        },
        "Details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Product.EInvoice.Model.Api.Allowance.InsertAllowanceDetailModel"
          }
        }
      }
    },
    "Product.EInvoice.Model.Api.Allowance.InsertAllowanceDetailModel": {
      "required": [
        "InvoiceNumber",
        "SequenceNumber",
        "Amount",
        "Quantity",
        "UnitPrice",
        "Tax"
      ],
      "type": "object",
      "properties": {
        "AllowanceNumber": {
          "type": "string"
        },
        "InvoiceNumber": {
          "type": "string"
        },
        "SequenceNumber": {
          "maxLength": 3,
          "minLength": 3,
          "type": "string"
        },
        "Amount": {
          "format": "double",
          "type": "number"
        },
        "Quantity": {
          "format": "double",
          "type": "number"
        },
        "UnitPrice": {
          "format": "double",
          "type": "number"
        },
        "Tax": {
          "format": "double",
          "type": "number"
        },
        "Description": {
          "type": "string"
        },
        "Unit": {
          "type": "string"
        },
        "ItemTaxType": {
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.AllowanceCancelModel": {
      "description": "折讓作廢",
      "required": [
        "CompanyID",
        "Timestamp",
        "Signature"
      ],
      "type": "object",
      "properties": {
        "Data": {
          "$ref": "#/definitions/Product.EInvoice.WebApi.Models.CancelAllowanceModel",
          "description": "折讓發票資料"
        },
        "CompanyID": {
          "description": "Company Identifier\r\n[eInvoice System Customer Company Identifier]",
          "type": "string"
        },
        "Timestamp": {
          "description": "TimeStamp\r\n[Reference website:\r\nhttps://www.unixtimestamp.com/]",
          "type": "string"
        },
        "Signature": {
          "description": "Signature\r\n[Steps to calculate the signature:\r\n1. String TimeStamp and Hash Salt into a single string\r\n2. Pass the stringed single string through SHA256 for hash operation\r\n3. Convert the result of the hash operation into a Hex string\r\nReference website:\r\nhttps://dotnetfiddle.net/u9XoOI]",
          "type": "string"
        }
      }
    },
    "Product.EInvoice.WebApi.Models.CancelAllowanceModel": {
      "required": [
        "SellerID",
        "AllowanceNumber",
        "Remark"
      ],
      "type": "object",
      "properties": {
        "SellerID": {
          "description": "公司ID(必填)",
          "maxLength": 8,
          "minLength": 0,
          "type": "string"
        },
        "AllowanceNumber": {
          "description": "發票號碼",
          "type": "string"
        },
        "SalesID": {
          "description": "發票相關使用者ID，如業務或會計",
          "type": "string"
        },
        "CancelDate": {
          "format": "date-time",
          "description": "作廢日期時間: 帶空值會以執行時間為作廢日期時間",
          "type": "string"
        },
        "CancelReason": {
          "description": "作廢原因: 帶空值會自動填入 [發票作廢]",
          "maxLength": 20,
          "minLength": 0,
          "type": "string"
        },
        "Remark": {
          "description": "備註",
          "maxLength": 200,
          "minLength": 0,
          "type": "string"
        }
      }
    }
  },
  "securityDefinitions": {
    "apiKey": {
      "type": "apiKey",
      "description": "API Key Authentication",
      "name": "apiKey",
      "in": "header"
    }
  }
}