API reference · Contracts
Update Branch Contract
https://api.sandbox.cws.digital/pricing/contract/{contractId}/store/{partnerId}Description
Allows a parent account to update part of the header of a contract of one of its branches: status, validity period, scope and application filters. It is a partial update — send only the fields you want to change.
The body and the response are identical to those of the update in your own store — the difference is the branch that owns the contract, which comes in the route and is validated against the links of your parent account.
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 | |
| partnerId | integer | Yes | Id of the branch that owns the contract. It must be linked to the token's parent account. |
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 branch, or restricts it back to the customers in the list. | |
| allPartners | boolean | No | Makes the contract apply to all branches of the parent account, 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.
Responses
- 403
Branch not linked to your parent account.