Customer Group
Customer Group Registration
The PostAddCustomerGroup endpoint is responsible for registering a new Customer Group in the MIMS system. This registration can be viewed on screen CAD028.
How to register a customer group
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddCustomerGroup |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddCustomerGroup" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| CustomerGroupNo | String(25) | Yes | External code of the customer group |
| Name | String(40) | Yes | Customer group description |
| 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 |
| CustomerGroupCode | Integer | Yes | Internal Customer Group code generated in the MIMS system |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddCustomerGroup"' \
--header 'Content-Type: application/json' \
--data '{
"CustomerGroupNo": "CG001",
"Name": "Clientes Varejo",
"OverwriteIfExists": true
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"CustomerGroupCode": 4
}
🐞 Possible Errors
| Code | Message |
|---|---|
| ACG‑001 | The provided External Customer Group Code parameter (CustomerGroupNo) already exists! |
Customer Group Deletion
The PostDeleteCustomerGroup endpoint is responsible for executing the deletion of a Customer Group in the MIMS system.
How to delete a customer group
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostDeleteCustomerGroup |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteCustomerGroup" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| CustomerGroupNo | String(25) | Yes | External code of the customer group |
| ErrorIfNotFound | Boolean | No | Returns error if the informed customer group does not exist in the database |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
Request Example
curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteCustomerGroup"' \
--header 'Content-Type: application/json' \
--data '{
"CustomerGroupNo": "CG001",
"ErrorIfNotFound": false
}'
Response Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
}
}
🐞 Possible Errors
| Code | Message |
|---|---|
| DCG‑001 | The informed customer group belongs to a customer, therefore it cannot be deleted! |
| DCG‑002 | The provided External Customer Group Code parameter (CustomerGroupNo) was not found! |