API reference · Seller Module
Add Seller
https://api.sandbox.cws.digital/sellerModule/addSellerDescription
Registers a seller of your store from an account that already exists: you identify the account and define the permissions it gets in customer service.
Request body
application/jsonRequired| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| username | string | Conditional | Login e-mail of the account. Required if | |
| document | string | Conditional | CPF or CNPJ of the account holder, masked or not. Required if | |
| restrictedCustomers | boolean | Yes |
| |
| enabledFreight | boolean | No | Allows changing the freight. | |
| enabledInsertFreight | boolean | No | Allows adding freight. | |
| enabledCustomerRegistration | boolean | No | Allows registering customers. | |
| enableRestrictedGroupsAttendant | boolean | No | Limits the seller to the restricted customer groups. | |
| enableDiscountItemValue | boolean | No | Allows giving a discount on the item value. Default | |
| enableAddItemValue | boolean | No | Allows adding value to the item. Default | |
| 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 coupons. Default | |
| enableChatSupport | boolean | No | Marks the seller as a chat attendant. Default | |
| enableChatSupportRule | boolean | No |
| |
| enableRestrictedCustomers | boolean | No | Restricted portfolio attribute stored on the seller. Default | |
| attendantCode | string | No | Seller code in your system. | |
| allowedSellersIdList | array of integer | No | Ids of sellers this seller can view. | Separate values with commas or line breaks. |
| accessStartTime | string | No | Start of the access window, in the | |
| accessEndTime | string | No | End of the access window, in the | |
| 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 of object | No | Partners the seller serves. See the partners rule. Fields in partners[] |
partners[]| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| document | string | Yes | Partner's CPF or CNPJ, masked or not. | |
| defaultPartner | boolean | Conditional | Marks the main partner. Exactly one item must come with |
Business rules
The account must exist and be active
The seller is not created from scratch: the route looks for an active account of your store by username or by document and promotes it to seller. A nonexistent account, a disabled one or one from another store is rejected.
With both fields, the search is by username.
Account that is already a seller
If the account is already a seller of your store, the response is 422 and nothing is changed, even if the profile or partners sent would be rejected.
Branch and seller discounts depend on the item discount
enableDiscountBranch and enableDiscountSeller are only considered when enableDiscountItemValue or enableAddItemValue is true. Otherwise both are stored as false, even if you send them as true.
Profile: one of the two, or none
Send profileCode or profileName, never both. The profile must exist in your store.
With neither, the seller has no profile and the response brings profile: null. Stores configured to require a profile on 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 different values.
Sending neither leaves the seller with no time restriction.
Partners need an authorized partnership
Each item of partners identifies the partner by the CPF/CNPJ in document, which must have an authorized partnership with your store. A repeated document counts once.
Exactly one of the partners must come with defaultPartner: true.
The seller joins their own portfolio
The created seller already appears in their own portfolio, to buy on their own behalf. They are listed by List Seller's Customer Portfolio.
Responses
- 401
Missing, malformed or expired token.
- 422
The account is already a seller of your store.