Sellers
The PostAddSeller endpoint is responsible for registering a new seller in the MIMS system and can be viewed on screen CAD054.
How to register a seller
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddSeller |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddSeller" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| SellerNo | String(25) | Yes | External code of the seller |
| CorporateName | String(40) | Yes | Seller name |
| BusinessName | String(40) | Yes | Trade name of the seller |
| ShortName | String(15) | No | Short name of the seller |
| Address | AddressInfo | Yes | Object containing the seller address information |
| Phone | String(15) | No | Phone number |
| String(200) | No | ||
| FoundationDate | Data | No | Birth date |
| 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) |
| PersonType | PersonType | Yes | Enumerator with possible values for Person Type: ptCompany (Legal Entity) or ptPerson (Individual) |
| Commission | Float | No | Seller commission percentage |
| InternalCodeNo | String(25) | No | Seller Integration Code |
| IsInactive | Boolean | No | Flag indicating that the seller is inactive |
| 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 |
| SellerCode | Integer | Yes | Internal seller code generated in the MIMS system |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddSeller"' \
--header 'Content-Type: application/json' \
--data '{
"SellerNo": "VND12345",
"CorporateName": "Vendedor Exemplo LTDA",
"BusinessName": "Vendedor Exemplo",
"ShortName": "VendEx",
"Address": {
"AddressType": "Rua",
"Address": "Rua Exemplo",
"Number": "100",
"District": "Centro",
"ZIPCode": "01000000",
"City": "Cidade Exemplo",
"State": "São Paulo",
"StateInitials": "SP",
"Country": "Brasil"
},
"Phone": "11999990000",
"Email": "vendedor@example.com",
"FoundationDate": "2022-01-01",
"RegisterDate": "2022-01-15T14:30:00",
"FederalRegisterNo": "12345678000190",
"StateRegisterNo": "123456789",
"PersonType": "ptCompany",
"Commission": 5.5,
"InternalCodeNo": "INT123",
"IsInactive": false,
"OverwriteIfExists": true
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"SellerCode": 789
}
🐞 Possible Errors
| Code | Message |
|---|---|
| ASL‑001 | The provided External Seller Code parameter (SellerNo) already exists! |