# 订单 API

# 审核订单

接口地址:/api/open/v2/salesOrders/audit

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述:

请求示例:

{
  "body": {
    "message": "",
    "orderCode": "",
    "result": ""
  }
}

请求参数:

参数名称 参数说明 请求类型 是否必须 数据类型 schema
auditParam auditParam body true RequestParameter«SalesOrderAuditParam» RequestParameter«SalesOrderAuditParam»
  body false SalesOrderAuditParam SalesOrderAuditParam
    message 审核人意见 false string
    orderCode 销售订单编码 true string
    result 审核人结论,可用值:PASS,REFUSAL true string

响应状态:

状态码 说明 schema
200 OK BaseResponse
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

响应参数:

参数名称 参数说明 类型 schema
code integer(int32) integer(int32)
message string

响应示例:

{
	"code": 0,
	"message": ""
}

# 创建订单

接口地址:/api/open/v2/salesOrders/create

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述:

请求示例:

{
  "body": {
    "addressCode": "",
    "code": "",
    "comments": "",
    "currency": "",
    "customFieldDataParamsList": [
      {
        "customFieldDataUnits": [
          {
            "componentName": "",
            "componentType": "",
            "componentValue": {}
          }
        ],
        "entityType": ""
      }
    ],
    "customerCode": "",
    "customerOrderNumber": "",
    "customerReqDeadLine": 0,
    "deadline": 0,
    "extendedFieldList": [
      {
        "name": "",
        "value": ""
      }
    ],
    "hasSpecialPrice": 0,
    "needInvoice": 0,
    "paymentsCondition": "",
    "records": [
      {
        "comment": "",
        "comments": "",
        "deadline": 0,
        "discount": 0,
        "extendedFieldList": [
          {
            "name": "",
            "value": ""
          }
        ],
        "id": 0,
        "isRaw": 0,
        "itemCode": "",
        "itemName": "",
        "num": 0,
        "price": 0,
        "quantity": 0,
        "saleUnit": {
          "baseUnitQuantity": 0,
          "saleUnitName": "",
          "saleUnitQuantity": 0
        },
        "sort": 0,
        "taxRate": 0,
        "useSaleUnit": 0
      }
    ],
    "specialPrice": 0,
    "staffCode": "",
    "workOrderCodes": []
  }
}

请求参数:

参数名称 参数说明 请求类型 是否必须 数据类型 schema
customerSaveParamRequestParameter customerSaveParamRequestParameter body true RequestParameter«SalesOrderSaveParams» RequestParameter«SalesOrderSaveParams»
  body false SalesOrderSaveParams SalesOrderSaveParams
    addressCode 订单收货地址。参考:客户-收货地址API false string
    code 订单编码 false string
    comments 订单备注 false string
    currency 币种 false string
    customFieldDataParamsList 自定义字段 false array CustomFieldDataParams
      customFieldDataUnits 自定义字段数据单元 false array CustomFieldDataUnitParams
        componentName 组件名 false string
        componentType 组件类型 false string
        componentValue 组件值 false object
      entityType 单据实体类型(生产单:WORK_ORDER 物料:ITEM),可用值:WORK_ORDER,ITEM,SALES_ORDER_ROW,BATCH false string
    customerCode 客户编码 false string
    customerOrderNumber 客户订单编号 false string
    customerReqDeadLine 客户要求交期 false integer
    deadline 预计交期 false integer
    extendedFieldList 系统自定义字段 false array OrderExtendFieldParam
      name false string
      value false string
    hasSpecialPrice 是否有特价 false integer
    needInvoice 是否需要开票 false integer
    paymentsCondition 付款条件 false string
    records 订单明细 false array Detail
      comment false string
      comments 订单行备注 false string
      deadline 订单行交期 false integer
      discount 折扣率 false number
      extendedFieldList 自定义字段 false array OrderExtendFieldParam
        name false string
        value false string
      id false integer
      isRaw 是否用原物料标记 false integer
      itemCode 订单行物料编码 false string
      itemName false string
      num 订单行号 false integer
      price 订单行价格(含税) false number
      quantity 物料数量 false number
      saleUnit false SaleUnitParamDTO SaleUnitParamDTO
        baseUnitQuantity false number
        saleUnitName false string
        saleUnitQuantity false number
      sort false integer
      taxRate 订单税率 false number
      useSaleUnit false integer
    specialPrice 特价 false number
    staffCode 订单负责人编码 false string
    workOrderCodes 生产单编码 false array string

响应状态:

状态码 说明 schema
200 OK BaseResponse
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

响应参数:

参数名称 参数说明 类型 schema
code integer(int32) integer(int32)
message string

响应示例:

{
	"code": 0,
	"message": ""
}

# 创建或修改订单

接口地址:/api/open/v2/salesOrders/createOrUpdate

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述:

请求示例:

{
  "body": {
    "addressCode": "",
    "code": "",
    "comments": "",
    "currency": "",
    "customFieldDataParamsList": [
      {
        "customFieldDataUnits": [
          {
            "componentName": "",
            "componentType": "",
            "componentValue": {}
          }
        ],
        "entityType": ""
      }
    ],
    "customerCode": "",
    "customerOrderNumber": "",
    "customerReqDeadLine": 0,
    "deadline": 0,
    "extendedFieldList": [
      {
        "name": "",
        "value": ""
      }
    ],
    "hasSpecialPrice": 0,
    "needInvoice": 0,
    "paymentsCondition": "",
    "records": [
      {
        "comment": "",
        "comments": "",
        "deadline": 0,
        "discount": 0,
        "extendedFieldList": [
          {
            "name": "",
            "value": ""
          }
        ],
        "id": 0,
        "isRaw": 0,
        "itemCode": "",
        "itemName": "",
        "num": 0,
        "price": 0,
        "quantity": 0,
        "saleUnit": {
          "baseUnitQuantity": 0,
          "saleUnitName": "",
          "saleUnitQuantity": 0
        },
        "sort": 0,
        "taxRate": 0,
        "useSaleUnit": 0
      }
    ],
    "specialPrice": 0,
    "staffCode": "",
    "workOrderCodes": []
  }
}

请求参数:

参数名称 参数说明 请求类型 是否必须 数据类型 schema
customerSaveParamRequestParameter customerSaveParamRequestParameter body true RequestParameter«SalesOrderSaveParams» RequestParameter«SalesOrderSaveParams»
  body false SalesOrderSaveParams SalesOrderSaveParams
    addressCode 订单收货地址。参考:客户-收货地址API false string
    code 订单编码 false string
    comments 订单备注 false string
    currency 币种 false string
    customFieldDataParamsList 自定义字段 false array CustomFieldDataParams
      customFieldDataUnits 自定义字段数据单元 false array CustomFieldDataUnitParams
        componentName 组件名 false string
        componentType 组件类型 false string
        componentValue 组件值 false object
      entityType 单据实体类型(生产单:WORK_ORDER 物料:ITEM),可用值:WORK_ORDER,ITEM,SALES_ORDER_ROW,BATCH false string
    customerCode 客户编码 false string
    customerOrderNumber 客户订单编号 false string
    customerReqDeadLine 客户要求交期 false integer
    deadline 预计交期 false integer
    extendedFieldList 系统自定义字段 false array OrderExtendFieldParam
      name false string
      value false string
    hasSpecialPrice 是否有特价 false integer
    needInvoice 是否需要开票 false integer
    paymentsCondition 付款条件 false string
    records 订单明细 false array Detail
      comment false string
      comments 订单行备注 false string
      deadline 订单行交期 false integer
      discount 折扣率 false number
      extendedFieldList 自定义字段 false array OrderExtendFieldParam
        name false string
        value false string
      id false integer
      isRaw 是否用原物料标记 false integer
      itemCode 订单行物料编码 false string
      itemName false string
      num 订单行号 false integer
      price 订单行价格(含税) false number
      quantity 物料数量 false number
      saleUnit false SaleUnitParamDTO SaleUnitParamDTO
        baseUnitQuantity false number
        saleUnitName false string
        saleUnitQuantity false number
      sort false integer
      taxRate 订单税率 false number
      useSaleUnit false integer
    specialPrice 特价 false number
    staffCode 订单负责人编码 false string
    workOrderCodes 生产单编码 false array string

响应状态:

状态码 说明 schema
200 OK BaseResponse
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

响应参数:

参数名称 参数说明 类型 schema
code integer(int32) integer(int32)
message string

响应示例:

{
	"code": 0,
	"message": ""
}

# 删除订单

接口地址:/api/open/v2/salesOrders/delete

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述:

参数是编码

请求示例:

{
  "body": ""
}

请求参数:

参数名称 参数说明 请求类型 是否必须 数据类型 schema
code code body false RequestParameter«string» RequestParameter«string»
  body false string

响应状态:

状态码 说明 schema
200 OK BaseResponse
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

响应参数:

参数名称 参数说明 类型 schema
code integer(int32) integer(int32)
message string

响应示例:

{
	"code": 0,
	"message": ""
}

# 作废订单

接口地址:/api/open/v2/salesOrders/prohibit

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述:

请求示例:

{
  "body": ""
}

请求参数:

参数名称 参数说明 请求类型 是否必须 数据类型 schema
code code body false RequestParameter«string» RequestParameter«string»
  body false string

响应状态:

状态码 说明 schema
200 OK BaseResponse
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

响应参数:

参数名称 参数说明 类型 schema
code integer(int32) integer(int32)
message string

响应示例:

{
	"code": 0,
	"message": ""
}

# 查询订单列表

接口地址:/api/open/v2/salesOrders/query

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述:

请求示例:

{
  "body": {
    "code": [],
    "codeLike": "",
    "customerCode": [],
    "pagingParam": {
      "length": 0,
      "start": 0
    }
  }
}

请求参数:

参数名称 参数说明 请求类型 是否必须 数据类型 schema
queryParamRequestParameter queryParamRequestParameter body true RequestParameter«SalesQueryParam» RequestParameter«SalesQueryParam»
  body false SalesQueryParam SalesQueryParam
    code 按订单编码完全匹配 false array string
    codeLike 按订单编码模糊匹配 false string
    customerCode 客户编码 false array string
    pagingParam false PagingParam PagingParam
      length false integer
      start false integer

响应状态:

状态码 说明 schema
200 OK ListPagingResponse«SalesOrder»
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

响应参数:

参数名称 参数说明 类型 schema
code integer(int32) integer(int32)
data ListPagingResponseData«SalesOrder» ListPagingResponseData«SalesOrder»
  length integer(int32)
  list array SalesOrder
    addressLabel string
    baseExtendFieldDTOList array BaseExtendFieldDTO
      fieldId 源id integer
      fieldType 字段类型 integer
      id id integer
      name 字段名称 string
      required 是否必须 integer
      sort 排序字段 integer
      value 字段值 object
      valueId 字段值id integer
    code string
    comments string
    createTime integer
    currency string
    customerCode string
    customerName string
    dueDate integer
    orderDeliveryAddressView OrderDeliveryAddressView OrderDeliveryAddressView
      address string
      callingCode string
      city string
      contacts string
      country string
      createTime string
      district string
      fax string
      label string
      mobile string
      phone string
      province string
      updateTime string
    orderProcess OrderProcess OrderProcess
      name string
      nodes array OrderProcessNode
        name string
        status integer
    orderStatus 可用值:OrderStatus{id = 0, desc= 待订单审核},OrderStatus{id = 1, desc= 审核中},OrderStatus{id = 2, desc= 已审核待完成},OrderStatus{id = 4, desc= 待收货确认},OrderStatus{id = 5, desc= 已完成},OrderStatus{id = 6, desc= 已作废},OrderStatus{id = 7, desc= 已删除} string
    records array Detail
      comment string
      comments 订单行备注 string
      deadline 订单行交期 integer
      discount 折扣率 number
      extendedFieldList 自定义字段 array OrderExtendFieldParam
        name string
        value string
      id integer
      isRaw 是否用原物料标记 integer
      itemCode 订单行物料编码 string
      itemName string
      num 订单行号 integer
      price 订单行价格(含税) number
      quantity 物料数量 number
      saleUnit SaleUnitParamDTO SaleUnitParamDTO
        baseUnitQuantity number
        saleUnitName string
        saleUnitQuantity number
      sort integer
      taxRate 订单税率 number
      useSaleUnit integer
    staffCode string
  recordsTotal integer(int32)
  start integer(int32)
message string

响应示例:

{
	"code": 0,
	"data": {
		"length": 0,
		"list": [
			{
				"addressLabel": "",
				"baseExtendFieldDTOList": [
					{
						"fieldId": 0,
						"fieldType": 0,
						"id": 0,
						"name": "",
						"required": 0,
						"sort": 0,
						"value": {},
						"valueId": 0
					}
				],
				"code": "",
				"comments": "",
				"createTime": 0,
				"currency": "",
				"customerCode": "",
				"customerName": "",
				"dueDate": 0,
				"orderDeliveryAddressView": {
					"address": "",
					"callingCode": "",
					"city": "",
					"contacts": "",
					"country": "",
					"createTime": "",
					"district": "",
					"fax": "",
					"label": "",
					"mobile": "",
					"phone": "",
					"province": "",
					"updateTime": ""
				},
				"orderProcess": {
					"name": "",
					"nodes": [
						{
							"name": "",
							"status": 0
						}
					]
				},
				"orderStatus": "",
				"records": [
					{
						"comment": "",
						"comments": "",
						"deadline": 0,
						"discount": 0,
						"extendedFieldList": [
							{
								"name": "",
								"value": ""
							}
						],
						"id": 0,
						"isRaw": 0,
						"itemCode": "",
						"itemName": "",
						"num": 0,
						"price": 0,
						"quantity": 0,
						"saleUnit": {
							"baseUnitQuantity": 0,
							"saleUnitName": "",
							"saleUnitQuantity": 0
						},
						"sort": 0,
						"taxRate": 0,
						"useSaleUnit": 0
					}
				],
				"staffCode": ""
			}
		],
		"recordsTotal": 0,
		"start": 0
	},
	"message": ""
}

# 修改订单

接口地址:/api/open/v2/salesOrders/update

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述:

请求示例:

{
  "body": {
    "addressCode": "",
    "code": "",
    "comments": "",
    "currency": "",
    "customFieldDataParamsList": [
      {
        "customFieldDataUnits": [
          {
            "componentName": "",
            "componentType": "",
            "componentValue": {}
          }
        ],
        "entityType": ""
      }
    ],
    "customerCode": "",
    "customerOrderNumber": "",
    "customerReqDeadLine": 0,
    "deadline": 0,
    "extendedFieldList": [
      {
        "name": "",
        "value": ""
      }
    ],
    "hasSpecialPrice": 0,
    "needInvoice": 0,
    "paymentsCondition": "",
    "records": [
      {
        "comment": "",
        "comments": "",
        "deadline": 0,
        "discount": 0,
        "extendedFieldList": [
          {
            "name": "",
            "value": ""
          }
        ],
        "id": 0,
        "isRaw": 0,
        "itemCode": "",
        "itemName": "",
        "num": 0,
        "price": 0,
        "quantity": 0,
        "saleUnit": {
          "baseUnitQuantity": 0,
          "saleUnitName": "",
          "saleUnitQuantity": 0
        },
        "sort": 0,
        "taxRate": 0,
        "useSaleUnit": 0
      }
    ],
    "specialPrice": 0,
    "staffCode": "",
    "workOrderCodes": []
  }
}

请求参数:

参数名称 参数说明 请求类型 是否必须 数据类型 schema
customerSaveParamRequestParameter customerSaveParamRequestParameter body true RequestParameter«SalesOrderSaveParams» RequestParameter«SalesOrderSaveParams»
  body false SalesOrderSaveParams SalesOrderSaveParams
    addressCode 订单收货地址。参考:客户-收货地址API false string
    code 订单编码 false string
    comments 订单备注 false string
    currency 币种 false string
    customFieldDataParamsList 自定义字段 false array CustomFieldDataParams
      customFieldDataUnits 自定义字段数据单元 false array CustomFieldDataUnitParams
        componentName 组件名 false string
        componentType 组件类型 false string
        componentValue 组件值 false object
      entityType 单据实体类型(生产单:WORK_ORDER 物料:ITEM),可用值:WORK_ORDER,ITEM,SALES_ORDER_ROW,BATCH false string
    customerCode 客户编码 false string
    customerOrderNumber 客户订单编号 false string
    customerReqDeadLine 客户要求交期 false integer
    deadline 预计交期 false integer
    extendedFieldList 系统自定义字段 false array OrderExtendFieldParam
      name false string
      value false string
    hasSpecialPrice 是否有特价 false integer
    needInvoice 是否需要开票 false integer
    paymentsCondition 付款条件 false string
    records 订单明细 false array Detail
      comment false string
      comments 订单行备注 false string
      deadline 订单行交期 false integer
      discount 折扣率 false number
      extendedFieldList 自定义字段 false array OrderExtendFieldParam
        name false string
        value false string
      id false integer
      isRaw 是否用原物料标记 false integer
      itemCode 订单行物料编码 false string
      itemName false string
      num 订单行号 false integer
      price 订单行价格(含税) false number
      quantity 物料数量 false number
      saleUnit false SaleUnitParamDTO SaleUnitParamDTO
        baseUnitQuantity false number
        saleUnitName false string
        saleUnitQuantity false number
      sort false integer
      taxRate 订单税率 false number
      useSaleUnit false integer
    specialPrice 特价 false number
    staffCode 订单负责人编码 false string
    workOrderCodes 生产单编码 false array string

响应状态:

状态码 说明 schema
200 OK BaseResponse
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

响应参数:

参数名称 参数说明 类型 schema
code integer(int32) integer(int32)
message string

响应示例:

{
	"code": 0,
	"message": ""
}