收藏
回答

将发票数据插入到卡包提示必填性规则校验失败

{"code":"PARAM_ERROR","detail":{"location":"uri_template","value":""},"message":"输入源“/uri_template/scene”映射到字段“插卡场景”必填性规则校验失败,此字段为必填项"}

request_data = {
            "sub_mchid": sub_mchid,
            "scene": "WITH_WECHATPAY",
            "buyer_information": buyer_info,
            "fapiao_card_information": [
                {
                    "fapiao_media_id": fapiao_media_id,
                    "fapiao_number": fphm,
                    "fapiao_code": fpdm,
                    "fapiao_time": fapiao_time,
                    "check_code": check_code,
                    "password": password,
                    "total_amount": total_amount,
                    "amount": amount,
                    "tax_amount": tax_amount,
                    "seller_information": seller_info,
                    "extra_information": {
                        "payee": drawer,
                        "reviewer": drawer,
                        "drawer": drawer
                    },
                    "items": items,
                    "remark": "电子发票自动存入微信卡包"
                }
            ]
        }
回答关注问题邀请回答
收藏

2 个回答

  • 支付社区运营
    支付社区运营
    10-13

    你好 该报错为字面意思报错,辛苦参照文档结合业务填写该字段值

    10-13
    有用
    回复
  • 智票云快速开票官方客服
    智票云快速开票官方客服
    10-24

    响应体: {"code":"PARAM_ERROR","detail":{"location":"uri_template","value":""},"message":"输入源“/uri_template/scene”映射到字段“插卡场景”必填性规则校验失败,此字段为必填项"}

    【解析后的错误信息】

    错误代码: PARAM_ERROR

    错误信息: 输入源“/uri_template/scene”映射到字段“插卡场景”必填性规则校验失败,此字段为必填项

    详细信息: {'location': 'uri_template', 'value': ''}

    URL: https://api.mch.weixin.qq.com/v3/new-tax-control-fapiao/fapiao-applications/4200002854202510244871210645/insert-cards

    "scene": "WITH_WECHATPAY" 这个在请求体中

    这个是要在请求头中吗?

    request_data = {

                "scene": "WITH_WECHATPAY",  # 关键修复:scene参数放在请求体中

                "sub_mchid": sub_mchid,

                "buyer_information": buyer_info,

                "fapiao_card_information": [

                    {

                        "fapiao_media_id": fapiao_media_id,

                        "fapiao_number": fphm,

                        "fapiao_code": fpdm,

                        "fapiao_time": fapiao_time,

          "check_code":"",

        "password": "",

                        "total_amount": total_amount,

                        "amount": amount,

                        "tax_amount": tax_amount,

                        "seller_information": seller_info,

                        "extra_information": {

                            "payee": drawer,

                            "reviewer": drawer,

                            "drawer": drawer

                        },

                        "items": items,

                        "remark": "电子发票自动存入微信卡包"

                    }

                ]

            }

    10-24
    有用
    回复
登录 后发表内容