Skip to main content

Product Supply Contract

The AddProductSupplyContract endpoint is responsible for registering a new Product Supply Contract in the MIMS system and can be viewed on screen CAD420.


How to register a product supply contract

HTTP POST Request

Request TypeExample URL
POST{{url_base}}/AddProductSupplyContract
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"AddProductSupplyContract"

Input Parameters

ParameterTypeRequiredDescription
ContractNoString(25)YesExternal code of the product supply contract
BranchNoString(25)YesExternal code of the branch
ContractNumberString(25)YesProduct supply contract number
ContractNameString(40)NoProduct supply contract description
SupplierNoString(25)YesExternal code of the supplier
ProductNoString(25)YesExternal code of the product
ContractTermStartDateDataHoraYesContract term start date
ContractTermEndDateDataHoraYesContract term end date
TotalContractedQtyIntegerYesTotal contracted quantity (UN)
TotalContractedWeightFloatNoTotal contracted weight (Kg)
ContractedValuePerKiloFloatYesContracted value per Kg
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists

Return

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
ContractCodeIntegerYesInternal Product Supply Contract code generated in the MIMS system

Request Example

curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddProductSupplyContract"' \
--header 'Content-Type: application/json' \
--data '{
"ContractNo": "CTR-2025-001",
"BranchNo": "FIL-001",
"ContractNumber": "CTN-987654",
"ContractName": "Contrato de Fornecimento de Milho 2025",
"SupplierNo": "115370",
"ProductNo": "PROD-MILHO-001",
"ContractTermStartDate": "2025-01-01T00:00:00",
"ContractTermEndDate": "2025-12-31T23:59:59",
"TotalContractedQty": 50000,
"TotalContractedWeight": 3000000.5,
"ContractedValuePerKilo": 1.75,
"OverwriteIfExists": true
}'

Response Example

{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"ContractCode": 98765
}

🐞 Possible Errors

CodeMessage
PSC‑001The provided External Product Supply Contract Code parameter (ContractNo) already exists!