# 6.02 查询全球发票识别任务结果

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /kapi/v2/rim/message/service:
    post:
      summary: 6.02 查询全球发票识别任务结果
      deprecated: false
      description: |-
        1、该接口需要加购智能文档取数产品，按次收费
        2、该接口为异步处理接口，先调用识别接口，再调用本接口查询结果
      tags:
        - 收票/全球发票识别/全球发票识别异步接口
      parameters:
        - name: access_token
          in: query
          description: token
          required: true
          example: ''
          schema:
            type: string
        - name: access_token
          in: header
          description: ''
          example: '{{access_token}}'
          schema:
            type: string
            default: '{{access_token}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: ''
              properties:
                messageType:
                  type: string
                  description: 接口类型:getAiRecognitionResult
                messageId:
                  type: string
                  description: 请求id
                data:
                  type: object
                  properties:
                    taskIds:
                      type: string
                      title: 任务号
                      description: data:{"taskIds":["taskId1","taskId2"]}
                  x-apifox-orders:
                    - taskIds
                  description: '最多支持10个批量查询 '
                  required:
                    - taskIds
                  x-apifox-ignore-properties: []
              required:
                - messageType
                - messageId
                - data
              x-apifox-orders:
                - messageType
                - messageId
                - data
              x-apifox-ignore-properties: []
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    title: 调用结果
                    description: true或false
                  errorCode:
                    type: string
                    title: 错误码
                    description: 0000-成功
                  errorMessage:
                    type: string
                    title: 错误描述
                  data:
                    type: object
                    properties:
                      taskId1:
                        type: object
                        properties:
                          taskStatus:
                            type: string
                            enum:
                              - SUCCESS
                              - FAILED
                              - PROCESSING
                              - PARTIAL_SUCCESS
                            x-apifox-enum:
                              - value: SUCCESS
                                name: ''
                                description: 成功
                              - value: FAILED
                                name: ''
                                description: 失败
                              - value: PROCESSING
                                name: ''
                                description: 处理中
                              - value: PARTIAL_SUCCESS
                                name: ''
                                description: 部分成功
                          errorCode:
                            type: string
                            enum:
                              - '2005'
                              - C0110
                            x-apifox-enum:
                              - value: '2005'
                                name: 识别失败文件中无有效信息
                                description: ''
                              - value: C0110
                                name: 底层大模型异常
                                description: ''
                          errorMessage:
                            type: string
                          items:
                            type: array
                            items: &ref_0
                              $ref: >-
                                #/components/schemas/%E5%85%A8%E7%90%83%E5%8F%91%E7%A5%A8%E8%BF%94%E5%9B%9E%E7%BB%93%E6%9E%9C%20%E6%96%B0
                        x-apifox-orders:
                          - taskStatus
                          - errorCode
                          - errorMessage
                          - items
                        required:
                          - taskStatus
                        x-apifox-ignore-properties: []
                      taskId2:
                        type: object
                        properties:
                          taskStatus:
                            type: string
                            enum:
                              - SUCCESS
                              - FAILED
                              - PROCESSING
                              - PARTIAL_SUCCESS
                            x-apifox-enum:
                              - value: SUCCESS
                                name: ''
                                description: ''
                              - value: FAILED
                                name: ''
                                description: ''
                              - value: PROCESSING
                                name: ''
                                description: ''
                              - value: PARTIAL_SUCCESS
                                name: ''
                                description: ''
                          errorCode:
                            type: string
                          errorMessage:
                            type: string
                          items:
                            type: array
                            items: *ref_0
                        x-apifox-orders:
                          - taskStatus
                          - errorCode
                          - errorMessage
                          - items
                        required:
                          - taskStatus
                        x-apifox-ignore-properties: []
                    x-apifox-orders:
                      - taskId1
                      - taskId2
                    x-apifox-ignore-properties: []
                required:
                  - status
                  - errorCode
                  - errorMessage
                x-apifox-orders:
                  - status
                  - errorCode
                  - errorMessage
                  - data
                x-apifox-ignore-properties: []
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 收票/全球发票识别/全球发票识别异步接口
      x-apifox-status: developing
      x-run-in-apifox: https://app.apifox.com/web/project/3905935/apis/api-368020901-run
components:
  schemas:
    全球发票返回结果 新:
      type: object
      properties:
        serialNo:
          type: string
          title: 系统唯一流水号
          description: 系统内部生成的唯一业务追踪流水号
        invoiceType:
          type: string
          title: 票据类型
          description: 票据的大类枚举值：30代表发票，31代表收据
          enum:
            - '30'
            - '31'
          x-apifox-enum:
            - value: '30'
              name: invoice
              description: 发票
            - value: '31'
              name: receipt
              description: 收据
        invoiceSubType:
          type: string
          title: 票据细分类型
          description: 当票据类型为invoice(30)时返回的具体子类，如商业发票、贷记单、增值税发票等
          enum:
            - '380'
            - '381'
            - '388'
            - '325'
          x-apifox-enum:
            - value: '380'
              name: Commercial Invoice
              description: 商业发票
            - value: '381'
              name: Credit Note
              description: 贷记单/红字发票
            - value: '388'
              name: Tax Invoice
              description: 税务发票
            - value: '325'
              name: Proforma Invoice
              description: 形式发票
        invoiceNo:
          type: string
          title: 发票号码
          description: 票据票面上的唯一编号
          examples:
            - '12683726300'
        invoiceDate:
          type: string
          title: 开票日期
          description: 票据开具的日期，通常格式为 YYYY-MM-DD
          examples:
            - '2025-05-16'
        totalAmount:
          type: string
          title: 价税合计
          description: 含税的总金额，即不含税金额与税额之和
          examples:
            - '100.00'
        invoiceAmount:
          type: string
          title: 不含税金额
          description: 票据扣除税率后的净额
        totalTaxAmount:
          type: string
          title: 税额
          description: 票据上列明的总税费金额
        country:
          type: string
          title: 国家
          description: 开票所属国家或地区名称
          examples:
            - Singapore
        currency:
          type: string
          title: 币别
          description: 结算使用的货币代码，如SGD、USD、CNY
          examples:
            - SGD
        buyerName:
          type: string
          title: 购方名称
          description: 购买方（客户）的单位全称或个人姓名
        buyerTaxNo:
          type: string
          title: 购方税号
          description: 购买方的纳税人识别号或统一社会信用代码
        salerName:
          type: string
          title: 销方名称
          description: 销售方（供应商）的单位全称
        salerTaxNo:
          type: string
          title: 销方税号
          description: 销售方的纳税人识别号或统一社会信用代码
        extJson:
          title: 发票详情结构化数据
          description: 包含发票完整解析后的明细数据对象，包含表头和行项目
          type: object
          properties:
            header:
              type: object
              title: 表头信息
              description: 发票的主体非明细信息，如购销双方详情、支付条款等
              properties:
                billFrom:
                  type: object
                  title: 销方详细信息
                  properties:
                    billFromBankAccount:
                      type: string
                      title: 销方银行账号
                      description: 销方开户行账号
                    billFromCity:
                      type: string
                      title: 销方城市
                      description: 销方所属城市
                    billFromEmail:
                      type: string
                      title: 销方邮箱
                      description: 销方联系电子邮件
                    billFromComposite:
                      type: string
                      title: 销方地址全称
                      description: 销方完整的办公或注册地址
                    billFromTelephone:
                      type: string
                      title: 销方电话
                      description: 销方联系电话
                    billFromFax:
                      type: string
                      title: 销方传真
                      description: 销方传真号码
                    billFromStateOrProvince:
                      type: string
                      title: 销方省份
                      description: 销方所属省/州
                    billFromPostalCode:
                      type: string
                      title: 销方邮编
                      description: 销方地址邮政编码
                    billFromBankOfAccount:
                      type: string
                      title: 销方开户行
                      description: 销方银行账户的开户行名称
                    billFromCountry:
                      type: string
                      title: 销方国家
                      description: 销方所属国家代码或名称
                  x-apifox-orders:
                    - billFromBankAccount
                    - billFromCity
                    - billFromEmail
                    - billFromComposite
                    - billFromTelephone
                    - billFromFax
                    - billFromStateOrProvince
                    - billFromPostalCode
                    - billFromBankOfAccount
                    - billFromCountry
                  x-apifox-ignore-properties: []
                billTo:
                  type: object
                  title: 购方详细信息
                  properties:
                    billToBankOfAccount:
                      type: string
                      title: 购方开户行
                      description: 购方银行账户开户行名称
                    billToEmail:
                      type: string
                      title: 购方邮箱
                      description: 购方联系电子邮件
                    billToPostalCode:
                      type: string
                      title: 购方邮编
                      description: 购方地址邮政编码
                    billToCity:
                      type: string
                      title: 购方城市
                      description: 购方所属城市
                    billToComposite:
                      type: string
                      title: 购方地址全称
                      description: 购方完整的注册或收票地址
                    billToTelephone:
                      type: string
                      title: 购方电话
                      description: 购方联系电话
                    billToRecipient:
                      type: string
                      title: 购方收件人
                      description: 指定的发票接收人姓名
                    billToBankAccount:
                      type: string
                      title: 购方银行账号
                      description: 购方银行账号
                    billToFax:
                      type: string
                      title: 购方传真
                      description: 购方传真号码
                    billToCountry:
                      type: string
                      title: 购方国家
                      description: 购方所属国家
                    billToStateOrProvince:
                      type: string
                      title: 购方省份
                      description: 购方所属省/州
                  x-apifox-orders:
                    - billToBankOfAccount
                    - billToEmail
                    - billToPostalCode
                    - billToCity
                    - billToComposite
                    - billToTelephone
                    - billToRecipient
                    - billToBankAccount
                    - billToFax
                    - billToCountry
                    - billToStateOrProvince
                  x-apifox-ignore-properties: []
                payment:
                  type: object
                  title: 支付信息
                  description: 涉及付款条件、汇率及支付状态的信息
                  properties:
                    exchangeRate:
                      type: string
                      title: 汇率
                      description: 外币结算时的转换比率
                    dueDate:
                      type: string
                      title: 付款截止日期
                      description: 发票规定的最后付款限期
                    paymentMethod:
                      type: string
                      title: 支付方式
                      description: 如银行转账、现金、支票等
                    paymentCurrency:
                      type: string
                      title: 支付币别
                      description: 实际支付时使用的币种
                    paidAmount:
                      type: string
                      title: 已付金额
                      description: 该张票据已完成支付的金额
                    paymentStatus:
                      type: string
                      title: 支付状态
                      description: 当前付款进度状态
                    paymentTerms:
                      type: string
                      title: 付款条件
                      description: 付款约定的描述，如Net 30
                  x-apifox-orders:
                    - exchangeRate
                    - dueDate
                    - paymentMethod
                    - paymentCurrency
                    - paidAmount
                    - paymentStatus
                    - paymentTerms
                  x-apifox-ignore-properties: []
                basic:
                  type: object
                  title: 基础信息
                  description: 发票的基础元数据
                  properties:
                    nameOfInvoice:
                      type: string
                      title: 发票名称
                      description: 票据上印刷的正式标题
                    sourceFileHash:
                      type: string
                      title: 源文件哈希
                      description: 附件文件的哈希值
                    page:
                      type: array
                      title: 页码列表
                      description: 发票所在的页码范围
                      items:
                        type: string
                    invoiceCode:
                      type: string
                      title: 发票代码
                      description: 部分国家或地区发票特有的代码
                  x-apifox-orders:
                    - nameOfInvoice
                    - sourceFileHash
                    - page
                    - invoiceCode
                  x-apifox-ignore-properties: []
                bussiness:
                  type: object
                  title: 业务信息
                  description: 关联的业务单据信息
                  properties:
                    startDate:
                      type: string
                      title: 服务开始日期
                      description: 周期性服务合同的开始时间
                    endDate:
                      type: string
                      title: 服务结束日期
                      description: 周期性服务合同的结束时间
                    purchaseOrderNumber:
                      type: string
                      title: 采购订单号(PO)
                      description: 客户侧的采购订单编号
                    contractNumber:
                      type: string
                      title: 合同编号
                      description: 该交易所依据的合同号
                  x-apifox-orders:
                    - startDate
                    - endDate
                    - purchaseOrderNumber
                    - contractNumber
                  x-apifox-ignore-properties: []
              x-apifox-orders:
                - billFrom
                - billTo
                - payment
                - basic
                - bussiness
              x-apifox-ignore-properties: []
            detail:
              type: object
              title: 明细信息
              description: 发票的行项目数据
              properties:
                detailOfGoodsOrServices:
                  type: array
                  title: 商品明细信息
                  description: 逐行列出的具体商品或服务项目清单
                  items:
                    type: object
                    properties:
                      unitPrice:
                        type: string
                        title: 单价
                        description: 单位商品或服务的价格
                      taxRate:
                        type: string
                        title: 税率
                        description: 该行对应的税率比例
                      articleName:
                        type: string
                        title: 商品名称
                        description: 货物或服务的简要名称
                      quantity:
                        type: string
                        title: 数量
                        description: 商品或服务的成交数量
                      orderNumber:
                        type: string
                        title: 行号
                        description: 明细行在票面上的序号
                      unitOfMeasure:
                        type: string
                        title: 计量单位
                        description: 如：件、套、月、小时等
                      netAmount:
                        type: string
                        title: 净额
                        description: 该行不含税的总金额
                      articleID:
                        type: string
                        title: 商品编号
                        description: 销方内部的商品SKU或编码
                      description:
                        type: string
                        title: 描述
                        description: 该行项目的详细描述说明
                      tax:
                        type: string
                        title: 税额
                        description: 该行产生的税费金额
                      grossAmount:
                        type: string
                        title: 含税金额
                        description: 该行项目的价税合计金额
                    x-apifox-orders:
                      - unitPrice
                      - taxRate
                      - articleName
                      - quantity
                      - orderNumber
                      - unitOfMeasure
                      - netAmount
                      - articleID
                      - description
                      - tax
                      - grossAmount
                    x-apifox-ignore-properties: []
                detailOfTaxSummary:
                  type: array
                  title: 税明细信息
                  description: 按税率或税种分类统计的汇总信息
                  items:
                    type: object
                    properties:
                      taxRate:
                        type: string
                        title: 税率
                        description: 对应的税率百分比
                      netTaxableAmount:
                        type: string
                        title: 应纳税净额
                        description: 该税率下对应的计税基数（不含税）
                      tax:
                        type: string
                        title: 税额
                        description: 该分类下的总税金
                      taxCategory:
                        type: string
                        title: 税种类别
                        description: 税种描述，如VAT、GST、WHT等
                    x-apifox-orders:
                      - taxRate
                      - netTaxableAmount
                      - tax
                      - taxCategory
                    x-apifox-ignore-properties: []
              x-apifox-orders:
                - detailOfGoodsOrServices
                - detailOfTaxSummary
              x-apifox-ignore-properties: []
          x-apifox-orders:
            - header
            - detail
          x-apifox-ignore-properties: []
        verifyResult:
          type: string
          title: 合规性校验结果
          description: 当verifyFlag开启时，返回的详细自动化校验结论
        status:
          type: string
          title: 状态码
          description: 接口调用的结果状态：success表示成功，failed表示失败
          enum:
            - success
            - failed
        errorCode:
          type: string
          title: 错误码
          description: 业务执行失败时的错误分类代码
          enum:
            - '2002'
          x-apifox-enum:
            - value: '2002'
              name: 关键字段缺失入库失败
              description: 提交的数据缺少系统要求的核心字段
        errorMessage:
          type: string
          title: 错误描述
          description: 具体的错误原因详细文本，便于人工排查
      required:
        - status
      x-apifox-orders:
        - serialNo
        - invoiceType
        - invoiceSubType
        - invoiceNo
        - invoiceDate
        - totalAmount
        - invoiceAmount
        - totalTaxAmount
        - country
        - currency
        - buyerName
        - buyerTaxNo
        - salerName
        - salerTaxNo
        - extJson
        - verifyResult
        - status
        - errorCode
        - errorMessage
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes: {}
servers:
  - url: https://cosmic-demo.piaozone.com/demo
    description: 测试环境
  - url: https://cosmic-sandbox.piaozone.com/jdpjykjyxgs
    description: 快速开始环境
security: []

```
