Skip to content
campaiDeveloper
campai.com

Sales ยท Statistics

GET/{organizationId}/{mandateId}/sales/statistics/inventoryUsageReads only

Get inventory usage

Returns the list value of the inventory with how much of it is sold, committed, or reserved, counted like the product list, the list value of what the invoices of a period sold and of the period of the same length right before it, and the five best-selling products. All amounts are in cents

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.read

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Query parameters

  • fromDatestringrequired
  • toDatestringrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/sales/statistics/inventoryUsage' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • inventoryValuenumber

    at least 0

  • usageobject
    3 properties
    • soldValuenumber

      at least 0

    • committedValuenumber

      at least 0

    • reservedValuenumber

      at least 0

  • productCountinteger

    at least 0

  • soldValuenumber

    at least 0

  • previousSoldValuenumber

    at least 0

  • topProductsobject[]
    4 properties
    • productIdid
    • namestring
    • soldQuantitynumber

      at least 0

    • soldValuenumber

      at least 0

Response200
{
  "inventoryValue": 0,
  "usage": {
    "soldValue": 0,
    "committedValue": 0,
    "reservedValue": 0
  },
  "productCount": 0,
  "soldValue": 0,
  "previousSoldValue": 0,
  "topProducts": [
    {
      "productId": "000000000000000000000001",
      "name": "string",
      "soldQuantity": 0,
      "soldValue": 0
    }
  ]
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.