1. 开票[RPA/NS共用]
发票云(生态版)API文档
  • 错误处理 & 错误编码
  • 认证与安全[RPA/NS共用]
    • 内容安全
    • 认证
      POST
  • 订单[RPA/NS共用]
    • 对接指引
    • 创建订单
      POST
    • 关闭订单
      POST
    • 查询订单列表
      GET
  • 基础资料[RPA/NS共用]
    • 对接指引
    • 新增常用开票项
      POST
    • 删除常用开票项
      POST
    • 查询常用开票项列表
      GET
    • 新增常用不动产租赁明细
      POST
    • 删除常用不动产租赁明细
      POST
    • 查询常用不动产租赁明细列表
      GET
    • 新增电子税局账号
      POST
    • 删除电子税局账号
      POST
    • 查询电子税局账号列表
      GET
  • 开票[RPA/NS共用]
    • 对接指引
    • 查询电子税局账号状态
      GET
    • 登录电子税局账号
      POST
    • 获取电子税局扫脸认证二维码信息
      POST
    • 获取扫脸认证结果
      GET
    • 查询企业授信额度
      GET
    • 创建发票开具任务
      POST
    • 修改发票的开具任务
      PATCH
    • 查询发票的开具任务结果
      GET
  • 乐企联用[NS专用]
    • 创建乐企联用申请
    • 查询乐企联用申请结果
  • 发票查验
    • 发票查验
  • 数据模型
    • 开票数据结构
      • 订单
      • 电子税局账号
      • 企业对象
      • InvoiceLineItem
      • 不动产租赁明细
      • 税局城市编码
      • 电子税局登录角色
      • 扫脸认证二维码信息
      • 两位小数金额的字符串
      • 开票数据
      • 乐企联用申请
    • 公用代码
      • 医疗机构类型
      • 证件类型
      • 零税率标识
      • 发票状态标识
      • 是否蓝字发票
      • 开具类型(代开标识)
    • 查验数据结构
      • 发票状态
      • 发票类型
      • 数字化电子发票-增值税发票数据
      • 增值税发票数据
      • 增值税普通发票(卷式)数据
      • 增值税普通发票(通行费)数据
      • 机动车销售统一发票数据
      • 二手车销售统一发票数据
      • 航空运输客票电子行程单数据
      • 铁路电子客票数据
      • 数字化电子发票-机动车销售统一发票数据
      • 数字化电子发票-二手车销售统一发票数据
      • 财政票据数据
    • 响应数据结构
      • 错误响应
      • 分页信息
      • 批量新增的返回
      • 批量删除的返回
  1. 开票[RPA/NS共用]

创建发票开具任务

POST
/partners/invoice-issue-tasks

本接口用于生成单张开票任务,自动触发开票流程。支持自动补全开票项,适用于复杂业务场景下的开票自动化需求。
对于开具红票的情况下,数量和金额都应该传负数,单价传正数
如遇到开票异常,需传traceID来做重试、更改

1 发票金额算法

1.1 蓝票算法

不含税金额(四舍五入,保留两位小数)= 含税金额/(1+税率)
税额= 含税金额-不含税金额
不含税总金额=各行不含税金额相加
总税额 = 价税合计-不含税总金额
最后一项税额 = 总税额-(前n项税额之和)

1.2 红票算法

价税合计=取蓝票的价税合计
合计税额=取蓝票的合计税额
合计金额=取蓝票合计金额

2 明细项

不含税金额(四舍五入,保留两位小数)= 含税金额/(1+税率)
税额= 含税金额-不含税金额
最后一项不含税金额 = 合计金额-(前n项不含税金额之和)
最后一项税额 = 合计税额-(前n项税额之和)

3 误差规则

单行商品明细 |单价×数量-金额|<=0.01 元
|不含税金额×税率-税额|<=0.06元

4 发票开具校验注意事项

4.1 正数发票

正数发票合计金额>0 ;
价税合计=合计金额+合计税额;
开票合计金额 与 明细行所有金额加起来要一致;
开票合计税额 与 明细行所有税额加起来要一致;
除折扣行外,正数发票的商品行金额必须大于0 ;
正数发票每行商品行金额均不能为0,税额不能为负数 ;
折扣行金额不能大于被折扣行金额。多行折扣情况下,折扣行金额不能大于各被折扣行金额之和。
正数发票金额为负的商品行(即折扣行),其上一行商品金额必须为正。
单价和数量同时为空,或都不能为空 ;
金额、税额、数量、单价必须是合法数字 ;
折扣行税率必须与被折扣行税率相同。多行折扣情况下,各被折扣行税率相同,且与折扣行税率相同。

4.2 负数发票

负数发票合计金额<0 ;
价税合计=合计金额+合计税额;
开票合计金额 与 明细行所有金额加起来要一致;
开票合计税额 与 明细行所有税额加起来要一致;
负数发票的商品行金额必须小于0,税额不能为正数;
单价和数量同时为空,或都不能为空 ;
金额、税额、数量、单价必须是合法数字

请求参数

Header 参数

Body 参数application/json

示例
{
    "tax_no": "string",
    "etax_account": "string",
    "business_system_code": "stringst",
    "trade_no_list": [
        {
            "pay_type": "01",
            "out_trade_no": "string"
        }
    ],
    "invoice_request_id": "string",
    "type": 0,
    "tax_flag": 0,
    "paper_invoice_type": 1,
    "invoice_type": "26",
    "invoice_amount": 0,
    "total_tax_amount": 0,
    "total_amount": 0,
    "seller_name": "string",
    "seller_identifier": "string",
    "seller_address": "string",
    "seller_phone": "string",
    "seller_card_name": "string",
    "seller_card_number": "string",
    "show_seller_card": "N",
    "show_seller_address_tel": "Y",
    "natural_person_flag": "N",
    "buyer_name": "string",
    "buyer_address": "string",
    "buyer_fixed_telephone": "string",
    "buyer_card_name": "string",
    "buyer_card_number": "string",
    "buyer_mobile_phone": "string",
    "buyer_email": "string",
    "show_buyer_card": "N",
    "show_buyer_address_tel": "Y",
    "issuer": "string",
    "issuer_card_type": "100",
    "issuer_card_no": "string",
    "payee": "string",
    "reviewer": "string",
    "remark": "string",
    "agent_user": "string",
    "agent_card_type": "100",
    "agent_card_no": "string",
    "agent_country": "strin",
    "agent_identifier": "string",
    "agent_telephone": "string",
    "business_type": "01",
    "difference_tax_type": "01",
    "reduction_tax_type": "01",
    "agricul_goods_confirm": "Y",
    "natural_person_card_type": "100",
    "total_deduction": 0,
    "open_reason": "04",
    "origin_invoice_info": {
        "original_invoice_type": {},
        "original_gov_invoice_type": {},
        "original_invoice_code": "string",
        "original_invoice_no": "string",
        "original_etax_invoice_no": "string",
        "original_invoice_date": {},
        "red_reason": "01",
        "gov_red_confirm_bill_uuid": "string",
        "red_confirm_bill_no": "string",
        "red_confirm_enter_date": {}
    },
    "items": [
        {
            "index": 0,
            "line_number": 0,
            "discount_type": "0",
            "goods_name": "string",
            "unit": "string",
            "unit_price": "string",
            "detail_amount": 0,
            "tax_rate": 0,
            "tax_amount": 0,
            "discount_amount": 0,
            "preferential_policy": "0",
            "vat_exception": "01",
            "tax_free_type": "01",
            "product_code": "string",
            "specification": "string",
            "quantity": "string",
            "deduction_amount": 0,
            "itemId": "string"
        }
    ],
    "deduction_list": [
        {
            "evidence_type": "01",
            "etax_invoice_no": "string",
            "invoice_code": "string",
            "evidence_no": "string",
            "evidence_amount": 0,
            "remark": "string",
            "invoice_number": "string",
            "issue_date": "2024-01-01",
            "deduction_amount": 0
        }
    ],
    "extra_list": [
        {
            "extra_type": "string",
            "extra_name": "string",
            "extra_value": "string"
        }
    ],
    "build_info": {
        "detail_address": "string",
        "cross_city_tax_verify_no": "string",
        "construction_service_location": "string",
        "construction_project_name": "string",
        "land_value_tax_project_no": "string",
        "cross_city_flag": "1"
    },
    "freight_list": [
        {
            "start_place": "string",
            "end_place": "string",
            "transport_type": {},
            "transport_goods": "string",
            "transport_tool_plate_no": "string"
        }
    ],
    "estate_sale_info": {
        "estate_sale_co_flag": "Y",
        "estate_sale_co_buyer": [
            {
                "co_buyer_name": "string",
                "id_card_type": {},
                "id_no": "string"
            }
        ],
        "detail_list": [
            {
                "estate_code": "string",
                "detail_address": "string",
                "actual_turnover": "string",
                "area_unit": "string",
                "construction_service_location": "string",
                "cross_city_flag": "1",
                "land_value_tax_project_no": "string",
                "approved_tax_price": "string",
                "property_certificate_number": "string"
            }
        ]
    },
    "estate_lease_list": [
        {
            "detail_address": "string",
            "area_unit": "string",
            "property_certificate_number": "string",
            "construction_service_location": "string",
            "lease_start_date": "202411091130",
            "lease_end_date": "202411091130",
            "cross_city_flag": "1",
            "license_plate_number": "string",
            "lease_id": "string"
        }
    ],
    "vehicle_vessel_tax": {
        "tax_period": "202401",
        "amount": "string",
        "late_fee_amount": "string",
        "total_amount": "string",
        "identify_no": "string",
        "insurance_policy_no": "string",
        "vehicle_plate_or_vessel_registration_no": "string"
    },
    "traveler_list": [
        {
            "card_type": {},
            "card_no": "string",
            "travel_date": "2024-12-30",
            "start_place": "string",
            "end_place": "string",
            "transport_type": {},
            "seat_class": {},
            "passenger_name": "string"
        }
    ],
    "tractor_info": {
        "for_register": "Y",
        "engine_no": "string",
        "identify_no": "string"
    },
    "motor_vehicle": [
        {
            "compliance_no": "string",
            "import_no": "string",
            "engine_no": "string",
            "vehicle_weight": "string",
            "vehicle_capacity": "strin",
            "taxation_voucher": "string",
            "manufacturer": "string",
            "vehicle_uuid": "string",
            "identify_no": "string",
            "product_model": "string",
            "origin_place": "string",
            "inspection_no": "string",
            "vehicle_type_code": "string"
        }
    ],
    "coal_quality": {
        "coal_heat": "200",
        "total_sulfur_in_dry": "10",
        "dry_ash_free_volatile_matter": "20"
    },
    "lq_invoice_issue_mode_code": "01",
    "invoice_issue_type": "4",
    "natural_person_id_card": "string",
    "natural_person_country_code": "string",
    "buyer_tax_no": "string"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/partners/invoice-issue-tasks' \
--header 'Accept-Language;' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9' \
--header 'X-Request-Id: req_1701937730123_48210952' \
--header 'X-Encryption-Mode;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tax_no": "string",
    "etax_account": "string",
    "business_system_code": "stringst",
    "trade_no_list": [
        {
            "pay_type": "01",
            "out_trade_no": "string"
        }
    ],
    "invoice_request_id": "string",
    "type": 0,
    "tax_flag": 0,
    "paper_invoice_type": 1,
    "invoice_type": "26",
    "invoice_amount": 0,
    "total_tax_amount": 0,
    "total_amount": 0,
    "seller_name": "string",
    "seller_identifier": "string",
    "seller_address": "string",
    "seller_phone": "string",
    "seller_card_name": "string",
    "seller_card_number": "string",
    "show_seller_card": "N",
    "show_seller_address_tel": "Y",
    "natural_person_flag": "N",
    "buyer_name": "string",
    "buyer_address": "string",
    "buyer_fixed_telephone": "string",
    "buyer_card_name": "string",
    "buyer_card_number": "string",
    "buyer_mobile_phone": "string",
    "buyer_email": "string",
    "show_buyer_card": "N",
    "show_buyer_address_tel": "Y",
    "issuer": "string",
    "issuer_card_type": "100",
    "issuer_card_no": "string",
    "payee": "string",
    "reviewer": "string",
    "remark": "string",
    "agent_user": "string",
    "agent_card_type": "100",
    "agent_card_no": "string",
    "agent_country": "strin",
    "agent_identifier": "string",
    "agent_telephone": "string",
    "business_type": "01",
    "difference_tax_type": "01",
    "reduction_tax_type": "01",
    "agricul_goods_confirm": "Y",
    "natural_person_card_type": "100",
    "total_deduction": 0,
    "open_reason": "04",
    "origin_invoice_info": {
        "original_invoice_type": {},
        "original_gov_invoice_type": {},
        "original_invoice_code": "string",
        "original_invoice_no": "string",
        "original_etax_invoice_no": "string",
        "original_invoice_date": {},
        "red_reason": "01",
        "gov_red_confirm_bill_uuid": "string",
        "red_confirm_bill_no": "string",
        "red_confirm_enter_date": {}
    },
    "items": [
        {
            "index": 0,
            "line_number": 0,
            "discount_type": "0",
            "goods_name": "string",
            "unit": "string",
            "unit_price": "string",
            "detail_amount": 0,
            "tax_rate": 0,
            "tax_amount": 0,
            "discount_amount": 0,
            "preferential_policy": "0",
            "vat_exception": "01",
            "tax_free_type": "01",
            "product_code": "string",
            "specification": "string",
            "quantity": "string",
            "deduction_amount": 0,
            "itemId": "string"
        }
    ],
    "deduction_list": [
        {
            "evidence_type": "01",
            "etax_invoice_no": "string",
            "invoice_code": "string",
            "evidence_no": "string",
            "evidence_amount": 0,
            "remark": "string",
            "invoice_number": "string",
            "issue_date": "2024-01-01",
            "deduction_amount": 0
        }
    ],
    "extra_list": [
        {
            "extra_type": "string",
            "extra_name": "string",
            "extra_value": "string"
        }
    ],
    "build_info": {
        "detail_address": "string",
        "cross_city_tax_verify_no": "string",
        "construction_service_location": "string",
        "construction_project_name": "string",
        "land_value_tax_project_no": "string",
        "cross_city_flag": "1"
    },
    "freight_list": [
        {
            "start_place": "string",
            "end_place": "string",
            "transport_type": {},
            "transport_goods": "string",
            "transport_tool_plate_no": "string"
        }
    ],
    "estate_sale_info": {
        "estate_sale_co_flag": "Y",
        "estate_sale_co_buyer": [
            {
                "co_buyer_name": "string",
                "id_card_type": {},
                "id_no": "string"
            }
        ],
        "detail_list": [
            {
                "estate_code": "string",
                "detail_address": "string",
                "actual_turnover": "string",
                "area_unit": "string",
                "construction_service_location": "string",
                "cross_city_flag": "1",
                "land_value_tax_project_no": "string",
                "approved_tax_price": "string",
                "property_certificate_number": "string"
            }
        ]
    },
    "estate_lease_list": [
        {
            "detail_address": "string",
            "area_unit": "string",
            "property_certificate_number": "string",
            "construction_service_location": "string",
            "lease_start_date": "202411091130",
            "lease_end_date": "202411091130",
            "cross_city_flag": "1",
            "license_plate_number": "string",
            "lease_id": "string"
        }
    ],
    "vehicle_vessel_tax": {
        "tax_period": "202401",
        "amount": "string",
        "late_fee_amount": "string",
        "total_amount": "string",
        "identify_no": "string",
        "insurance_policy_no": "string",
        "vehicle_plate_or_vessel_registration_no": "string"
    },
    "traveler_list": [
        {
            "card_type": {},
            "card_no": "string",
            "travel_date": "2024-12-30",
            "start_place": "string",
            "end_place": "string",
            "transport_type": {},
            "seat_class": {},
            "passenger_name": "string"
        }
    ],
    "tractor_info": {
        "for_register": "Y",
        "engine_no": "string",
        "identify_no": "string"
    },
    "motor_vehicle": [
        {
            "compliance_no": "string",
            "import_no": "string",
            "engine_no": "string",
            "vehicle_weight": "string",
            "vehicle_capacity": "strin",
            "taxation_voucher": "string",
            "manufacturer": "string",
            "vehicle_uuid": "string",
            "identify_no": "string",
            "product_model": "string",
            "origin_place": "string",
            "inspection_no": "string",
            "vehicle_type_code": "string"
        }
    ],
    "coal_quality": {
        "coal_heat": "200",
        "total_sulfur_in_dry": "10",
        "dry_ash_free_volatile_matter": "20"
    },
    "lq_invoice_issue_mode_code": "01",
    "invoice_issue_type": "4",
    "natural_person_id_card": "string",
    "natural_person_country_code": "string",
    "buyer_tax_no": "string"
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "task_id": "string"
}
修改于 2026-04-24 06:36:19
上一页
查询企业授信额度
下一页
修改发票的开具任务
Built with