Skip to content
platform

API reference · Contracts · Head Office Management

Remove Customers from Branch Contract

Method
DELETE
Route
/pricing/contract/:contractId/customers/store/:partnerId
Base URL
https://ws.autorei.net
Path parameters
:contractId :partnerId
Token
Requires Bearer token
Test in Postman

Opens this request in the public API documentation, the official source of the reference.

Description

Allows a head office account to remove customers from a contract of one of its branches, by each one's document. The customers stop receiving the contract prices.

The body and the response are identical to those of removal in the store itself — the difference is the branch that owns the contract, which comes in the route and is validated against your head office's links.

Path Parameters

Parameter Type Required Description
contractId integer Yes Contract id, returned in id on creation.
partnerId integer Yes Id of the branch that owns the contract. It must be linked to the token's head office.

Request Body (JSON)

Field Type Required Description
customers array Yes Documents of the customers to remove, as strings. From 1 to 100 per request, with at least one filled in.

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.

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

Response · 200

Field Description
id Contract id.
customers Documents that were unlinked from the contract.
notFound.customers Documents you sent that were not in the contract.

Errors

Code When
400 The route's partnerId is not numeric: {"error":"Invalid target partner ID"}.
400 The route's contractId is not a number greater than zero: {"error":"invalid contract id: \"...\""}.
400 The body is not valid JSON. The detail comes in error.
400 The contract does not exist or does not belong to the given branch: {"error":"priceContract.notFound"}.
422 customers missing, empty, with more than 100 entries or with only empty strings. The detail comes in error.
401 Token missing, malformed or expired: {"error":"Authentication required for this route"}.
403 The branch is not linked to your head office: {"error":"Access denied: Invalid partnership"}. Unlike 400, here the payload is right — what is missing is the link.

Example request

curl --request DELETE 'https://ws.autorei.net/pricing/contract/:contractId/customers/store/:partnerId' \
  --header 'Authorization: Bearer {{access_token}}' \
  --header 'Content-Type: application/json' \
  --data '{
  "customers": [
    "29893264000101"
  ]
}'

Example responses

200Success — customer removed

{
  "id": 4610002,
  "customers": [
    "29893264000101"
  ],
  "notFound": {
    "customers": []
  }
}

Used in

This endpoint does not appear in any published use case yet.

Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.