简要描述:
- 新增合同
请求URL:
字段名 | 是否必填 | 描述 |
---|---|---|
id | true | 合同的id,替换掉url的:id |
请求方式:
- PUT
请求头:
- 请参考接口必读
请求参数:
请求参数说明
字段名 | 是否必填 | 描述 |
---|---|---|
contract[title] | true | 合同标题 |
contract[sn] | true | 合同编号 |
contract[user_id] | false | 负责人id |
contract[opportunity_id] | false | 商机id |
contract[customer_id] | true | 客户id |
contract[total_amount] | false | 总金额 |
contract[start_at] | true | 开始时间 |
contract[end_at] | true | 结束时间 |
contract[category] | false | 类别, 调用 GET /api/v2/field_maps/contract 获取对应的值 |
contract[payment_type] | false | 付款方式 调用 GET /api/v2/field_maps/contract 获取对应的值 |
contract[customer_signer] | false | 客户签约人( 例如 小七) |
contract[our_signer] | false | 我方签约人( 例如 小强) |
contract[sign_date] | false | 签约日期 |
contract[status] | false | 合同状态 调用 GET /api/v2/field_maps/contract 获取对应的值 |
contract[special_terms] | false | 特别条款 |
contract[want_department_id] | false | 所属部门 |
contract[attachments_attributes] | false | 附件 |
contract[product_assets_attributes] | false | 关联产品 |
contract_action_name | false | 当值为 turn_to_contract 商机转合同 |
product_assets_attributes
字段 | 类型 | 说明 |
---|---|---|
id | integer | 明细单id,新增则为null,更新则需要填写,null则为新增的明细单 |
destroy | bool | 如果要删除此项,则为true;否则可不传递。 |
product_name | string | 产品名称:”多单位转换T1” |
product_attr_id | integer | 产品属性id |
product_id | integer | 产品id |
product_no | string | 产品编号 |
quantity | integer | 数量 |
recommended_unit_price | decimal | 售卖单价 |
remark | string | 备注 |
sale_unit | string | 单位 |
total_price | “400000”, | 总价= recommended_unit_price*quantity |
spec | string | 规格 |
type_name | string | 关联类型:Contract合同Opportunity商机 |
type_id | integer | id,可以为空 |
请求参数json例子:
{
"contract": {
"title": "title",
"sn": "xx2323233",
"customer_id": 1,
"user_id": 1,
"total_amount": 100,
"self_xsdsd": 1212,
"start_at": "2019-01-10 10:41",
"end_at": "2019-01-10 10:41"
}
}
返回示例:
正确时返回:
{
"code": 0,
"data": {
"id": 15201,
"category": "68092",
"category_mapped": "采购合同",
"payment_type": "68095",
"payment_type_mapped": "支票",
"status": "68102",
"status_mapped": "意外终止",
"is_editable": true,
"organization_id": 10618,
"title": "CRM集团版",
"total_amount": "19800.0",
"start_at": "2012-08-08",
"end_at": "2012-09-09",
"customer_signer": "自定义字段",
"need_hidden_dispose": false,
"revisit_remind_at": "",
"received_payments_plan_count": 0,
"received_payments_plan_amount": 0,
"received_payments_amount": "0.0",
"unreceived_amount": 19800,
"unchecking_payments_amount": 19800,
"checking_payments_amount": "0.0",
"sn": "9989",
"sign_date": "2015-08-08",
"times": "2012-08-08 - 2012-09-09",
"times_display": "2012-08-08 - 2012-09-09",
"approve_status": "approved",
"approve_status_i18n": "已通过",
"approve_deny_type": 0,
"all_attachments": [],
"owned_department": {
"id": 4411,
"name": "总裁办"
},
"is_own": true,
"is_has_policy_for_assist_user": true,
"is_my_assist_entity": false,
"product_assets_for_new_record": [],
"our_signer": "自定义字段",
"special_terms": "0",
"created_at": "2018-05-25 17:22",
"updated_at": "2018-05-25 17:22",
"product_assets": "暂无产品",
"attachments": "暂无附件",
"before_user": {},
"before_owned_department": {},
"creator": {
"id": 22267,
"email": "test@qq.com",
"created_at": "2018-05-24 14:43",
"name": "test",
"organization_id": 10618,
"phone": "18321108963",
"role_id": 0,
"workflow_state": "organization_staff",
"job": "",
"tel": "",
"avatar_url": "http://e.ikcrm.dev/assets/male.jpg",
"department_name": "总裁办"
},
"user": {
"id": 22267,
"email": "test@qq.com",
"created_at": "2018-05-24 14:43",
"name": "test",
"organization_id": 10618,
"phone": "18321108963",
"role_id": 0,
"workflow_state": "organization_staff",
"job": "",
"tel": "",
"avatar_url": "http://e.ikcrm.dev/assets/male.jpg",
"department_name": "总裁办"
},
"opportunity": {},
"customer": {
"id": 321032,
"name": "TEST5612",
"name_pinyin": "TEST5612",
"user_id": 22261,
"user_name": "test01",
"contacts": [],
"company_name": "",
"address": {
"id": 440101,
"tel": "19825685612",
"tel_hidden_result": "19825685612",
"phone": "",
"phone_hidden_result": "",
"qq": "",
"email": "19825680001@test.com",
"lng": 121.624653,
"lat": 31.226515,
"detail_address": "上海市浦东新区申江路5005弄星创广场C栋3楼5913室",
"off_distance": -1,
"url": "www.test5612.com",
"gaode_staticmap": "http://restapi.amap.com/v3/staticmap?key=6336624d908c499cace3998613723a3a&location=121.624653%2C31.226515&markers=mid%2C%2CA%3A121.624653%2C31.226515&scale=2&size=524%2A180&zoom=16",
"full_address": "中国 上海 上海市 浦东新区 上海市浦东新区申江路5005弄星创广场C栋3楼5913室"
},
"revisit_at": "2018-05-25T17:22:28.000+08:00",
"is_own": true,
"status": "68057",
"status_mapped": "成交",
"category": "68060",
"category_mapped": "B(普通客户)",
"qixinbao_id": "",
"created_at": "2018-05-22 17:05",
"updated_at": "2018-05-22 17:05",
"creator": {
"id": 22261,
"email": "test011@qq.com",
"created_at": "2018-05-22 15:20",
"name": "test01",
"organization_id": 10618,
"phone": "19112345678",
"role_id": 0,
"workflow_state": "organization_staff",
"job": "DD",
"tel": "",
"avatar_url": "http://e.ikcrm.dev/assets/male.jpg",
"department_name": "总裁办"
},
"is_user_self": false,
"approve_status": "approved",
"approve_status_i18n": "已通过"
},
"can_approve": true,
"step_can_approve": false,
"step": 0,
"notify_users": [],
"can_revert_applying": false,
"need_approve_step": 1,
"attachments_count": 0,
"file_attachments_count": 0,
"is_user_self": true,
"received_payment_plans": []
}
}
错误时返回:
{
"code": 100000,
"message": "device参数错误",
"error": "invalid_app_error"
}
返回参数说明:
暂无
备注:
- 更多返回错误代码请看错误码表描述
文档更新时间: 2025-04-29 14:18 作者:陈胜海