Skip to content
platform

API reference · Contracts · Head Office Management

Remove Products from Branch Contract

Method
DELETE
Route
/pricing/contract/:contractId/items/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 products from the contract of one of its branches. The products go back to being sold at the branch's list price.

The body and the response are identical to those of the 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 at creation.
partnerId integer Yes Id of the branch that owns the contract. Must be linked to the token's head office.

Request body (JSON)

Field Type Required Description
items array Yes From 1 to 100 products.
Product identification — not a field, it is a group — Yes One of the two forms in the How to identify the product section: items[].partnerPartCode · items[].skuAttributeValue with skuAttributeName.
skuAttributeName string Conditional Name of the attribute used to resolve items[].skuAttributeValue. Required when you identify the products by attribute. Applies to the whole submission, not per item.

How to identify the product

Each product must carry one of the two forms, in this order of precedence:

Form Fields When to use
By partner code partnerPartCode You identify the product by your own code.
By attribute skuAttributeValue with skuAttributeName in the envelope You have contracted the product catalog service with your own attribute.

Business rules

A product outside the contract comes back in notFound

A product that is not in the contract does not interrupt the request: it comes back in notFound.items and the rest are removed. The response is 200 even when no product was removed.

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

Response · 200

Field Description
id Contract id.
items[].skuId Id of the SKU removed.
items[].price Price the product had in the contract, before removal.
items[].targetMargin · items[].totalCost Target margin and cost the product had in the contract.
items[].partnerPartCode · items[].skuAttributeValue Echo of the identification you sent.
notFound.items Products you sent that were not in the contract, or that were not resolved in the branch catalog.

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 branch informed: {"error":"priceContract.notFound"}.
422 items missing, empty or with more than 100 entries. 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 correct — what is missing is the link.

Example request

curl --request DELETE 'https://ws.autorei.net/pricing/contract/:contractId/items/store/:partnerId' \
  --header 'Authorization: Bearer {{access_token}}' \
  --header 'Content-Type: application/json' \
  --data '{
  "items": [
    {
      "partnerPartCode": "SKU-A-001"
    },
    {
      "partnerPartCode": "SKU-Z-999"
    }
  ]
}'

Example responses

200Success — product removed

{
  "id": 4610002,
  "items": [
    {
      "skuId": 500101,
      "partnerPartCode": "SKU-A-001",
      "price": 139.9,
      "targetMargin": null,
      "totalCost": null
    }
  ],
  "notFound": {
    "items": [
      {
        "partnerPartCode": "SKU-Z-999",
        "price": null,
        "targetMargin": null,
        "totalCost": null
      }
    ]
  }
}

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.