# Update Tax Invoice

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /Documents/Tax-Invoice:
    put:
      summary: Update Tax Invoice
      deprecated: false
      description: ''
      tags:
        - eTaxGo/Document Management
        - Documents
      parameters:
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: ''
          required: true
          example: รหัส subscription key ของลูกค้า
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: false
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                SellerKey:
                  type: string
                  description: ข้อมูลที่ลูกค้าต้องกรอก รับเป็น TaxId ของ company 13 หลัก
                BranchCode:
                  type: string
                  description: โค้ดย่อย 5 ตัวหลังของ company (SellerKey)
                DocumentNo:
                  type: string
                  description: เลขเอกสาร
                CreatedDate:
                  type: string
                  description: วันที่สร้างเอกสาร
                IssueDateTime:
                  type: string
                  description: วันที่ออกเอกสาร
                ReferenceDocument:
                  type: object
                  properties:
                    ReferenceNo:
                      type: string
                      description: เอกอ้างอิงเอกสาร
                    ReferenceCode:
                      type: string
                      description: โค้ดอ้างอิงประเภทเอกสาร
                  required:
                    - ReferenceNo
                    - ReferenceCode
                  x-apidog-orders:
                    - ReferenceNo
                    - ReferenceCode
                  description: เลขเอกสารอ้างอิง
                  x-apidog-ignore-properties: []
                ReasonCode:
                  type: string
                  description: code สาเหตุของการแก้ไข
                Reason:
                  type: string
                  description: กรณีที่ใส่โค้ดเป็น อื่นๆ ให้กรอกข้อมูลเพิ่มเติม
                TemplateToken:
                  type: string
                  description: เทมเพลตโทเค็น
                BuyerDetail:
                  type: object
                  properties:
                    CustomerType:
                      type: string
                      description: >-
                        ประเภทลูกค้า ให้ใส่ข้อมูลเป็นโค้ด บุคคลธรรมดา(NIDN)
                        นิติบุคคล(TXID) ชาวต่างชาติ(CCPT)
                    TaxId:
                      type: string
                      description: เลขประจำตัวผู้เสียภาษี
                    CustomerName:
                      type: string
                      description: ชื่อลูกค้า
                    Address:
                      type: string
                      description: ที่อยู่
                    SubDistrict:
                      type: string
                      description: แขวง/ตำบล
                    District:
                      type: string
                      description: เขต/อำเภอ
                    Province:
                      type: string
                      description: จังหวัด
                    PostCode:
                      type: string
                      description: รหัสไปรษณีย์
                  required:
                    - CustomerType
                    - TaxId
                    - CustomerName
                    - Address
                    - SubDistrict
                    - District
                    - Province
                    - PostCode
                  x-apidog-orders:
                    - CustomerType
                    - TaxId
                    - CustomerName
                    - Address
                    - SubDistrict
                    - District
                    - Province
                    - PostCode
                  description: ข้อมูลผู้ซื้อ
                  x-apidog-ignore-properties: []
                Mobile:
                  type: string
                  description: เบอร์โทร
                Email:
                  type: string
                  description: อีเมล
                PdfFile:
                  type: string
                  description: เพิ่ม pdf สำหรับ sign CA
              required:
                - SellerKey
                - BranchCode
                - DocumentNo
                - CreatedDate
                - IssueDateTime
                - ReferenceDocument
                - ReasonCode
                - Reason
                - TemplateToken
                - BuyerDetail
                - Mobile
                - Email
              x-apidog-orders:
                - SellerKey
                - BranchCode
                - DocumentNo
                - CreatedDate
                - IssueDateTime
                - ReferenceDocument
                - ReasonCode
                - Reason
                - TemplateToken
                - BuyerDetail
                - Mobile
                - Email
                - PdfFile
              x-apidog-ignore-properties: []
            example:
              SellerKey: '9876543210987'
              BranchCode: '00000'
              DocumentNo: XYZ987654321
              CreatedDate: '2025-01-01T12:00:00'
              IssueDateTime: '2025-01-01T14:00:00'
              ReferenceDocument:
                ReferenceNo: REF123456789
                ReferenceCode: ABCD1234
              ReasonCode: DBNG01
              Reason: สินค้าชำรุดเสียหาย
              TemplateToken: a1b2c3d4-e5f6-7890-abcd-ef1234567890
              BuyerDetail:
                CustomerType: NIDN
                TaxID: '45678912345'
                CustomerName: บริษัท เอ็กซแซมเปิ้ล จำกัด
                Address: 123/321
                SubDistrict: พระบรมมหาราชวัง
                District: พระนคร
                Province: กรุงเทพมหานคร
                PostCode: '10010'
              Mobile: '0812345679'
              Email: Test1234@gmail.com
              PdfFile: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      isSuccess:
                        type: boolean
                        description: บอกสถานะ
                    required:
                      - isSuccess
                    x-apidog-orders:
                      - isSuccess
                    x-apidog-ignore-properties: []
                  data:
                    type: object
                    properties:
                      validate:
                        type: boolean
                        description: ผลตรวจสอบข้อมูล
                      validateEmail:
                        type: boolean
                        description: ผลตรวจสอบอีเมล
                      validateSms:
                        type: boolean
                        description: ผลตรวจสอบเบอร์สำหรับส่ง SMS
                      warningMessage:
                        type: string
                        description: >-
                          ข้อความ Error: แจ้งผลการตรวจสอบข้อมูลล้มเหลง
                          (ข้อมูลไม่ตรงหรือผิด)
                          โดยจะบอกข้อผิดพลาดทั้งหมดในข้อมูลที่ส่งมา
                      pdf:
                        type: string
                        description: ไฟล์ PDF ที่ถูก Encode มาเป็น Base64
                      isSuccess:
                        type: boolean
                        description: สร้างเอกสารสำเร็จหรือไม่
                    required:
                      - validate
                      - validateEmail
                      - validateSms
                      - warningMessage
                      - pdf
                      - isSuccess
                    x-apidog-orders:
                      - validate
                      - validateEmail
                      - validateSms
                      - warningMessage
                      - pdf
                      - isSuccess
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - data
                x-apidog-orders:
                  - status
                  - data
                x-apidog-ignore-properties: []
              example:
                status:
                  isSuccess: true
                data:
                  validate: true
                  validateEmail: true
                  validateSms: true
                  warningMessage: ''
                  pdf: ''
                  isSuccess: true
          headers: {}
          x-apidog-name: Success
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Unauthorized
        x-200:User authentication required V2.:
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Required%20authorization'
                  status:
                    $ref: '#/components/schemas/Response%20Error%20Msg%20'
                required:
                  - data
                  - status
                x-apidog-orders:
                  - data
                  - status
                x-apidog-ignore-properties: []
              example:
                data:
                  subCode: E9103
                  description: Authorization credentials required
                  metadata: {}
                status:
                  code: '4001'
                  description: Business error with 1 errors
          headers: {}
          x-apidog-name: User authentication required V2.
      security:
        - bearer: []
      x-apidog-folder: eTaxGo/Document Management
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-12635170-run
components:
  schemas:
    'Response Error Msg ':
      type: object
      properties:
        code:
          type: string
          x-apidog-mock: '4001'
        description:
          type: string
          x-apidog-mock: Business error with 1 errors
      required:
        - code
        - description
      x-apidog-orders:
        - code
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Required authorization:
      type: object
      properties:
        subCode:
          type: string
          x-apidog-mock: E9103
        description:
          type: string
          x-apidog-mock: Authorization credentials required
        metadata:
          type: object
          properties: {}
          x-apidog-orders: []
          x-apidog-ignore-properties: []
      required:
        - subCode
        - description
        - metadata
      x-apidog-orders:
        - subCode
        - description
        - metadata
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: ใส่ JWT Token ในรูปแบบ Bearer {token}
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.gofive.co.th
    description: Production
security:
  - bearerAuth: []
    x-apidog:
      schemeGroups:
        - id: uyL_cJmK7q60QJZRTi5ot
          schemeIds:
            - bearerAuth
      required: true
      use:
        id: uyL_cJmK7q60QJZRTi5ot
      scopes:
        uyL_cJmK7q60QJZRTi5ot:
          bearerAuth: []

```
