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 Type | Example URL |
|---|---|
| POST | {{url_base}}/AddProductSupplyContract |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"AddProductSupplyContract" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ContractNo | String(25) | Yes | External code of the product supply contract |
| BranchNo | String(25) | Yes | External code of the branch |
| ContractNumber | String(25) | Yes | Product supply contract number |
| ContractName | String(40) | No | Product supply contract description |
| SupplierNo | String(25) | Yes | External code of the supplier |
| ProductNo | String(25) | Yes | External code of the product |
| ContractTermStartDate | DataHora | Yes | Contract term start date |
| ContractTermEndDate | DataHora | Yes | Contract term end date |
| TotalContractedQty | Integer | Yes | Total contracted quantity (UN) |
| TotalContractedWeight | Float | No | Total contracted weight (Kg) |
| ContractedValuePerKilo | Float | Yes | Contracted value per Kg |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| ContractCode | Integer | Yes | Internal 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
| Code | Message |
|---|---|
| PSC‑001 | The provided External Product Supply Contract Code parameter (ContractNo) already exists! |