API reference · Seller Module

Link Customer to Seller

POSThttps://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

FieldTypeRequiredDescriptionValue
attendantIdOrDocumentstringYes

Identifies the seller of your store by the unmasked CPF/CNPJ or by the login e-mail.

Query parameters

FieldTypeRequiredDescriptionValue
uniqueAttendantbooleanNo

true leaves this seller as the customer's only seller in your store. Default false, which allows several sellers for the same customer. See uniqueAttendant leaves a single seller.

Request body

Content-Typeapplication/jsonRequired
Edit the body with
FieldTypeRequiredDescriptionValue
usernamestringConditional

Customer's login e-mail. Required if document is not sent.

documentstringConditional

Customer's CPF or CNPJ. Required if username is not sent.

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.

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/addCustomer/{attendantIdOrDocument}' \
  --globoff \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "document": "57.578.030/0001-05"
}'

Response

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