Skip to main content

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 TypeExample URL
POST{{url_base}}/PostAddFarm
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddFarm"

Input Parameters

ParameterTypeRequiredDescription
FarmNoString(25)YesExternal code of the property
NameString(40)YesProperty description
SupplierNoString(15)YesExternal code of the supplier/integrated
AddressAddressInfoYesObject containing the property address information
FederalRegisterNoString(14)NoCNPJ/CPF of the property
ProductorRegisterNoString(22)NoRural producer number
EmailString(200)NoProperty email address
AgricultureSecretaryCodeIntegerNoAgriculture Secretary code
InternalFarmCodeString(25)NoInternal property code
OverwriteIfExistsBooleanNoFlag indicating if data should be overwritten if the record already exists
TransportDataFarmSlaughterItemListTransportDataFarmSlaughterItemNoList of transport data between the slaughter unit and the property
Note
  • The requirement of the Address parameter 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

ParameterTypeRequiredDescription
BranchNoString(25)NoExternal Branch Code
DistanceFloatNoDistance between the property and the Slaughter Unit (Branch)
TransportTimeIntegerNoTravel time between the property and the Slaughter Unit (Branch)

Return

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
FarmCodeIntegerYesInternal 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

CodeMessage
AFM‑001The provided External Farm/Property Code parameter (FarmNo) already exists!
AFM‑002The External Integrated Code parameter (SupplierNo) belongs to a supplier that is not of type "Integrated". Operation not allowed!
AFM‑003The Slaughter Unit was not found for the informed branch ([value sent in request]). Operation not allowed!