Products

Update selected fields for a product

Updates only the fields given in content; fields that are omitted keep their current value. The product is merged with the given fields and then saved with the same validation as PUT, so the result must be a valid product (for example a unique productno and a non-empty title). content.tags and content.suppliers, when given, replace the existing lists. Changing stockno creates a stock transaction.

patch/products/{productId}

Request

  • Base URL
    https://api.c1st.com/api
  • URL
    https://api.c1st.com/api/products/{productId}
  • Auth
    HTTP bearer

Path parameters

productIdinteger required

The product ID

Request body

stocktransactiontagidnumber nullable
resthookmetadatastring

The string content has to be valid JSON. It is passed through untouched to the subscribers of the resthooks the request triggers, so it can carry whatever meta data those subscribers need in order to process the event.

stocktransactionreasonstring

The reason why the product stock was updated. This will be saved in the product stock transaction log.

stocknochangeisrelativeboolean

If true, the Product.stockno update is interpreted as relative to its previous value; for example, if the previous value was 40 and you pass Product.stockno=42, it's interpreted as adding 2 (e.g. receiving 2 items from a supplier), and if you pass Product.stockno=38, it's interpreted as removing 2 (e.g. selling 2 items). If stocknochangeisrelative is false, the change is interpreted as absolute, e.g. with the intention of setting the initial value or correcting a wrong number. Note it has no direct effect on how Customers 1st functions; Product.stockno will always be set to the specified value; but it affects REST hooks (product.updated events) and 3rd party integrations if they distinguish between absolute and relative changes in the number of items in stock. See also stocknochangetype in Product.

orderidinteger

A reference to the shopping list item id for which this product stock has been updated.

setatpartnersboolean

Create/update relavant product data at partner stores

Example request

{
  "content": {
    "title": "Scott Scale 960",
    "price": 100,
    "pricewithoutvat": 80,
    "costprice": 8.65,
    "recommendedretailprice": 99.95,
    "suppliers": [
      {
        "id": 1,
        "name": "Johnson",
        "email": "johnson@doe.com",
        "address": "A place",
        "city": "London",
        "note": "Sells bike parts"
      }
    ],
    "tags": [
      {
        "position": 23.04
      }
    ],
    "updated_at": "2022-03-10 00:00:00"
  }
}

Response

Ok

allow_edit_productno_and_serienoboolean nullable

If true, the productno and serieno can be changed.

Example response

{
  "content": {
    "title": "Scott Scale 960",
    "price": 100,
    "pricewithoutvat": 80,
    "costprice": 8.65,
    "recommendedretailprice": 99.95,
    "suppliers": [
      {
        "id": 1,
        "name": "Johnson",
        "email": "johnson@doe.com",
        "address": "A place",
        "city": "London",
        "note": "Sells bike parts"
      }
    ],
    "tags": [
      {
        "position": 23.04
      }
    ],
    "updated_at": "2022-03-10 00:00:00"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.