Suppliers
The PostAddSupplier endpoint is responsible for registering new suppliers.
In the Edata system, we consider three types of suppliers, which can be registered and consulted:
- Transporters: Suppliers that perform transportation of products and goods and can be managed by routine CAD056 - Transporter Registration.
- Input Suppliers: Those that supply materials and inputs used in production and can be managed by routine CAD053 - Supplier Registration.
- Integrated: Suppliers that directly participate in the integrated production chain and can be managed by routine CAD085 - Integrated Registration.
How to register a supplier
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddSupplier |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddSupplier" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| SupplierNo | String(25) | Yes | External code of the Supplier |
| CorporateName | String(40) | Yes | Supplier name |
| BusinessName | String(40) | Yes | Trade name of the supplier |
| ShortName | String(15) | No | Short name of the supplier |
| Phone | String(15) | No | Phone number |
| String(200) | No | ||
| RegisterDate | DataHora | No | Registration date |
| FederalRegisterNo | String(14) | Yes | CNPJ (Legal Entity) or CPF (Individual) |
| StateRegisterNo | String(20) | Yes | State registration (Legal Entity) or ID (Individual) |
| Address | AddressInfo | Yes | Object containing the Supplier address information |
| SupplierType | SupplierType | Yes | Enumerator with possible values for supplier type: stIntegrator (Integrated), stTransporter (Transporter) or stSupplier (Supplier) |
| PersonType | PersonType | Yes | Enumerator with possible values for Person Type: ptCompany (Legal Entity) or ptPerson (Individual) |
| IsSelfEmployed | Boolean | No | Flag indicating that the supplier is Self-Employed |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
Note
- The requirement of the
Addressparameter is defined by configuration. By default, this parameter is required. To change this behavior, consult the responsible consultant. - The value provided in the
FederalRegisterNoparameter must respect the size according to the person type specified in thePersonTypeparameter:- 14 characters when
PersonType = ptCompany(corresponds to CNPJ) - 11 characters when
PersonType = ptPerson(corresponds to CPF)
- 14 characters when
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| SupplierCode | Integer | Yes | Internal supplier code generated in the MIMS system |
Request Example
curl --location 'http://localhost:8080/datasnap/rest/RESTWebServiceMethods/"PostAddSupplier"' \
--header 'Content-Type: application/json' \
--data-raw '{
"SupplierNo": "F12345",
"CorporateName": "Example Supplier",
"BusinessName": "Example Supplier",
"ShortName": "Fornecedor",
"Address": {
"AddressType": "Rua",
"Address": "Antônio Alves",
"Number": "35",
"District": "Vila Universitaria",
"ZIPCode": "17012431",
"City": "BAURU",
"State": "SAO PAULO",
"StateInitials": "SP",
"Country": "BRASIL",
"SubLogisticRegionNo": "001",
"PersonAdressNo": "98765"
},
"SupplierType": "stTransporter",
"Phone": "01431618500",
"Email": "exemplo@edata.com.br",
"RegisterDate": "2025-01-21T00:00:00",
"FederalRegisterNo": "12345678000195",
"StateRegisterNo": "123456789",
"PersonType": "ptCompany",
"IsSelfEmployed": false,
"OverwriteIfExists": true
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"SupplierCode": 123
}
🐞 Possible Errors
| Code | Message |
|---|---|
| ASP‑001 | The provided External Supplier Code parameter (SupplierNo) already exists! |
| ASP‑002 | It is not possible to modify the Supplier Type (SupplierType) of an already registered Supplier! |
| ASP‑003 | The "PersonType" parameter was entered as "ptPerson", but the value entered in the "FederalRegisterNo" parameter ([value sent in request]) has more than 11 digits. |