# 销售订单

本文档将详细列举当前系统支持订单相关的 webhook

订单支持自定义选择审核流程,参考订单 orderProcess 节点。

币种支持枚举:

CNY(1, "人民币", "CNY", "¥"),
USD(2, "美元", "USD", "$"),
EUR(3, "欧元","EUR", "€"),
JPY(5, "日元", "JPY", "¥"),
HKD(6, "港币", "HKD", "$"),
TWD(10, "台币", "TWD", "$");

# 创建销售订单

curl 示例请求:

curl --request POST \
  --url 'http(s)://${yourhost}/${yourpath}?businessType=CREATE_SALES_ORDER' \
  --header 'content-type: application/json' \
  --data '{"requestId":"24852d91-5c43-4f67-99c5-e6e441337749","businessType":3000,"data":{"code":"SO-201116-002","staffCode":"EM001","createTime":1605504720000,"customerCode":"VIP-1001","customerName":"上海纽酷","dueDate":1615507200000,"currency":"CNY","orderProcess":{"name":"订单审核","nodes":[{"name":"提交订单","status":1},{"name":"财务发货审核","status":0}]},"records":[{"itemCode":"015","itemName":"MES测试物料二20201116","quantity":2,"price":10,"deadline":1605484800000}]}}'

请求报文说明

{
	"requestId": "24852d91-5c43-4f67-99c5-e6e441337749",//请求ID,供日后 DEBUG 用,暂无业务意义
	"businessType": 3000,//业务类型,参考[webhook](/webhook/)定义
	"data": {
		"code": "SO-201116-002",//订单号
		"staffCode": "EM001",//销售负责人工号
		"createTime": 1605504720000,//创建时间
        "customerCode": "VIP-1001",
        "customerName": "上海纽酷",
        "dueDate":1615507200000,//截止交期
        "currency":"CNY",//币种
        "comments":"订单的备注",
        "orderProcess":{
            "name": "订单审核",//审核名称,租户内唯一
            "nodes":[
                {
                    "name":"提交订单",//状态节点名称
                    "status":1//状态节点,1 表示通过,0 表示未通过
                },
                {
                    "name":"财务发货审核",
                    "status":0
                },
            ]
        },
		"records": [{
			"itemCode": "015",//物料编码
			"itemName": "MES测试物料二20201116",//物料名称
			"quantity": 2,//订单明细数量
            "price":10,
			"deadline": 1605484800000//期望交货时间
		}]
	}
}

# 审核销售订单

审核销售订单主要是发生订单状态的变更,建议关注 orderProcess 的状态。推送的信息是更新后的订单详情。

curl 示例请求:

curl --request POST \
  --url 'http(s)://${yourhost}/${yourpath}?businessType=AUDIT_SALES_ORDER' \
  --header 'content-type: application/json' \
  --data '{"requestId":"24852d91-5c43-4f67-99c5-e6e441337749","businessType":3000,"data":{"code":"SO-201116-002","staffCode":"EM001","createTime":1605504720000,"customerCode":"VIP-1001","customerName":"上海纽酷","dueDate":1615507200000,"currency":"CNY","orderProcess":{"name":"订单审核","nodes":[{"name":"提交订单","status":1},{"name":"财务发货审核","status":0}]},"records":[{"itemCode":"015","itemName":"MES测试物料二20201116","quantity":2,"price":10,"deadline":1605484800000}]}}'

请求报文说明

{
	"requestId": "24852d91-5c43-4f67-99c5-e6e441337749",//请求ID,供日后 DEBUG 用,暂无业务意义
	"businessType": 3001,//业务类型,参考[webhook](/webhook/)定义
	"data": {
		"code": "SO-201116-002",//订单号
		"staffCode": "EM001",//销售负责人工号
		"createTime": 1605504720000,//创建时间
        "customerCode": "VIP-1001",
        "customerName": "上海纽酷",
        "dueDate":1615507200000,//截止交期
        "currency":"CNY",//币种
        "orderProcess":{
            "name": "订单审核",//审核名称,租户内唯一
            "nodes":[
                {
                    "name":"提交订单",//状态节点名称,当前审核流程唯一
                    "status":1//状态节点,1 表示通过,0 表示未通过
                },
                {
                    "name":"财务发货审核",
                    "status":0
                },
            ]
        },
		"records": [{
			"itemCode": "015",//物料编码
			"itemName": "MES测试物料二20201116",//物料名称
			"quantity": 2,//订单明细数量
            "price":10,
			"deadline": 1605484800000//期望交货时间
		}]
	}
}