API reference · Seller Module

Add Seller

POSThttps://api.sandbox.cws.digital/sellerModule/addSeller

Description

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

Content-Typeapplication/jsonRequired
Edit the body with
FieldTypeRequiredDescriptionValue
usernamestringConditional

Login e-mail of the account. Required if document is not sent.

documentstringConditional

CPF or CNPJ of the account holder, masked or not. Required if username is not sent.

restrictedCustomersbooleanYes

true limits the seller to their own customer portfolio.

enabledFreightbooleanNo

Allows changing the freight.

enabledInsertFreightbooleanNo

Allows adding freight.

enabledCustomerRegistrationbooleanNo

Allows registering customers.

enableRestrictedGroupsAttendantbooleanNo

Limits the seller to the restricted customer groups.

enableDiscountItemValuebooleanNo

Allows giving a discount on the item value. Default false.

enableAddItemValuebooleanNo

Allows adding value to the item. Default false.

enableDiscountBranchbooleanNo

Allows using the branch discount. See the dependency rule.

enableDiscountSellerbooleanNo

Allows using their own discount. See the dependency rule.

enableCouponbooleanNo

Allows applying coupons. Default true — omitting it does not turn it off.

enableChatSupportbooleanNo

Marks the seller as a chat attendant. Default false.

enableChatSupportRulebooleanNo

true already adds the seller to the chat portfolio queue, as manager when restrictedCustomers is true and as attendant otherwise.

enableRestrictedCustomersbooleanNo

Restricted portfolio attribute stored on the seller. Default false.

attendantCodestringNo

Seller code in your system.

allowedSellersIdListarray of integerNo

Ids of sellers this seller can view.

Separate values with commas or line breaks.
accessStartTimestringNo

Start of the access window, in the HH:mm format. See the window rule.

accessEndTimestringNo

End of the access window, in the HH:mm format. See the window rule.

blockSaturdayAccessbooleanNo

Blocks access on Saturday.

blockSundayAccessbooleanNo

Blocks access on Sunday.

profileCodestringNo

Access profile code. See the profile rule.

profileNamestringNo

Access profile name. See the profile rule.

partnersarray of objectNo

Partners the seller serves. See the partners rule.

Fields in partners[]

Items of partners[]
partners[]
FieldTypeRequiredDescriptionValue
documentstringYes

Partner's CPF or CNPJ, masked or not.

defaultPartnerbooleanConditional

Marks the main partner. Exactly one item must come with true.

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.

Try it

Sandbox

Language

Credentials

Access token: saved in this tab and used on every endpoint.

Each token only reaches the partner's own data and that of the branches with an authorized link.

Don't have sandbox credentials yet? See how to request them

Request

cURL
curl --request POST \
  --url 'https://api.sandbox.cws.digital/sellerModule/addSeller' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "username": "vendedor@lojaexemplo.com.br",
  "restrictedCustomers": true,
  "enabledFreight": false,
  "enabledInsertFreight": false,
  "enabledCustomerRegistration": false,
  "enableDiscountItemValue": true,
  "enableDiscountBranch": true,
  "attendantCode": "VEND-001",
  "accessStartTime": "08:00",
  "accessEndTime": "18:00",
  "blockSaturdayAccess": true,
  "blockSundayAccess": true,
  "profileCode": "PERFIL-VENDEDOR"
}'

Response

Click Try it to see the real response here, or pick a documented example: