API reference · Contracts

Remove Customers from the Contract

DELETEhttps://api.sandbox.cws.digital/pricing/contract/{contractId}/customers

Description

Removes customers from a contract, by each one's document. The customers stop receiving the contract prices.

Send from 1 to 100 documents per request. Those that are not in the contract come back in notFound, without preventing the others.

Parameters

Path parameters

FieldTypeRequiredDescriptionValue
contractIdintegerYes

Contract id, returned in id on creation.

Request body

Content-Typeapplication/jsonRequired
Edit the body with
FieldTypeRequiredDescriptionValue
customersarray of stringYes

Documents of the customers to remove, as strings with the mask (CPF 000.000.000-00, CNPJ 00.000.000/0000-00). From 1 to 100 per request, with at least one filled in.

Separate values with commas or line breaks.

Business rules

A document outside the contract comes back in notFound

A document that is not linked to the contract does not interrupt the request: it comes back in notFound.customers and the others are removed. The response is 200 even when no document was removed.

Send the document with the mask, as in the addition: with digits only it comes back in notFound.customers, even if it is in the contract.

To empty the whole list at once, use deleteAllCustomers in Update Contract.

Responses

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 DELETE \
  --url 'https://api.sandbox.cws.digital/pricing/contract/{contractId}/customers' \
  --globoff \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customers": [
    "57.578.030/0001-05"
  ]
}'

Response

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