API reference · Sales Rep Module
Add Sales Rep
- Method
- POST
- Route
-
/sellerModule/addSeller - Base URL
https://ws.autorei.net- Token
- Requires Bearer token
Opens this request in the public API documentation, the official source of the reference.
Description
Registers a sales rep of your store from an account that already exists: you identify the account and define the permissions it will have in customer service.
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
| Account identification | — | Yes | It is not a field — it is a group. Send username or document; see the rule below. |
username |
string | Conditional | Account login email. Required if document is not sent. |
document |
string | Conditional | CPF or CNPJ of the account holder. Required if username is not sent. |
restrictedCustomers |
boolean | Yes | true limits the sales rep to their own customer portfolio. |
enabledFreight |
boolean | No | Allows changing the freight. |
enabledInsertFreight |
boolean | No | Allows inserting freight. |
enabledCustomerRegistration |
boolean | No | Allows registering customers. |
enableRestrictedGroupsAttendant |
boolean | No | Limits the sales rep to restricted customer groups. |
enableDiscountItemValue |
boolean | No | Allows giving a discount on the item value. Default false. |
enableAddItemValue |
boolean | No | Allows adding to the item value. Default false. |
enableDiscountBranch |
boolean | No | Allows using the branch discount. See the dependency rule. |
enableDiscountSeller |
boolean | No | Allows using their own discount. See the dependency rule. |
enableCoupon |
boolean | No | Allows applying a coupon. Default true — omitting it does not turn it off. |
enableChatSupport |
boolean | No | Marks the sales rep as a chat attendant. Default false. |
enableChatSupportRule |
boolean | No | true already includes the sales rep in the chat customer portfolio queue, as manager when restrictedCustomers is true and as attendant otherwise. |
enableRestrictedCustomers |
boolean | No | Restricted portfolio attribute saved on the sales rep. Default false. |
attendantCode |
string | No | Sales rep code in your system. |
allowedSellersIdList |
array | No | Ids of sales reps this sales rep can view. |
accessStartTime |
string | No | Start of the access window, in the format HH:mm. See the window rule. |
accessEndTime |
string | No | End of the access window, in the format HH:mm. See the window rule. |
blockSaturdayAccess |
boolean | No | Blocks access on Saturday. |
blockSundayAccess |
boolean | No | Blocks access on Sunday. |
profileCode |
string | No | Access profile code. See the profile rule. |
profileName |
string | No | Access profile name. See the profile rule. |
partners |
array | No | Partners the sales rep serves. See the partners rule. |
partners[].partnerId |
integer | Conditional | Partner id. An item needs partnerId or externalId, never both. |
partners[].externalId |
integer | Conditional | Partner id in your system. Alternative to partnerId. |
partners[].defaultPartner |
boolean | Conditional | Marks the main partner. Exactly one item must come with true. |
Business rules
The account must exist and be active
The sales rep is not created from scratch: the route looks for an active account of your store by username or by document and promotes it to sales rep. A nonexistent, deactivated or other-store account is rejected.
Branch and sales rep discounts depend on the item discount
enableDiscountBranch and enableDiscountSeller are only considered when enableDiscountItemValue or enableAddItemValue is true. Without that, both are saved as false, even if you send them as true.
Profile: one of the two, or none
Send profileCode or profileName, never both. Sending neither means having no profile — and stores configured to require a profile at registration reject this case.
Access window: both or neither
accessStartTime and accessEndTime are a pair. Sending only one is rejected; sending both requires the HH:mm format and values that are different from each other. Sending neither leaves the sales rep with no time restriction.
Partners need an authorized partnership
Each partnerId provided must have an authorized partnership with your store; the same applies to the partner resolved from an externalId. On creation, exactly one of the partners must come with defaultPartner: true.
Response · 200
The created sales rep, with the effective permissions. The identification field comes back as you sent it: username when you used the email, document when you used the document.
| Field | Type | Description |
|---|---|---|
id |
uuid | Sales rep id. It is a UUID, not an integer — it is the value the module's other routes ask for in the path. |
username |
string | Sales rep login email. |
document |
string | Sales rep CPF or CNPJ. |
restrictedCustomers |
boolean | Whether the sales rep serves only their own customer portfolio. |
enabledFreight |
boolean | Whether they can change the freight. |
enabledInsertFreight |
boolean | Whether they can insert freight. |
enabledCustomerRegistration |
boolean | Whether they can register customers. |
enableDiscountItemValue |
boolean | Whether they can give a discount on the item value. |
enableAddItemValue |
boolean | Whether they can add to the item value. |
enableDiscountBranch |
boolean | Whether they can use the branch discount. |
enableDiscountFranchise |
boolean | Whether they can use the franchise discount. Only comes back true when enableDiscountBranch is also true. |
enableDiscountSeller |
boolean | Whether they can use their own discount. |
enableCoupon |
boolean | Whether they can apply a coupon. |
enableChatSupport |
boolean | Whether they serve customers through chat. |
enableRestrictedCustomers |
boolean | Restricted portfolio attribute, saved on the sales rep. |
enableRestrictedGroupsAttendant |
boolean | Whether they serve only restricted customer groups. |
attendantCode |
string | Sales rep code in your system. Comes as "" when not provided. |
allowedSellersId |
array | Ids of the sales reps this sales rep can view. Comes as [] when there are none. |
profile |
object | Sales rep profile (id, code, name). Comes as null when there is no profile. |
createdAt · updatedAt |
string | Creation and last change, in UTC. |
Errors
| Code | When |
|---|---|
| 400 | Body missing or empty (Body não informado), or validation failure. Validation messages come joined by | in a single message field — expect more than one reason per response. |
| 422 | The account is already a sales rep. |
| 404 | Rejection coming from the customer service system. The reason comes in the message. |
| 401 | Token missing, malformed or expired. |
Example request
curl --request POST 'https://ws.autorei.net/sellerModule/addSeller' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"username": "vendedor@lojaexemplo.com.br",
"restrictedCustomers": true,
"enabledFreight": false,
"enabledCustomerRegistration": false,
"enableDiscountItemValue": true,
"enableDiscountBranch": true,
"attendantCode": "VEND-001",
"accessStartTime": "08:00",
"accessEndTime": "18:00",
"blockSaturdayAccess": true,
"blockSundayAccess": true,
"profileCode": "PERFIL-VENDEDOR"
}' Example responses
200Success — sales rep identified by email
{
"id": "7c3f1a8e-4b62-4d05-9e17-5a2c8d3f6b04",
"username": "vendedor@lojaexemplo.com.br",
"document": "528.871.928-41",
"restrictedCustomers": true,
"enabledFreight": false,
"enabledInsertFreight": false,
"enabledCustomerRegistration": false,
"enableDiscountItemValue": true,
"enableAddItemValue": false,
"enableDiscountBranch": true,
"enableDiscountFranchise": false,
"enableDiscountSeller": false,
"enableCoupon": true,
"enableChatSupport": false,
"createdAt": "2026-09-01T13:42:07.512034Z",
"updatedAt": "2026-09-01T13:42:07.512034Z",
"attendantCode": "VEND-001",
"enableRestrictedCustomers": true,
"enableRestrictedGroupsAttendant": false,
"allowedSellersId": [],
"profile": {
"id": 4470301,
"code": "PERFIL-VENDEDOR",
"name": "Vendedor Padrão"
}
} Used in
- Use casesB2B customer portal: the typical path through the API
- Use casesComplex retail and B2B2C: the typical path through the API
- Use casesGuided selling and counter sales: the typical path through the API
Related endpoints
Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.