Property
The PostAddFarm endpoint is responsible for registering a new farm (or property) in the MIMS system. This registration can be viewed on screen CAD073.
How to register a property
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddFarm |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddFarm" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| FarmNo | String(25) | Yes | External code of the property |
| Name | String(40) | Yes | Property description |
| SupplierNo | String(15) | Yes | External code of the supplier/integrated |
| Address | AddressInfo | Yes | Object containing the property address information |
| FederalRegisterNo | String(14) | No | CNPJ/CPF of the property |
| ProductorRegisterNo | String(22) | No | Rural producer number |
| String(200) | No | Property email address | |
| AgricultureSecretaryCode | Integer | No | Agriculture Secretary code |
| InternalFarmCode | String(25) | No | Internal property code |
| OverwriteIfExists | Boolean | No | Flag indicating if data should be overwritten if the record already exists |
| TransportDataFarmSlaughterItemList | TransportDataFarmSlaughterItem | No | List of transport data between the slaughter unit and the property |
Note
- The requirement of the
Addressparameter is defined by configuration. By default, this parameter is required. To change this behavior, consult the responsible consultant.
📝 TransportDataFarmSlaughterItem Object
The TransportDataFarmSlaughterItem object represents a transport data item in the MIMS system.
Input Parameters
Parameter Type Required Description BranchNo String(25) No External Branch Code Distance Float No Distance between the property and the Slaughter Unit (Branch) TransportTime Integer No Travel time between the property and the Slaughter Unit (Branch)
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| FarmCode | Integer | Yes | Internal property code generated in the MIMS system |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddFarm"' \
--header 'Content-Type: application/json' \
--data-raw '{
"FarmNo": "FARM-00123",
"Name": "Propriedade Santa Luzia",
"SupplierNo": "SUP-045",
"Address": {
"Address": "Estrada Municipal KM 15",
"District": "VAL FLOR",
"ZIPCode": "06456100",
"City": "EMBU-GUACU",
"State": "SAO PAULO",
"StateInitials": "SP",
"Country": "BRASIL"
},
"FederalRegisterNo": "12345678000199",
"ProductorRegisterNo": "PR-982345",
"Email": "contato@santaluzia.com.br",
"AgricultureSecretaryCode": 45678,
"InternalFarmCode": "IFC-0099",
"OverwriteIfExists": true,
"TransportDataFarmSlaughterItemList": [
{
"BranchNo": "FIL-001",
"Distance": 125.6,
"TransportTime": 180
}
]
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"FarmCode": 1023
}
🐞 Possible Errors
| Code | Message |
|---|---|
| AFM‑001 | The provided External Farm/Property Code parameter (FarmNo) already exists! |
| AFM‑002 | The External Integrated Code parameter (SupplierNo) belongs to a supplier that is not of type "Integrated". Operation not allowed! |
| AFM‑003 | The Slaughter Unit was not found for the informed branch ([value sent in request]). Operation not allowed! |