Skip to content
campaiDeveloper
campai.com

Sales · Statistics

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

Get shop statistics

Returns whether a shop is open for orders and the orders placed in the shop in a period: the amount sold and the number of orders, the amount sold in the period of the same length right before it, the amount per month split into pickup and shipping, the number and amount of the orders per status, and the five products that brought the most with how many of each variant were sold. Canceled orders only count in their status. Amounts are gross and 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
  • shopOrder.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/shop' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • hasOpenShopboolean
  • soldAmountnumber

    at least 0

  • previousSoldAmountnumber

    at least 0

  • orderCountinteger

    at least 0

  • monthsobject[]
    3 properties
    • datestring
    • pickupnumber

      at least 0

    • shippingnumber

      at least 0

  • statusesobject[]
    3 properties
    • statusstring
      open shipped readyForPickup completed canceled
    • orderCountinteger

      at least 0

    • amountnumber

      at least 0

  • topProductsobject[]
    7 properties
    • productIdid
    • namestring
    • typestring
      regular variants package group
    • imagestringnullable
    • soldQuantityinteger

      at least 0

    • soldAmountnumber

      at least 0

    • variantsobject[]
      2 properties
      • namestring
      • soldQuantityinteger

        at least 0

Response200
{
  "hasOpenShop": true,
  "soldAmount": 0,
  "previousSoldAmount": 0,
  "orderCount": 0,
  "months": [
    {
      "date": "string",
      "pickup": 0,
      "shipping": 0
    }
  ],
  "statuses": [
    {
      "status": "open",
      "orderCount": 0,
      "amount": 0
    }
  ],
  "topProducts": [
    {
      "productId": "000000000000000000000001",
      "name": "string",
      "type": "regular",
      "image": "string",
      "soldQuantity": 0,
      "soldAmount": 0,
      "variants": [
        {
          "name": "string",
          "soldQuantity": 0
        }
      ]
    }
  ]
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.