文档中心 > API类目 > 信息平台-采购

alibaba.pur.pr.submit (pr创建)

pr创建

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
pr_dto PrTopDTO 必须 pr创建入参
  • └ company_code
  • String
  • 可选
  • 290
  • 法务公司CODE,与ouCode二选一,如果不传,以需求方所在公司为准,如290
  • └ ext
  • String
  • 可选
  • http://ww.baido.ocm
  • 扩展字段,存放如项目名称/链接等信息 projectNumber(项目号/id) projectName(项目名称) projectUrl(http://tmall.com)
  • pr_items
  • PrItemTopDTO []
  • 必须
  • null
  • PR采购项
  • └ category_code
  • String
  • 必须
  • gt234
  • 采购类别CODE(必填)
  • └ remark
  • String
  • 可选
  • 很好
  • 备注信息
  • └ item_name
  • String
  • 必须
  • 蚂蚁对接ito
  • 采购需求名称(必填)
  • └ item_description
  • String
  • 必须
  • 蚂蚁对接ito
  • 采购需求说明(必填)
  • └ category_use
  • String
  • 必须
  • cd230
  • 采购用途CODE(必填)
  • └ acceptance_standard
  • String
  • 必须
  • 优秀
  • 验收标准(必填)
  • └ order_type
  • String
  • 必须
  • 累计开单
  • 开单方式(必填),按金额:AMOUNT;按数量:QUANTITY
  • └ unit_price
  • String
  • 可选
  • 300000
  • 单价,开单方式为QUANTITY需要填写
  • └ quantity
  • Number
  • 可选
  • 300000
  • 数量,开单方式为QUANTITY需要填写
  • └ amount
  • String
  • 可选
  • 400
  • 金额,开单方式为AMOUNT需要填写
  • └ currency_code
  • String
  • 必须
  • CNY
  • 币种(必填),如CNY
  • └ need_date_start
  • Date
  • 必须
  • 2020-01-22 02:22:11
  • 期望到货日期开始(必填)
  • └ need_date_end
  • Date
  • 必须
  • 2020-01-22 02:22:11
  • 期望到货日期结束(必填)
  • └ designated_supplier
  • Boolean
  • 可选
  • true
  • 是否指定供应商
  • └ designated_supplier_name
  • String
  • 可选
  • 蚂蚁集团
  • 指定供应商名称
  • └ designated_supplier_reason
  • String
  • 可选
  • 这个公平营收好
  • 指定供应商原因
  • └ ext
  • String
  • 可选
  • http://ww.baido.ocm
  • 扩展字段,存放如项目名称/链接等信息 projectNumber(项目号/id) projectName(项目名称) projectUrl(http://tmall.com)
  • └ coa_map
  • String
  • 可选
  • { "BUDGET": "350000010333", "COSTCENTER": "350000010333" }
  • 财务段值
  • └ item_code
  • String
  • 可选
  • null
  • 采购需求对应编码,如MPN/SKUID
  • └ source_type
  • String
  • 可选
  • ANT_GRM
  • 来源类型
  • └ source_value
  • String
  • 可选
  • 123456
  • 来源值
  • └ buyer
  • String
  • 可选
  • 56771
  • 采购员
  • └ pr_id
  • Number
  • 可选
  • 201
  • ID,创建成功返回
  • └ description
  • String
  • 必须
  • 想申请一下
  • 申请描述(必填)
  • └ ou_code
  • String
  • 可选
  • S54
  • 财务公司CODE,如果不传,以需求方所在公司为准
  • └ pr_number
  • String
  • 可选
  • PR2009
  • PR编号,创建成功返回
  • └ requestor
  • String
  • 必须
  • 兮瑶
  • 实际需求方,如人员工号(必填)
  • └ applicant
  • String
  • 必须
  • 兮瑶
  • 申请人,如人员工号(必填)
  • └ source_type
  • String
  • 必须
  • 蚂蚁审批
  • 来源类型(必填
  • attachment_list
  • AttachmentDTO []
  • 可选
  • 附件列表
  • └ attachment_name
  • String
  • 可选
  • 集团列表
  • 附件名称
  • └ attachment_type
  • String
  • 可选
  • 文件
  • 附件类型
  • └ attachment_key
  • String
  • 可选
  • 附件
  • 附件KEY,如果是外链直接传url
  • └ source_value
  • String
  • 可选
  • 2008
  • 来源值,如所在系统项目号
  • └ need_approval
  • Boolean
  • 可选
  • true
  • 是否需要审批
  • └ temp_save
  • Boolean
  • 可选
  • false
  • 是否临时保存,临时保存需要申请人到采购系统手工介入提交
  • members
  • AliEmployee []
  • 可选
  • 可查看此申请人员
  • └ nick_name
  • String
  • 可选
  • 飞流
  • 花名
  • └ name
  • String
  • 可选
  • 张三
  • 姓名
  • └ work_no
  • String
  • 可选
  • 857857
  • 工号
  • └ associated_pr_reason_detail
  • String
  • 可选
  • 合并预算
  • 关联已有PR原因:其它
  • └ associated_pr_reason
  • String
  • 可选
  • OTHER
  • 关联已有PR的原因
  • └ associated_existing_pr
  • String
  • 可选
  • PR1026788
  • 关联的已有PR

响应参数

名称 类型 示例值 描述
result ActionResult null 获取url的出参
  • └ success
  • Boolean
  • true
  • 是否成功
  • └ error_code
  • String
  • 500
  • 错误码
  • content
  • PrTopResponseDTO
  • null
  • 内容
  • └ id
  • Number
  • 2009333
  • id
  • └ security_id
  • String
  • sdfasdfas234sdfa1234
  • 加密ID
  • └ pr_number
  • String
  • PR3009
  • PR编号
  • └ requestor
  • String
  • 兮瑶
  • 实际需求方
  • └ applicant
  • String
  • 兮瑶
  • 申请人
  • └ description
  • String
  • 兮瑶好呀
  • 申请描述
  • └ company_code
  • String
  • ant383
  • 公司CODE
  • └ source_type
  • String
  • 出餐
  • 来源类型
  • └ source_value
  • String
  • 3
  • 来源值
  • └ status
  • String
  • 4
  • 状态
  • └ purchase_org_id
  • Number
  • zt3009
  • 采购组织ID
  • └ currency_code
  • String
  • 15555
  • 当前code
  • └ simplified_process
  • Boolean
  • true
  • 简单过程
  • └ need_approval
  • Boolean
  • true
  • 是否需要审批
  • └ amount
  • String
  • 133333
  • 金额
  • └ submit_date
  • Date
  • 2020-01-22 02:22:11
  • 提交日期
  • └ edit_url
  • String
  • http://www.b aic.com
  • 编辑页URL
  • └ detail_url
  • String
  • http://www.b aic.com
  • 详情页URL
  • └ associated_existing_pr
  • String
  • PR3009
  • 关联的PR
  • └ tenant_id
  • Number
  • 1009
  • 租户ID
  • └ purchase_type
  • String
  • 合同下单
  • 采购类型,如生产采购
  • └ ext
  • String
  • http://www.b aic.com
  • 扩展信息
  • pr_items
  • PrItemTopResponseDTO []
  • null
  • PR采购项
  • └ id
  • Number
  • 2222
  • id
  • └ source_type
  • String
  • 蚂蚁
  • 来源类型
  • └ source_value
  • String
  • 2009
  • 来源值
  • └ item_type
  • String
  • 2
  • 物料类别,如采购件、制造件
  • └ item_code
  • String
  • cdant23
  • 物料编码,如MPN,skuId
  • └ item_name
  • String
  • 蚂蚁ito对接
  • 采购需求名称
  • └ item_description
  • String
  • 蚂蚁ito对接
  • 采购需求说明
  • └ category_code
  • String
  • makll34
  • 采购类别CODE
  • └ category_use
  • String
  • sd2334
  • 购用途CODE
  • └ acceptance_standard
  • String
  • 优秀
  • 验收标准
  • └ uom
  • String
  • 蚂蚁
  • 单位
  • └ unit_price
  • String
  • 122222
  • 单价
  • └ quantity
  • Number
  • 1222
  • 量,废弃,数量支持小数,请用quantityDecimal
  • └ quantity_decimal
  • String
  • 1000
  • 数量
  • └ amount
  • String
  • 10000
  • 金额
  • └ currency_code
  • String
  • cny
  • 币种
  • └ order_type
  • String
  • 开单
  • 开单方式
  • └ need_date_start
  • Date
  • 2020-01-22 02:22:11
  • 期望到货日期开始
  • └ need_date_end
  • Date
  • 2020-01-22 02:22:11
  • 期望到货日期结束
  • └ buyer
  • String
  • 兮瑶
  • 采购员
  • └ address_id
  • Number
  • 杭州市
  • 收货地址ID
  • └ address_info
  • String
  • 杭州市
  • 收货地址描述
  • └ receiver
  • String
  • 兮瑶
  • 收货人
  • └ purchase_org_id
  • Number
  • 1cdis
  • 采购组织ID
  • └ purchase_requisition_id
  • Number
  • PR100938293
  • PRID
  • └ goods_quotation_id
  • Number
  • 23423
  • 1采购组织ID
  • └ address_ext
  • String
  • htpp;www.dsfad.com
  • 地址扩展信息
  • └ sku_id
  • Number
  • 1232
  • skuId
  • └ gmt_create
  • Date
  • 2020-01-22 02:22:11
  • 创建日期
  • └ remark
  • String
  • 备注信息
  • 备注
  • └ status
  • String
  • 1
  • 状态
  • └ project_id
  • Number
  • 1232
  • 项目ID
  • └ budget_id
  • Number
  • 1232
  • 预算项ID
  • └ line_number
  • Number
  • 12342
  • 行号
  • └ product_id
  • Number
  • 123423
  • 产品ID
  • tag_info
  • ProductTagInfoDto
  • null
  • 标签信息
  • └ need_project_name
  • String
  • 蚂蚁
  • 是否指定供应商
  • └ need_expense_city
  • String
  • 蚂蚁
  • 供应商
  • └ need_activity_date
  • String
  • 合同下单
  • 采购方式,如目录采购
  • └ project_name
  • String
  • 蚂蚁考题
  • 项目名称
  • └ expense_province
  • String
  • 杭州
  • 省会
  • └ expense_city
  • String
  • 余杭区
  • 城市
  • └ activity_start_date
  • Date
  • 2020-01-22 02:22:11
  • 开始时间
  • └ activity_end_date
  • Date
  • 2020-01-22 02:22:11
  • 最后时间
  • product_tag_d_t_o_list
  • ProductTagDto []
  • null
  • 产品tag
  • └ tag_id
  • Number
  • 234234
  • tagid
  • tag_value_d_t_o_list
  • ProductTagValueDto []
  • null
  • 标签
  • └ tag_value_id
  • Number
  • 213
  • 标签id
  • └ is_designated_supplier
  • byte
  • 网商
  • 是否指定供应商
  • └ designated_supplier
  • String
  • 网商
  • 供应商
  • └ pur_type
  • String
  • 合同
  • 采购方式,如目录采购
  • └ tenant_id
  • Number
  • 12342
  • 租户ID
  • └ supplier_id
  • Number
  • 134223
  • 供应商ID
  • └ contract_code
  • String
  • 1234234
  • 合同编号
  • └ tax_rate
  • String
  • 1
  • 税率
  • └ item_attr_info
  • String
  • 合格
  • 规格属性
  • └ po_unit_price
  • String
  • 10000
  • 创建PO单价
  • └ ext
  • String
  • http:www.bais.com
  • 扩展信息
  • └ is_pr_by_detail
  • Boolean
  • true
  • 是否有结构化数据
  • └ files
  • String
  • Null
  • 附件
  • └ error_msg
  • String
  • 错误了
  • 错误信息
  • └ error_level
  • Number
  • 1
  • 错误等级

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaPurPrSubmitRequest req = new AlibabaPurPrSubmitRequest();
AlibabaPurPrSubmitRequest.PrTopDTO obj1 = new AlibabaPurPrSubmitRequest.PrTopDTO();
obj1.setCompanyCode("290");
obj1.setExt("http://ww.baido.ocm");
List<AlibabaPurPrSubmitRequest.PrItemTopDTO> list3 = new ArrayList<AlibabaPurPrSubmitRequest.PrItemTopDTO>();
AlibabaPurPrSubmitRequest.PrItemTopDTO obj4 = new AlibabaPurPrSubmitRequest.PrItemTopDTO();
list3.add(obj4);
obj4.setCategoryCode("gt234");
obj4.setRemark("很好");
obj4.setItemName("蚂蚁对接ito");
obj4.setItemDescription("蚂蚁对接ito");
obj4.setCategoryUse("cd230");
obj4.setAcceptanceStandard("优秀");
obj4.setOrderType("累计开单");
obj4.setUnitPrice("300000");
obj4.setQuantity(300000L);
obj4.setAmount("400");
obj4.setCurrencyCode("CNY");
obj4.setNeedDateStart(StringUtils.parseDateTime("2020-01-22 02:22:11"));
obj4.setNeedDateEnd(StringUtils.parseDateTime("2020-01-22 02:22:11"));
obj4.setDesignatedSupplier(true);
obj4.setDesignatedSupplierName("蚂蚁集团");
obj4.setDesignatedSupplierReason("这个公平营收好");
obj4.setExt("http://ww.baido.ocm");
obj4.setCoaMap("{     \"BUDGET\": \"350000010333\",     \"COSTCENTER\": \"350000010333\" }");
obj4.setItemCode("null");
obj4.setSourceType("ANT_GRM");
obj4.setSourceValue("123456");
obj4.setBuyer("56771");
obj1.setPrItems(list3);
obj1.setPrId(201L);
obj1.setDescription("想申请一下");
obj1.setOuCode("S54");
obj1.setPrNumber("PR2009");
obj1.setRequestor("兮瑶");
obj1.setApplicant("兮瑶");
obj1.setSourceType("蚂蚁审批");
List<AlibabaPurPrSubmitRequest.AttachmentDTO> list6 = new ArrayList<AlibabaPurPrSubmitRequest.AttachmentDTO>();
AlibabaPurPrSubmitRequest.AttachmentDTO obj7 = new AlibabaPurPrSubmitRequest.AttachmentDTO();
list6.add(obj7);
obj7.setAttachmentName("集团列表");
obj7.setAttachmentType("文件");
obj7.setAttachmentKey("附件");
obj1.setAttachmentList(list6);
obj1.setSourceValue("2008");
obj1.setNeedApproval(true);
obj1.setTempSave(false);
List<AlibabaPurPrSubmitRequest.AliEmployee> list9 = new ArrayList<AlibabaPurPrSubmitRequest.AliEmployee>();
AlibabaPurPrSubmitRequest.AliEmployee obj10 = new AlibabaPurPrSubmitRequest.AliEmployee();
list9.add(obj10);
obj10.setNickName("飞流");
obj10.setName("张三");
obj10.setWorkNo("857857");
obj1.setMembers(list9);
obj1.setAssociatedPrReasonDetail("合并预算");
obj1.setAssociatedPrReason("OTHER");
obj1.setAssociatedExistingPr("PR1026788");
req.setPrDto(obj1);
AlibabaPurPrSubmitResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_pur_pr_submit_response>
    <result>
        <success>true</success>
        <error_code>500</error_code>
        <content>
            <id>2009333</id>
            <security_id>sdfasdfas234sdfa1234</security_id>
            <pr_number>PR3009</pr_number>
            <requestor>兮瑶</requestor>
            <applicant>兮瑶</applicant>
            <description>兮瑶好呀</description>
            <company_code>ant383</company_code>
            <source_type>出餐</source_type>
            <source_value>3</source_value>
            <status>4</status>
            <purchase_org_id>zt3009</purchase_org_id>
            <currency_code>15555</currency_code>
            <simplified_process>true</simplified_process>
            <need_approval>true</need_approval>
            <amount>133333</amount>
            <submit_date>2020-01-22 02:22:11</submit_date>
            <edit_url>http://www.b aic.com</edit_url>
            <detail_url>http://www.b aic.com</detail_url>
            <associated_existing_pr>PR3009</associated_existing_pr>
            <tenant_id>1009</tenant_id>
            <purchase_type>合同下单</purchase_type>
            <ext>http://www.b aic.com</ext>
            <pr_items>
                <pr_item_top_response_d_t_o>
                    <id>2222</id>
                    <source_type>蚂蚁</source_type>
                    <source_value>2009</source_value>
                    <item_type>2</item_type>
                    <item_code>cdant23</item_code>
                    <item_name>蚂蚁ito对接</item_name>
                    <item_description>蚂蚁ito对接</item_description>
                    <category_code>makll34</category_code>
                    <category_use>sd2334</category_use>
                    <acceptance_standard>优秀</acceptance_standard>
                    <uom>蚂蚁</uom>
                    <unit_price>122222</unit_price>
                    <quantity>1222</quantity>
                    <quantity_decimal>1000</quantity_decimal>
                    <amount>10000</amount>
                    <currency_code>cny</currency_code>
                    <order_type>开单</order_type>
                    <need_date_start>2020-01-22 02:22:11</need_date_start>
                    <need_date_end>2020-01-22 02:22:11</need_date_end>
                    <buyer>兮瑶</buyer>
                    <address_id>杭州市</address_id>
                    <address_info>杭州市</address_info>
                    <receiver>兮瑶</receiver>
                    <purchase_org_id>1cdis</purchase_org_id>
                    <purchase_requisition_id>PR100938293</purchase_requisition_id>
                    <goods_quotation_id>23423</goods_quotation_id>
                    <address_ext>htpp;www.dsfad.com</address_ext>
                    <sku_id>1232</sku_id>
                    <gmt_create>2020-01-22 02:22:11</gmt_create>
                    <remark>备注信息</remark>
                    <status>1</status>
                    <project_id>1232</project_id>
                    <budget_id>1232</budget_id>
                    <line_number>12342</line_number>
                    <product_id>123423</product_id>
                    <tag_info>
                        <need_project_name>蚂蚁</need_project_name>
                        <need_expense_city>蚂蚁</need_expense_city>
                        <need_activity_date>合同下单</need_activity_date>
                        <project_name>蚂蚁考题</project_name>
                        <expense_province>杭州</expense_province>
                        <expense_city>余杭区</expense_city>
                        <activity_start_date>2020-01-22 02:22:11</activity_start_date>
                        <activity_end_date>2020-01-22 02:22:11</activity_end_date>
                        <product_tag_d_t_o_list>
                            <product_tag_dto>
                                <tag_id>234234</tag_id>
                                <tag_value_d_t_o_list>
                                    <product_tag_value_dto>
                                        <tag_value_id>213</tag_value_id>
                                    </product_tag_value_dto>
                                </tag_value_d_t_o_list>
                            </product_tag_dto>
                        </product_tag_d_t_o_list>
                    </tag_info>
                    <is_designated_supplier>网商</is_designated_supplier>
                    <designated_supplier>网商</designated_supplier>
                    <pur_type>合同</pur_type>
                    <tenant_id>12342</tenant_id>
                    <supplier_id>134223</supplier_id>
                    <contract_code>1234234</contract_code>
                    <tax_rate>1</tax_rate>
                    <item_attr_info>合格</item_attr_info>
                    <po_unit_price>10000</po_unit_price>
                    <ext>http:www.bais.com</ext>
                    <is_pr_by_detail>true</is_pr_by_detail>
                </pr_item_top_response_d_t_o>
            </pr_items>
            <files>Null</files>
        </content>
        <error_msg>错误了</error_msg>
        <error_level>1</error_level>
    </result>
</alibaba_pur_pr_submit_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部