# Analytics site transaction record

`POST /analytics/site/transactions` · Rivier · analytics

Record an outcome from the project's own records (a form, booking, order, review or chat) with the source class that travelled with it. Used by the modules that hold those records.

- Scope: analytics:write
- Graphql: Mutation.analyticsSiteTransactionRecord
- Sdk: analytics.siteTransaction.record
- Cli: analytics site transaction record

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "project": {
      "type": "string",
      "maxLength": 80
    },
    "kind": {
      "type": "string",
      "enum": [
        "form",
        "booking",
        "order",
        "review",
        "chat"
      ]
    },
    "source": {
      "type": "string",
      "enum": [
        "ai",
        "search",
        "social",
        "email",
        "paid",
        "referral",
        "direct",
        "unknown"
      ]
    },
    "item": {
      "type": "string",
      "maxLength": 80
    },
    "page": {
      "type": "string",
      "maxLength": 200
    },
    "valueMinor": {
      "type": "integer",
      "minimum": 0
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "canary": {
      "type": "boolean"
    },
    "visitor": {
      "type": "string",
      "maxLength": 40
    }
  },
  "required": [
    "kind"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/analytics/site/transactions' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "kind": "form"
}'
```
