API reference · Contracts

Remove Products from the Contract

DELETEhttps://api.sandbox.cws.digital/pricing/contract/{contractId}/items

Description

Removes products from the contract. The products go back to being sold at the store's list price.

Send from 1 to 100 products per request, identified in the same way as in the addition. The price is not sent in the removal.

How to identify the product

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

FormFieldsWhen to use
By partner codepartnerPartCodeYou identify the product by your own code.
By attributeskuAttributeValue with skuAttributeName in the envelopeYou have contracted the product catalog service with your own attribute.

Parameters

Path parameters

FieldTypeRequiredDescriptionValue
contractIdintegerYes

Contract id, returned in id on creation.

Request body

Content-Typeapplication/jsonRequired
Edit the body with
FieldTypeRequiredDescriptionValue
itemsarray of objectYes

From 1 to 100 products.

Fields in items[]

skuAttributeNamestringConditional

Name of the attribute used to resolve items[].skuAttributeValue. Required when you identify the products by attribute. It applies to the whole submission, not per item.

Items of items[]
items[]
FieldTypeRequiredDescriptionValue
partnerPartCodestringNo

By partner code. You identify the product by your own code. Case-sensitive.

skuAttributeValuestringNo

By attribute, with skuAttributeName in the envelope. You have contracted the product catalog service with your own attribute. Case-sensitive.

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 others are removed. The response is 200 even when no product was removed.

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

Responses

Try it

Sandbox

Language

Credentials

Access token: saved in this tab and used on every endpoint.

Each token only reaches the partner's own data and that of the branches with an authorized link.

Don't have sandbox credentials yet? See how to request them

Request

cURL
curl --request DELETE \
  --url 'https://api.sandbox.cws.digital/pricing/contract/{contractId}/items' \
  --globoff \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "items": [
    {
      "partnerPartCode": "PRODUTO-TESTE-001"
    },
    {
      "partnerPartCode": "SKU-Z-999"
    }
  ]
}'

Response

Click Try it to see the real response here, or pick a documented example: