简要描述:

  • 新增费用

请求URL:

  • /api/v2/expenses

请求方式:

  • POST

请求头:

请求参数:

字段名 是否必填 描述
expense[sn] true 编号(读取自定义字段里的设置是否自动生成,如果自动生成)
expense[customer_id] false 对应客户
expense[category] false 类型
expense[amount] true 金额
expense[incurred_at] false 发生时间
expense[contact_attributes] false 类型
expense[related_item_id] false 关联对象id
expense[related_item_type] false 关联对象type, [Opportunity, Contract]
expense[revisit_log_id] false 跟进记录id
expense[checkin_id] false 拜访签到id
expense[user_id] false 负责人id
expense[description] false 描述
expense[contact_ids] false 联系人

返回示例:

正确时返回:

{
  "code": 0,
  "data": {
    "id": 3487,
    "organization_id": 57,
    "customer": {
      "id": 2600,
      "name": "按键精灵3"
    },
    "sn": "24646",
    "category": "75605",
    "category_mapped": "招待费",
    "incurred_at": "2018-04-23",
    "amount": "255.0",
    "description": "费用测试",
    "related_item_type": "Opportunity",
    "related_item_id": 12097,
    "related_item": {
      "id": 12097,
      "title": "[商机55]韩国规划"
    },
    "user": {
      "id": 700,
      "email": "79507452@qq.com",
      "created_at": "2015-07-01 18:17",
      "name": "小龙-test环境",
      "organization_id": 57,
      "phone": "18699999999",
      "role_id": 418,
      "workflow_state": "organization_staff",
      "job": "开发主管",
      "tel": "",
      "avatar_url": "https://dn-ikcrm-files-dev.qbox.me/attachments/files/25929/MagazinePic-01-2.3.001-bigpicture_01_9.jpg?imageMogr2/thumbnail/!100x100r/crop/!100x100/format/jpg/auto-orient",
      "department_name": "总裁办"
    },
    "contacts": [
      {
        "id": 20281,
        "name": "11112222",
        "contacts_expense_id": 330
      }
    ],
    "revisit_log": {
    },
    "checkin": {
    },
    "expense_account": {
      "id": 3189,
      "organization_id": 57,
      "sn": "客厅裤头",
      "amount": "5255.0",
      "user": {
        "id": 700,
        "email": "79507452@qq.com",
        "created_at": "2015-07-01 18:17",
        "name": "小龙-test环境",
        "organization_id": 57,
        "phone": "18699999999",
        "role_id": 418,
        "workflow_state": "organization_staff",
        "job": "开发主管",
        "tel": "",
        "avatar_url": "https://dn-ikcrm-files-dev.qbox.me/attachments/files/25929/MagazinePic-01-2.3.001-bigpicture_01_9.jpg?imageMogr2/thumbnail/!100x100r/crop/!100x100/format/jpg/auto-orient",
        "department_name": "总裁办"
      },
      "created_at": "2018-08-08 15:12",
      "updated_at": "2018-08-24 17:06",
      "approve_status": "reverted",
      "approve_status_i18n": "已撤销"
    },
    "creator": {
      "id": 700,
      "email": "79507452@qq.com",
      "created_at": "2015-07-01 18:17",
      "name": "小龙-test环境",
      "organization_id": 57,
      "phone": "18699999999",
      "role_id": 418,
      "workflow_state": "organization_staff",
      "job": "开发主管",
      "tel": "",
      "avatar_url": "https://dn-ikcrm-files-dev.qbox.me/attachments/files/25929/MagazinePic-01-2.3.001-bigpicture_01_9.jpg?imageMogr2/thumbnail/!100x100r/crop/!100x100/format/jpg/auto-orient",
      "department_name": "总裁办"
    },
    "created_at": "2018-04-23 11:40",
    "updated_at": "2018-08-08 15:12",
    "attachments": "暂无附件",
    "all_attachments": [
    ],
    "expense_status": "not_reimburse",
    "expense_status_i18n": "未报销",
    "checkin_title": null,
    "related_item_title": "[商机55]韩国规划",
    "revisit_log_title": null
  }
}

错误时返回:


{
  "code": 100000,
  "message": "device参数错误",
  "error": "invalid_app_error"
}

返回参数说明:

字段名 描述
sn 费用编号
category 类别id
category_mapped 类别名称
incurred_at 发生时间
amount 费用金额
related_item 关联对象
expense_account 报销单
contacts 联系人
revisit_log 拜访签到

备注:

文档更新时间: 2025-04-29 14:18   作者:陈胜海