API reference · Contracts · Store Management
Add Customers to Contract
- Method
- PUT
- Route
-
/pricing/contract/:contractId/customers - Base URL
https://ws.autorei.net- Path parameters
:contractId- Token
- Requires Bearer token
Opens this request in the public API documentation, the official source of the reference.
Description
Adds customers to a contract, by the document of each one. 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 blocking the others.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
contractId |
integer | Yes | Contract id, returned in id on creation. |
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
customers |
array | Yes | Customer documents, as strings. From 1 to 100 per request, with at least one filled in. |
Business rules
A contract for all customers does not accept 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 list of customers, 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. 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.
Response · 200
| Field | Description |
|---|---|
id |
Contract id. |
customers |
Documents that were linked to the contract. |
notFound.customers |
Documents you sent that were not found on the platform. |
Errors
| Code | When |
|---|---|
| 400 | The contractId in the path 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 store of the token: {"error":"priceContract.notFound"}. |
| 400 | The contract applies to all customers and does not accept individual customers: {"error":"priceContract.customers.addNotAllowed"}. |
| 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. |
Example request
curl --request PUT 'https://ws.autorei.net/pricing/contract/:contractId/customers' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"customers": [
"29893264000101",
"70041364856"
]
}' Example responses
200Success — one customer linked and one not found
{
"id": 4610001,
"customers": [
"29893264000101"
],
"notFound": {
"customers": [
"70041364856"
]
}
} Used in
- Use casesEcommerce ERP integration: the typical path through the API
- Use casesB2B customer portal: the typical path through the API
- Use casesB2B procurement and supplies: the typical path through the API
- Get startedErrors
Related endpoints
Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.