# 新增退款单(退预存款)接口

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/receivableHistory/v1/backPreDeposit/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
	"supply_id": "-1",
    "supply_code": "",
	"cm_code": "",
	"business_type": "",
	"capitalpool_code": "",
	"from_details": [
		{
			"settlement_name": "",
			"amount": ""
		}
	],
	"receive_date": "",
	"receiver": "",
	"remark": "",
	"main_exts": [
		{
			"ext_name": "",
			"ext_value": ""
		},
		{
			"ext_name": "",
			"ext_value": ""
		}
	]
}
说明: 本示例仅供参考。

参数说明:

参数 类型 必填 说明
supply_id VARCHAR(32)  退款单位id (退款单位id和退款单位编码必须传一个。总部传-1)
supply_code VARCHAR(100) 退款单位编码,退款单位id和退款单位编码必须传一个 
cm_code VARCHAR(100)  客户编码 
business_type VARCHAR(100)  退款类型(4:退货款 5:退预存款)
capitalpool_code VARCHAR(100)  资金池编码
receive_date TIMESTAMP  退款日期。格式:yyyy-MM-dd
receiver VARCHAR(100)  退款人(编码) 
remark VARCHAR(300) 备注说明
from_details List 列表
from_details.settlement_name VARCHAR(100)  结算方式名称 
from_details.amount VARCHAR(100)  退款金额
main_exts List 列表
main_exts.ext_name VARCHAR(100)  自定义字段名称
main_exts.ext_value VARCHAR(100)  自定义字段值 

响应示例:

{
	"msg_id": "X000001",
	"return_code": 1,
	"return_msg": "",
	"response_data": null
}

参数说明:

参数 类型 说明
msg_id String 请求消息ID
return_code int 响应编码。0:成功,1:失败。其他详见附录错误码说明 (opens new window)
return_msg String 响应说明
response_data String 响应数据

# 新增退款单(退货款)接口

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/receivableHistory/v1/backGoodsDeposit/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
	"supply_id": "-1",
    "supply_code": "",
	"cm_code": "",
	"business_type": "",
	"pool_details": [
		{
			"capitalpool_code": "",
			"use_amount": ""
		}
	],
	"from_details": [
		{
			"settlement_name": "",
			"amount": ""
		}
	],
	"receive_date": "",
	"receiver": "",
	"remark": "",
	"main_exts": [
		{
			"ext_name": "",
			"ext_value": ""
		},
		{
			"ext_name": "",
			"ext_value": ""
		}
	],
	"details": [
		{
			"bill_code": "",
			"amount": "",
			"bill_type": ""
		}
	]
}
说明: 本示例仅供参考。

参数说明:

参数 类型 必填 说明
supply_id VARCHAR(32) 退款单位id (退款单位id和退款单位编码必须传一个。总部传-1)
supply_code VARCHAR(100) 退款单位编码,退款单位id和退款单位编码必须传一个
cm_code VARCHAR(100)  客户编码 
business_type VARCHAR(100) 退款类型(4:退货款 5:退预存款)
pool_details List 列表
pool_details.capitalpool_code VARCHAR(100)  使用预存款子表.资金池编码
pool_details.use_amount VARCHAR(100)  使用预存款子表.使用金额
receive_date TIMESTAMP  退款日期。格式:yyyy-MM-dd
receiver VARCHAR(100)  退款人 (编码)
remark VARCHAR(300) 备注说明
from_details List 列表
from_details.settlement_name VARCHAR(100)  退款子表-结算方式名称 
from_details.amount VARCHAR(100) 退款子表- 退款金额
details List 列表
details.bill_code VARCHAR(100) 关联单据.单据号
details.amount VARCHAR(100) 关联单据.本单结算金额
details.bill_type VARCHAR(100) 关联单据.单据类型 (CXD:车销单, ZYFHD:直营发货单, FXFHD:分销发货单,CPD:车铺单,THD:退货单)
main_exts List 列表
main_exts.ext_name VARCHAR(100)  自定义字段名称
main_exts.ext_value VARCHAR(100)  自定义字段值 

响应示例:

{
	"msg_id": "X000001",
	"return_code": 1,
	"return_msg": "",
	"response_data": null
}

参数说明:

参数 类型 说明
msg_id String 请求消息ID
return_code int 响应编码。0:成功,1:失败。其他详见附录错误码说明 (opens new window)
return_msg String 响应说明
response_data String 响应数据

# 退款单查询接口

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/receivableHistory/v1/getReceivableBackInfos/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
    "page_number": 1,
    "page_length": 100,
    "start_create_date": "2016-12-09",
    "end_create_date": "2016-12-19",
    "start_modify_date": "2017-12-09",
    "end_modify_date": "2017-12-09"
}
    
说明: 本示例仅供参考。

参数说明:

参数 类型 必填 说明
supply_id VARCHAR(32) 收款单位ID。总部传-1。
cm_code VARCHAR(100) 客户编码
start_create_date TIMESTAMP 创建时间开始。格式:yyyy-MM-dd
end_create_date TIMESTAMP 创建时间结束。格式:yyyy-MM-dd
start_modify_date TIMESTAMP 修改时间开始。格式:yyyy-MM-dd
end_modify_date TIMESTAMP 修改时间结束。格式:yyyy-MM-dd
page_number INT 页码默认1,每页默认1000条
page_length INT 每页记录条数,默认最大是1000条,可以根据数据的大小自行优化调整

响应示例:

{
	"return_code": true,
	"response_data":"<<DATA>>"
}

数据DATA示例:

[
		{
			"id": "",
			"receive_no": "",
			"confirm_status": "",
			"confirm_status_name": "",
			"cm_id": "",
			"cm_code": "",
			"cm_name": "",
			"supply_id": "",
			"supply_code": "",
			"supply_name": "",
			"receive_type": "",
			"receive_type_name": "",
			"capitalpool_id": "",
			"capitalpool_code": "",
			"capitalpool_name": "",
			"small_amount": "",
			"receive_date": "",
			"emp_name": "",
			"remark": "",
             "details": [
				{
					"bill_id": "",
					"bill_code": "",
					"bill_type": "",
					"bill_type_name": "",
					"bill_amount": ""
				}
			],
			"pool_detail": [
				{
					"pool_detail_id": "",
					"pool_detail_code": "",
					"pool_detail_amount": ""
				}
			],
			"settlement_detail": [
				{
					"settlement_detail_id": "",
					"settlement_detail_name": "",
					"settlement_detail_amount": ""
				}
			],
			"ext_infos": [
				{
					"ext_code": "",
					"ext_name": "",
					"ext_value": ""
				}
			]
		},
		{
			"id": "",
			"receive_no": "",
			"confirm_status": "",
			"confirm_status_name": "",
			"cm_id": "",
			"cm_code": "",
			"cm_name": "",
			"supply_id": "",
			"supply_code": "",
			"supply_name": "",
			"receive_type": "",
			"receive_type_name": "",
			"capitalpool_id": "",
			"capitalpool_code": "",
			"capitalpool_name": "",
			"receive_date": "",
			"emp_name": "",
			"remark": "",
            "details": [
				{
					"bill_id": "",
                      "bill_code": "",
                      "bill_type": "",
                      "bill_type_name": "",
                      "bill_amount": ""
				}
			],
			"pool_detail": [
				{
					"pool_detail_id": "",
					"pool_detail_code": "",
					"pool_detail_amount": ""
				}
			],
			"settlement_detail": [
				{
					"settlement_detail_id": "",
					"settlement_detail_name": "",
					"settlement_detail_amount": ""
				}
			],
			"ext_infos": [
				{
					"ext_code": "",
					"ext_name": "",
					"ext_value": ""
				}
			]
		}
]

参数说明:

参数 类型 必填 说明
id INT8 退款单ID
receive_no VARCHAR(32) 退款单号
confirm_status VARCHAR(32) 状态(0:待审批,1:待入账,2、已作废,3:已入账)
confirm_status_name VARCHAR(100) 状态名称
cm_id VARCHAR(100) 客户id
cm_code VARCHAR(100) 客户编码
cm_name VARCHAR(100) 客户名称
supply_id INT8 退款单位id
supply_code VARCHAR(100) 退款单位编码
supply_name VARCHAR(100) 退款单位名称
receive_type VARCHAR(32) 退款类型(4:退货款 5:退预存款)
receive_type_name VARCHAR(100) 退款类型名称
capitalpool_id INT8 资金池id
capitalpool_code VARCHAR(100) 资金池编码
capitalpool_name VARCHAR(100) 资金池名称
receive_date VARCHAR(100) 退款日期
emp_name VARCHAR(100) 退款人
remark text 备注说明
details.bill_id INT8 关联单据.单据id
details.bill_code VARCHAR(100) 关联单据.单据号
details.bill_type VARCHAR(100) 关联单据.单据类型(CXD:车销单,ZYFHD:直营发货单,FXFHD:分销发货单,CPD:车铺单,THD:退货单)
details.bill_type_name VARCHAR(100) 关联单据.单据类型名称
details.bill_amount VARCHAR(100) 关联单据.本单结算金额
pool_detail List 列表
pool_detail.pool_detail_id INT8 使用预存款子表.资金池id
pool_detail.pool_detail_code VARCHAR(100) 使用预存款子表.资金池编码
pool_detail.pool_detail_amount VARCHAR(100) 使用预存款子表.使用金额
settlement_detail List 列表
settlement_detail.settlement_detail_id INT8 退款子表.结算方式id
settlement_detail.settlement_detail_name VARCHAR(100) 退款子表.结算方式名称
settlement_detail.settlement_detail_amount VARCHAR(100) 退款子表.退款金额
ext_infos List 列表
ext_infos.ext_code VARCHAR(100) 自定义字段-编码
ext_infos.ext_name VARCHAR(100) 自定义字段-名称
ext_infos.ext_value VARCHAR(100) 自定义字段-值