API reference · Seller Module
Link Customer to Seller
https://api.sandbox.cws.digital/sellerModule/addCustomer/{attendantIdOrDocument}Description
Links a customer to a seller's portfolio. From the link on, the customer is served by that seller.
Parameters
Path parameters
| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| attendantIdOrDocument | string | Yes | Identifies the seller of your store by the unmasked CPF/CNPJ or by the login e-mail. |
Query parameters
| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| uniqueAttendant | boolean | No |
|
Request body
application/jsonRequired| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| username | string | Conditional | Customer's login e-mail. Required if | |
| document | string | Conditional | Customer's CPF or CNPJ. Required if |
Business rules
The customer must belong to your store
The link is only created for an active account registered as a customer in your store. A customer from another store, a disabled account or a document without registration is rejected.
With username, the search is by e-mail only, even if you also send document. Spaces at the start and end of the e-mail are ignored.
Link that already exists
Repeating a link that already exists responds 422. A link removed before becomes valid again, with the same id.
uniqueAttendant leaves a single seller
With uniqueAttendant=true, the customer leaves the portfolio of the other sellers of your store and stays only with this one.
If the customer is already in the portfolio of this seller and of others, the response is 200 with the link that already existed. If this is already the customer's only seller, 422.
Responses
- 401
Missing, malformed or expired token.
- 422
The customer is already in the seller's portfolio.