Skip to content
campaiDeveloper
campai.com

Sales · Inventory

POST/{organizationId}/{mandateId}/sales/inventory/stock

Adjust stock

Records what happened to the stock of a counted product: pieces received add to it, pieces counted set what is left, pieces removed take away. The change is kept in the product stock changes

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Permission checks in detail
Required permissions
  • mandate.read
  • product.read
  • inventory.edit
Required for some requests, where input is what the request sends
  • salesPeriod.read, if input.periodId

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Body

Content-Type: application/json

  • productIdidrequired
  • periodIdidrequirednullable
  • kindstringrequired
    received counted removed
  • quantitynumberrequired

    at least 0

  • notestring

    at most 200 characters · default ""

Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/sales/inventory/stock' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

Content-Type: application/json

  • capacitynumber

    at least 0

  • usednumber

    at least 0

  • availablenumber

    at least 0

Response200
{
  "capacity": 0,
  "used": 0,
  "available": 0
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.