POST api/Agent/MicroApp/Receive/Trade/AddNew
创建一个新的收款单单据
Request Information
URI Parameters
None.
Body Parameters
AgentReceiveTradeAddParm| Name | Description | Type | Additional information | 
|---|---|---|---|
| AgentId | 运营商的ID。 当使用运营商接口发起这个操作时,这个参数的值不会被采信,会用当前登陆用户上下文中的值替代。当农户、组长发起操作时,此值必填。 | integer | Required | 
| ReceiveBill | 单据单号 | string | Required Max length: 12 Min length: 12 | 
| BusiFrom | 交易来源 ‘1‘前台业务,’2‘互联网业务 | string | Required Max length: 1 Min length: 1 | 
| YearCode | 账务年度 | string | Required Max length: 4 Min length: 4 | 
| SerialId | 流量计的ID | integer | None. | 
| TradeType | ‘G’按组缴费,‘F’按农户缴费,’A’按组-农户缴费 | string | Required Max length: 1 Min length: 1 | 
| LandGroupId | 组的ID | integer | None. | 
| FarmerId | 农户的ID,当农户发起操作时,此值不会被采信,将重置为当前农户用户关联的农户的ID。 | integer | None. | 
| Reserve1 | 保留 一 | string | None. | 
| Reserve2 | 保留二 | string | None. | 
| Memory | varchar(100),/*备注*/ | string | None. | 
| Detail | 明细记录 | Collection of AgentReceiveTradeDetailItem | Required | 
Request Formats
application/json, text/json
            Sample:
        
{
  "AgentId": 1,
  "ReceiveBill": "sample string 2",
  "BusiFrom": "sample string 3",
  "YearCode": "sample string 4",
  "SerialId": 5,
  "TradeType": "sample string 6",
  "LandGroupId": 7,
  "FarmerId": 8,
  "Reserve1": "sample string 9",
  "Reserve2": "sample string 10",
  "Memory": "sample string 11",
  "Detail": [
    {
      "TradeId": 1,
      "FarmerId": 2
    },
    {
      "TradeId": 1,
      "FarmerId": 2
    }
  ]
}
        application/xml, text/xml
            Sample:
        
<AgentReceiveTradeAddParm xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer.Flowmeter">
  <AgentId>1</AgentId>
  <BusiFrom>sample string 3</BusiFrom>
  <Detail>
    <AgentReceiveTradeDetailItem>
      <FarmerId>2</FarmerId>
      <TradeId>1</TradeId>
    </AgentReceiveTradeDetailItem>
    <AgentReceiveTradeDetailItem>
      <FarmerId>2</FarmerId>
      <TradeId>1</TradeId>
    </AgentReceiveTradeDetailItem>
  </Detail>
  <FarmerId>8</FarmerId>
  <LandGroupId>7</LandGroupId>
  <Memory>sample string 11</Memory>
  <ReceiveBill>sample string 2</ReceiveBill>
  <Reserve1>sample string 9</Reserve1>
  <Reserve2>sample string 10</Reserve2>
  <SerialId>5</SerialId>
  <TradeType>sample string 6</TradeType>
  <YearCode>sample string 4</YearCode>
</AgentReceiveTradeAddParm>
        application/x-www-form-urlencoded
            Sample:
    
        Sample not available.
application/bson
            Sample:
Binary JSON content. See http://bsonspec.org for details.
Response Information
Resource Description
创建一个新的收款单单据
CommonOperationResult| Name | Description | Type | Additional information | 
|---|---|---|---|
| errcode | 错误代码,通常0表示成功,其他值表示错误。 | integer | None. | 
| errmsg | 错误描述,当errcode不为零时,此值可以用于呈现给用户。 | string | None. | 
| tag | 操作同时,服务器端需要返回的其他值。 | string | None. | 
Response Formats
application/json, text/json
            Sample:
        
{
  "errcode": 1,
  "errmsg": "sample string 2",
  "tag": "sample string 3"
}
        application/xml, text/xml
            Sample:
        <CommonOperationResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer"> <errcode>1</errcode> <errmsg>sample string 2</errmsg> <tag>sample string 3</tag> </CommonOperationResult>
application/bson
            Sample:
Binary JSON content. See http://bsonspec.org for details.