API reference · Contracts
Add Customers to the Contract
https://api.sandbox.cws.digital/pricing/contract/{contractId}/customersDescription
Adds customers to a contract, by each one's document. The customers start receiving the contract prices.
Send from 1 to 100 documents per request. Those that are not found come back in notFound, without preventing the others.
Parameters
Path parameters
| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| contractId | integer | Yes | Contract id, returned in |
Request body
application/jsonRequired| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| customers | array of string | Yes | Customer documents, as strings with the mask (CPF | Separate values with commas or line breaks. |
Business rules
A contract for all customers does not take individual customers
A contract created with allCustomers: true already applies to all customers of the store and rejects the addition with 400 and priceContract.customers.addNotAllowed. To build a customer list, the contract must have allCustomers: false.
A document that does not exist in the database comes back in notFound
The customer must exist on the platform, but does not need to have bought from your store.
The document goes with the mask — CPF 000.000.000-00, CNPJ 00.000.000/0000-00: with digits only it is not found and comes back in notFound.customers, even if the customer exists.
A document that does not resolve does not interrupt the request: it comes back in notFound.customers and the others are stored. The response is 200 even when no document resolved.