# Get RD Submission Status

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /Documents/{documentNumber}/rd-submission-status:
    get:
      summary: Get RD Submission Status
      deprecated: false
      description: ตรวจสอบสถานะการนำส่งเอกสารไปยังกรมสรรพากร (RD)
      operationId: GetRdSubmissionStatus
      tags:
        - eTaxGo/Document Management
        - Documents
      parameters:
        - name: documentNumber
          in: path
          description: เลขที่เอกสาร
          required: true
          example: ''
          schema:
            type: string
            examples:
              - T2024001234
        - name: documentType
          in: query
          description: |
            รหัสประเภทเอกสาร:
            380=Invoice, 388=Tax Invoice, 80=Debit Note, 81=Credit Note,
            T01=Receipt, T02=Invoice/Tax Invoice, T03=Receipt/Tax Invoice,
            T04=Delivery Order/Tax Invoice, T05=Abbreviated Tax Invoice,
            T06=Receipt/Abbreviated Tax Invoice, T07=Cancellation Note
          required: true
          schema:
            type: string
            enum:
              - '380'
              - '388'
              - '80'
              - '81'
              - T01
              - T02
              - T03
              - T04
              - T05
              - T06
              - T07
            examples:
              - '388'
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: รหัส subscription key ของลูกค้า
          required: true
          example: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
          schema:
            type: string
      responses:
        '200':
          description: สำเร็จ — `status.isSuccess` = true
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      isSuccess:
                        type: boolean
                        examples:
                          - true
                    x-apidog-orders:
                      - isSuccess
                    x-apidog-ignore-properties: []
                  data:
                    type: object
                    properties:
                      documentNumber:
                        type: string
                        description: เลขที่เอกสาร
                        examples:
                          - T2024001234
                      documentType:
                        type: string
                        description: >
                          ประเภทเอกสาร: 380=Invoice, 388=Tax Invoice, 80=Debit
                          Note, 81=Credit Note, T01=Receipt, T02=Invoice/Tax
                          Invoice, T03=Receipt/Tax Invoice, T04=Delivery
                          Order/Tax Invoice, T05=Abbreviated Tax Invoice,
                          T06=Receipt/Abbreviated Tax Invoice, T07=Cancellation
                          Note
                        examples:
                          - '388'
                      rdSubmissionStatus:
                        type: string
                        description: >-
                          สถานะการอนุมัติของกรมสรรพากร (RD): PENDING | SUBMITTED
                          | APPROVED | REJECTED | CANCELLED
                        examples:
                          - APPROVED
                      submittedAt:
                        type: string
                        description: >-
                          วันเวลาที่นำส่งกรมสรรพากร (RD) (GMT+7, ไม่มี timezone
                          suffix)
                        examples:
                          - '2024-01-15T10:30:00'
                        nullable: true
                      approvedAt:
                        type: string
                        description: >-
                          วันเวลาที่กรมสรรพากร (RD) อนุมัติ (GMT+7, ไม่มี
                          timezone suffix)
                        examples:
                          - '2024-01-15T10:35:00'
                        nullable: true
                      rdConversationId:
                        type: string
                        description: หมายเลขอ้างอิงการนำส่งกรมสรรพากร
                        examples:
                          - RD-CONV-12345
                        nullable: true
                      rejectionReason:
                        type: string
                        description: >-
                          สาเหตุการปฏิเสธ (มีค่าเฉพาะเมื่อ rdSubmissionStatus =
                          REJECTED)
                        examples:
                          - null
                        nullable: true
                    x-apidog-orders:
                      - documentNumber
                      - documentType
                      - rdSubmissionStatus
                      - submittedAt
                      - approvedAt
                      - rdConversationId
                      - rejectionReason
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - data
                x-apidog-ignore-properties: []
              example:
                status:
                  isSuccess: true
                data:
                  documentNumber: T2024001234
                  documentType: '388'
                  rdSubmissionStatus: APPROVED
                  submittedAt: '2024-01-15T10:30:00'
                  approvedAt: '2024-01-15T10:35:00'
                  rdConversationId: RD-CONV-12345
          headers: {}
          x-apidog-name: ''
        '400':
          description: |
            ล้มเหลว — `status.isSuccess` ไม่ถูก return (default false)
            เช่น ไม่พบเอกสาร
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              example:
                status:
                  code: '4001'
                  description: Business error with more than 1 errors
                data:
                  errors:
                    - subCode: E1102
                      description: Document not found
          headers: {}
          x-apidog-name: ''
        '401':
          description: Unauthorized
          headers: {}
          x-apidog-name: ''
      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-36769215-run
components:
  schemas:
    ErrorEnvelope:
      type: object
      description: |
        HTTP 400 — business error
        `isSuccess` ไม่ถูก serialize (default false ถูก omit)
      properties:
        status:
          type: object
          properties:
            code:
              type: string
              description: '"4001" = 1 error, "4002" = หลาย errors'
              examples:
                - '4001'
            description:
              type: string
              examples:
                - Business error with more than 1 errors
          x-apidog-orders:
            - code
            - description
          x-apidog-ignore-properties: []
        data:
          type: object
          properties:
            errors:
              type: array
              items:
                type: object
                properties:
                  subCode:
                    type: string
                    description: >-
                      "E1102" = business error, "EXT9999" = internal server
                      error
                    examples:
                      - E1102
                  description:
                    type: string
                    description: ข้อความ error (free-text)
                    examples:
                      - Document not found
                x-apidog-orders:
                  - subCode
                  - description
                x-apidog-ignore-properties: []
          x-apidog-orders:
            - errors
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - status
        - data
      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: []

```
