API reference · Contracts
Update Contract
https://api.sandbox.cws.digital/pricing/contract/{contractId}Description
Updates part of the header of a contract: status, validity period, scope and application filters. It is a partial update — send only the fields you want to change.
It also empties the contract at once, with deleteAllItems and deleteAllCustomers.
All fields are optional, but the body must bring at least one of them filled in.
The name, the type and the products and customers of the contract are not part of this body: the validity period is updated through dateStart and dateEnd, and customers and products through their own endpoints.
Parameters
Path parameters
| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| contractId | integer | Yes | Contract id, returned in |
Request body
application/jsonRequired| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| active | boolean | No | Activates or deactivates the contract. | |
| dateStart | string | No | New start of the validity period, in the format | |
| dateEnd | string | No | New end of the validity period, in the format | |
| allCustomers | boolean | No | Makes the contract apply to all customers of the store, or restricts it back to the customers in the list. | |
| allPartners | boolean | No | Makes the contract apply to all branches of the store, or restricts it back to the branches in the list. | |
| stateList | array of string | No | States where the contract applies. See Add or replace filters. | Separate values with commas or line breaks. |
| partners | array of integer | No | Ids of the branches where the contract applies. See Add or replace filters. | Separate values with commas or line breaks. |
| customerGroupList | array of object | No | Customer groups of the contract, each one by Fields in customerGroupList[] | |
| deleteAllItems | boolean | No |
| |
| deleteAllCustomers | boolean | No |
| |
| replaceFilters | boolean | No | Defines how the filters sent are combined with the existing ones. Default |
customerGroupList[]| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| externalId | string | Yes | Id of the group in your system, resolved to the platform id. |
Business rules
Add or replace filters
With replaceFilters: false (the default), the states, branches and groups sent are added to the ones the contract already has.
With replaceFilters: true, the contract filters become exactly the ones you sent.