For the complete documentation index, see llms.txt. This page is also available as Markdown.

Examples

How to perform Metrics API queries on the analysis endpoint

FBT

The following request performs a FBT query on the analysis endpoint:

curl -g -X POST \
  'https://{{your_domain}}.commercelayer.io/metrics/analysis/fbt' \
  -H 'Accept: application/vnd.api.v1+json' \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Authorization: Bearer {{your_access_token}}' \
  -d '{
    "filter": {
      "line_items": {
        "item_ids": {
          "in": [ "adGhjZHKt8" ]
        }
      }
    }
  }'

On success, the API responds with a 200 OK status code, returning the aggregated values in the data object and extra information in the meta object:

{
  "data": [
    {
      "item_id": "adGhjZHKt8",
      "value": 1,
      "type": "skus",
      "name": "Black Baby Onesie Short Sleeve with Pink Logo (New born)"
    }
  ],
  "meta": {
    "type": "fbt",
    "trace_id": "bb74e399-af67-44b8-abf6-008c6a233b50",
    "mode": "test",
    "organization_id": "mzRmbZFPyO",
    "market_ids": [
      "AjRevhvqvo",
      "dlQbPhqGro"
    ]
  }
}

Last updated