# Create Document JSON

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /Documents/Json:
    post:
      summary: Create Document JSON
      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:
                Documents:
                  type: array
                  items:
                    type: object
                    properties:
                      DeliveryInfo:
                        type: object
                        properties:
                          EmailAddress1:
                            type: string
                          EmailAddress2:
                            type: string
                          SMSTelNo1:
                            type: string
                          Password:
                            type: string
                          PrintDeliveryType:
                            type: string
                          EDeliveryType:
                            type: string
                            description: 1 = ส่ง Email
                          IsAlertBySMS:
                            type: string
                            description: 1 = ส่ง SMS
                          TemplateToken:
                            type: string
                          CustomAction:
                            type: string
                            description: เงื่อนไขพิเศษ ติดต่อผู้ดูแล
                        required:
                          - TemplateToken
                          - CustomAction
                        x-apidog-orders:
                          - EmailAddress1
                          - EmailAddress2
                          - SMSTelNo1
                          - Password
                          - PrintDeliveryType
                          - EDeliveryType
                          - IsAlertBySMS
                          - TemplateToken
                          - CustomAction
                        x-apidog-ignore-properties: []
                      Header:
                        type: object
                        properties:
                          ExchangedDocument:
                            type: object
                            properties:
                              Id:
                                type: string
                              Name:
                                type: string
                              TypeCode:
                                type: string
                              IssueDateTime:
                                type: string
                              Purpose:
                                type: string
                              PurposeCode:
                                type: string
                              CreationDateTime:
                                type: string
                              Subject:
                                type: string
                              Content:
                                type: string
                            required:
                              - Id
                              - Name
                              - TypeCode
                              - IssueDateTime
                              - Purpose
                              - PurposeCode
                              - CreationDateTime
                              - Subject
                              - Content
                            x-apidog-orders:
                              - Id
                              - Name
                              - TypeCode
                              - IssueDateTime
                              - Purpose
                              - PurposeCode
                              - CreationDateTime
                              - Subject
                              - Content
                            x-apidog-ignore-properties: []
                          SellerTradeParty:
                            type: object
                            properties:
                              Id:
                                type: string
                              Name:
                                type: string
                              TaxId:
                                type: string
                              Postcode:
                                type: string
                              BuildingName:
                                type: string
                              AddressLine1:
                                type: string
                              AddressLine2:
                                type: string
                              Line3:
                                type: string
                              Line4:
                                type: string
                              Line5:
                                type: string
                              StreetName:
                                type: string
                              CityName:
                                type: string
                              CitySubDivisionName:
                                type: string
                              CountryId:
                                type: string
                              CountrySubDivisionName:
                                type: string
                              BuildingNumber:
                                type: string
                            required:
                              - Id
                              - Name
                              - TaxId
                              - Postcode
                              - BuildingName
                              - AddressLine1
                              - AddressLine2
                              - Line3
                              - Line4
                              - Line5
                              - StreetName
                              - CityName
                              - CitySubDivisionName
                              - CountryId
                              - CountrySubDivisionName
                              - BuildingNumber
                            x-apidog-orders:
                              - Id
                              - Name
                              - TaxId
                              - Postcode
                              - BuildingName
                              - AddressLine1
                              - AddressLine2
                              - Line3
                              - Line4
                              - Line5
                              - StreetName
                              - CityName
                              - CitySubDivisionName
                              - CountryId
                              - CountrySubDivisionName
                              - BuildingNumber
                            x-apidog-ignore-properties: []
                          BuyerTradeParty:
                            type: object
                            properties:
                              Id:
                                type: string
                              Name:
                                type: string
                              TaxId:
                                type: string
                              Postcode:
                                type: string
                              BuildingName:
                                type: string
                              AddressLine1:
                                type: string
                              AddressLine2:
                                type: string
                              Line3:
                                type: string
                              Line4:
                                type: string
                              Line5:
                                type: string
                              StreetName:
                                type: string
                              CityName:
                                type: string
                              CitySubDivisionName:
                                type: string
                              CountryId:
                                type: string
                              CountrySubDivisionName:
                                type: string
                              BuildingNumber:
                                type: string
                            required:
                              - Id
                              - Name
                              - TaxId
                              - Postcode
                              - BuildingName
                              - AddressLine1
                              - AddressLine2
                              - Line3
                              - Line4
                              - Line5
                              - StreetName
                              - CityName
                              - CitySubDivisionName
                              - CountryId
                              - CountrySubDivisionName
                              - BuildingNumber
                            x-apidog-orders:
                              - Id
                              - Name
                              - TaxId
                              - Postcode
                              - BuildingName
                              - AddressLine1
                              - AddressLine2
                              - Line3
                              - Line4
                              - Line5
                              - StreetName
                              - CityName
                              - CitySubDivisionName
                              - CountryId
                              - CountrySubDivisionName
                              - BuildingNumber
                            x-apidog-ignore-properties: []
                          AdditionalReferencedDocument:
                            type: object
                            properties:
                              IssueAssignedId:
                                type: string
                              IssueDateTime:
                                type: string
                              ReferenceTypeCode:
                                type: string
                            required:
                              - IssueAssignedId
                              - IssueDateTime
                              - ReferenceTypeCode
                            x-apidog-orders:
                              - IssueAssignedId
                              - IssueDateTime
                              - ReferenceTypeCode
                            x-apidog-ignore-properties: []
                          ApplicableTradeTax:
                            type: object
                            properties:
                              CurrencyCode:
                                type: string
                              TypeCode:
                                type: string
                              CalculatedRate:
                                type: string
                              BasisAmount:
                                type: string
                              CalculatedAmount:
                                type: string
                            required:
                              - CurrencyCode
                              - TypeCode
                              - CalculatedRate
                              - BasisAmount
                              - CalculatedAmount
                            x-apidog-orders:
                              - CurrencyCode
                              - TypeCode
                              - CalculatedRate
                              - BasisAmount
                              - CalculatedAmount
                            x-apidog-ignore-properties: []
                          SpecifiedTradeAllowance:
                            type: object
                            properties:
                              ChargeIndicator:
                                type: string
                              ActualAmount:
                                type: string
                              ReasonCode:
                                type: string
                              Reason:
                                type: string
                            required:
                              - ChargeIndicator
                              - ActualAmount
                              - ReasonCode
                              - Reason
                            x-apidog-orders:
                              - ChargeIndicator
                              - ActualAmount
                              - ReasonCode
                              - Reason
                            x-apidog-ignore-properties: []
                          SpecifiedTradeCharge:
                            type: object
                            properties:
                              ChargeIndicator:
                                type: string
                              ActualAmount:
                                type: string
                              ReasonCode:
                                type: string
                              Reason:
                                type: string
                            required:
                              - ChargeIndicator
                              - ActualAmount
                              - ReasonCode
                              - Reason
                            x-apidog-orders:
                              - ChargeIndicator
                              - ActualAmount
                              - ReasonCode
                              - Reason
                            x-apidog-ignore-properties: []
                          SpecifiedTradeSettlementHeaderMonetarySummation:
                            type: object
                            properties:
                              OriginalInformationAmount:
                                type: string
                              LineTotalAmount:
                                type: string
                              DifferenceSalesInformationAmount:
                                type: string
                              AllowanceTotalAmount:
                                type: string
                              ChargeTotalAmount:
                                type: string
                              TaxBasisTotalAmount:
                                type: string
                              TaxTotalAmount:
                                type: string
                              GrandTotalAmount:
                                type: string
                            required:
                              - OriginalInformationAmount
                              - LineTotalAmount
                              - DifferenceSalesInformationAmount
                              - AllowanceTotalAmount
                              - ChargeTotalAmount
                              - TaxBasisTotalAmount
                              - TaxTotalAmount
                              - GrandTotalAmount
                            x-apidog-orders:
                              - OriginalInformationAmount
                              - LineTotalAmount
                              - DifferenceSalesInformationAmount
                              - AllowanceTotalAmount
                              - ChargeTotalAmount
                              - TaxBasisTotalAmount
                              - TaxTotalAmount
                              - GrandTotalAmount
                            x-apidog-ignore-properties: []
                          Custom:
                            type: object
                            properties:
                              Custom01:
                                type: string
                              Custom02:
                                type: string
                              Custom03:
                                type: string
                              Custom04:
                                type: string
                              Custom05:
                                description: วันที่ครบกำหนดชำระ
                                type: string
                              Custom06:
                                description: วันที่ครบกำหนดส่ง
                                type: string
                              Custom07:
                                description: วันที่จัดส่ง
                                type: string
                              Custom08:
                                description: พนักงานขาย
                                type: string
                              Custom09:
                                type: string
                              Custom10:
                                description: จำนวนชิ้น
                                type: string
                              Custom11:
                                description: จำนวนรายการ
                                type: string
                              Custom12:
                                type: string
                              Custom13:
                                type: string
                              Custom14:
                                description: ข้อตกลง
                                type: string
                              Custom15:
                                description: หักส่วนลด
                                type: string
                              Custom16:
                                description: หักมัดจำ
                                type: string
                              Custom17:
                                description: มูลค่าสินค้ายกเว้นภาษี
                                type: string
                              Custom18:
                                type: string
                              Custom19:
                                type: string
                              Custom20:
                                type: string
                              Custom21:
                                type: string
                              Custom22:
                                type: string
                              Custom23:
                                type: string
                              Custom24:
                                type: string
                              Custom25:
                                description: ผู้รับสินค้า
                                type: string
                              Custom26:
                                description: ผู่ส่งสินค้า
                                type: string
                              Custom27:
                                description: ผู้ตรวจสอบ
                                type: string
                              Custom28:
                                description: ผู้อนุมัติ
                                type: string
                              Custom29:
                                type: string
                              Custom30:
                                type: string
                            required:
                              - Custom01
                              - Custom02
                              - Custom03
                              - Custom04
                              - Custom05
                              - Custom06
                              - Custom07
                              - Custom08
                              - Custom09
                              - Custom10
                              - Custom11
                              - Custom12
                              - Custom13
                              - Custom14
                              - Custom15
                              - Custom16
                              - Custom17
                              - Custom18
                              - Custom19
                              - Custom20
                              - Custom21
                              - Custom22
                              - Custom23
                              - Custom24
                              - Custom25
                              - Custom26
                              - Custom27
                              - Custom28
                              - Custom29
                              - Custom30
                            x-apidog-orders:
                              - Custom01
                              - Custom02
                              - Custom03
                              - Custom04
                              - Custom05
                              - Custom06
                              - Custom07
                              - Custom08
                              - Custom09
                              - Custom10
                              - Custom11
                              - Custom12
                              - Custom13
                              - Custom14
                              - Custom15
                              - Custom16
                              - Custom17
                              - Custom18
                              - Custom19
                              - Custom20
                              - Custom21
                              - Custom22
                              - Custom23
                              - Custom24
                              - Custom25
                              - Custom26
                              - Custom27
                              - Custom28
                              - Custom29
                              - Custom30
                            x-apidog-ignore-properties: []
                        required:
                          - ExchangedDocument
                          - SellerTradeParty
                          - BuyerTradeParty
                          - AdditionalReferencedDocument
                          - ApplicableTradeTax
                          - SpecifiedTradeAllowance
                          - SpecifiedTradeCharge
                          - SpecifiedTradeSettlementHeaderMonetarySummation
                        x-apidog-orders:
                          - ExchangedDocument
                          - SellerTradeParty
                          - BuyerTradeParty
                          - AdditionalReferencedDocument
                          - ApplicableTradeTax
                          - SpecifiedTradeAllowance
                          - SpecifiedTradeCharge
                          - SpecifiedTradeSettlementHeaderMonetarySummation
                          - Custom
                        x-apidog-ignore-properties: []
                      Details:
                        type: array
                        items:
                          type: object
                          properties:
                            IncludedSupplyChainTradeLineItem:
                              type: object
                              properties:
                                LineId:
                                  type: string
                                Id:
                                  type: string
                                Name:
                                  type: string
                                ChargeAmount:
                                  type: string
                                BilledQuantity:
                                  type: string
                                BilledQuantityUnit:
                                  type: string
                              required:
                                - LineId
                                - Id
                                - Name
                                - ChargeAmount
                                - BilledQuantity
                                - BilledQuantityUnit
                              x-apidog-orders:
                                - LineId
                                - Id
                                - Name
                                - ChargeAmount
                                - BilledQuantity
                                - BilledQuantityUnit
                              x-apidog-ignore-properties: []
                            ApplicableTradeTax:
                              type: object
                              properties:
                                TypeCode:
                                  type: string
                                CalculatedRate:
                                  type: string
                                BasisAmount:
                                  type: string
                                CalculatedAmount:
                                  type: string
                              required:
                                - TypeCode
                                - CalculatedRate
                                - BasisAmount
                                - CalculatedAmount
                              x-apidog-orders:
                                - TypeCode
                                - CalculatedRate
                                - BasisAmount
                                - CalculatedAmount
                              x-apidog-ignore-properties: []
                            SpecifiedTradeAllowance:
                              type: object
                              properties:
                                ChargeIndicator:
                                  type: string
                                ActualAmount:
                                  type: string
                                ReasonCode:
                                  type: string
                                Reason:
                                  type: string
                              required:
                                - ChargeIndicator
                                - ActualAmount
                                - ReasonCode
                                - Reason
                              x-apidog-orders:
                                - ChargeIndicator
                                - ActualAmount
                                - ReasonCode
                                - Reason
                              x-apidog-ignore-properties: []
                            SpecifiedTradeSettlementMonetarySummation:
                              type: object
                              properties:
                                TaxTotalAmount:
                                  type: string
                                NetLineTotalAmount:
                                  type: string
                                NetIncludingTaxesLineTotalAmount:
                                  type: string
                              required:
                                - TaxTotalAmount
                                - NetLineTotalAmount
                                - NetIncludingTaxesLineTotalAmount
                              x-apidog-orders:
                                - TaxTotalAmount
                                - NetLineTotalAmount
                                - NetIncludingTaxesLineTotalAmount
                              x-apidog-ignore-properties: []
                            Custom:
                              type: object
                              properties:
                                Custom01:
                                  type: string
                                Custom02:
                                  type: string
                                Custom03:
                                  type: string
                                Custom04:
                                  type: string
                                Custom05:
                                  type: string
                                Custom06:
                                  type: string
                                Custom07:
                                  type: string
                                Custom08:
                                  type: string
                                Custom09:
                                  type: string
                                Custom10:
                                  type: string
                              required:
                                - Custom01
                                - Custom02
                                - Custom03
                                - Custom04
                                - Custom05
                                - Custom06
                                - Custom07
                                - Custom08
                                - Custom09
                                - Custom10
                              x-apidog-orders:
                                - Custom01
                                - Custom02
                                - Custom03
                                - Custom04
                                - Custom05
                                - Custom06
                                - Custom07
                                - Custom08
                                - Custom09
                                - Custom10
                              x-apidog-ignore-properties: []
                          required:
                            - IncludedSupplyChainTradeLineItem
                            - ApplicableTradeTax
                            - SpecifiedTradeAllowance
                            - SpecifiedTradeSettlementMonetarySummation
                            - Custom
                          x-apidog-orders:
                            - IncludedSupplyChainTradeLineItem
                            - ApplicableTradeTax
                            - SpecifiedTradeAllowance
                            - SpecifiedTradeSettlementMonetarySummation
                            - Custom
                          x-apidog-ignore-properties: []
                    x-apidog-orders:
                      - DeliveryInfo
                      - 01J6E26WVB9JDTEKNDCNMAC8AA
                      - Header
                      - Details
                    required:
                      - Header
                      - Details
                    x-apidog-ignore-properties: []
              required:
                - Documents
              x-apidog-orders:
                - Documents
              x-apidog-ignore-properties: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  validate:
                    type: boolean
                    description: ผลตรวจสอบข้อมูล
                  validateEmail:
                    type: boolean
                    description: ผลตรวจสอบอีเมล
                  validateSms:
                    type: boolean
                    description: ผลตรวจสอบเบอร์สำหรับส่ง SMS
                  errorMessage:
                    type: string
                    description: >-
                      ข้อความ Error: แจ้งผลการตรวจสอบข้อมูลล้มเหลง
                      (ข้อมูลไม่ตรงหรือผิด)
                      โดยจะบอกข้อผิดพลาดทั้งหมดในข้อมูลที่ส่งมา
                    nullable: true
                  warningMessage:
                    type: string
                    description: >-
                      ข้อความเตือน: *ไม่มีผลต่อการสร้างเอกสาร*
                      แต่จะกระทบการทำงานอื่น ๆ เช่น Email ไม่ถูกต้อง
                      ทำให้ไม่สามารถส่ง Email ได้
                    nullable: true
                  batchId:
                    type: string
                    nullable: true
                  pdf:
                    type: string
                    description: ไฟล์ PDF ที่ถูก Encode มาเป็น Base64
                    nullable: true
                  isSuccess:
                    type: boolean
                    description: สร้างเอกสารสำเร็จหรือไม่
                  printQty:
                    type: number
                    nullable: true
                  templateToken:
                    type: string
                    nullable: true
                required:
                  - validate
                  - validateEmail
                  - validateSms
                  - errorMessage
                  - warningMessage
                  - batchId
                  - pdf
                  - isSuccess
                  - printQty
                  - templateToken
                x-apidog-orders:
                  - validate
                  - validateEmail
                  - validateSms
                  - errorMessage
                  - warningMessage
                  - batchId
                  - pdf
                  - isSuccess
                  - printQty
                  - templateToken
                x-apidog-ignore-properties: []
              example:
                validate: true
                validateEmail: true
                validateSms: true
                errorMessage: null
                warningMessage: null
                batchId: null
                pdf: ...base64 encoded pdf...
                isSuccess: true
                printQty: null
                templateToken: null
          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
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Forbidden
        x-200:OK:
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  ValidateEmail:
                    type: boolean
                    description: ผลตรวจสอบอีเมล
                  ValidateSms:
                    type: boolean
                    description: ผลตรวจสอบเบอร์สำหรับส่ง SMS
                  ErrorMessage:
                    type: string
                    description: >-
                      ข้อความ Error: แจ้งผลการตรวจสอบข้อมูลล้มเหลง
                      (ข้อมูลไม่ตรงหรือผิด)
                      โดยจะบอกข้อผิดพลาดทั้งหมดในข้อมูลที่ส่งมา
                  WarningMessage:
                    type: string
                    description: >-
                      ข้อความเตือน: ไม่มีผลต่อการสร้างเอกสาร
                      แต่จะกระทบการทำงานอื่น ๆ เช่น Email ไม่ถูกต้อง
                      ทำให้ไม่สามารถส่ง Email ได้
                  IsSuccess:
                    type: boolean
                    description: บอกสถานะ
                required:
                  - ValidateEmail
                  - ValidateSms
                  - ErrorMessage
                  - WarningMessage
                  - IsSuccess
                x-apidog-orders:
                  - ValidateEmail
                  - ValidateSms
                  - ErrorMessage
                  - WarningMessage
                  - IsSuccess
                x-apidog-ignore-properties: []
              example:
                validateEmail: true
                validateSms: true
                errorMessage: ErrorMessage
                warningMessage: ''
                isSuccess: false
          headers: {}
          x-apidog-name: OK
        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-3627535-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: []

```
