# The consent widget records a receipt

`POST /compliance/center/consent-receipts` · Rivier · compliance

The consent widget records a receipt: versions, region, choices, receipt id; no address. Chained by hash.

- Scope: compliance:write
- Sdk: compliance.consentReceipt.record
- Cli: compliance consent receipt record

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "receiptId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 120,
      "pattern": "^[A-Za-z0-9._-]+$"
    },
    "at": {
      "type": "string",
      "format": "date-time"
    },
    "bannerVersion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "packVersion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "region": {
      "type": "string",
      "minLength": 2,
      "maxLength": 12
    },
    "choices": {
      "type": "object",
      "additionalProperties": {
        "type": "boolean"
      },
      "propertyNames": {
        "maxLength": 40
      }
    },
    "signals": {
      "type": "object",
      "properties": {
        "gpc": {
          "type": "boolean"
        },
        "dnt": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "receiptId",
    "bannerVersion",
    "packVersion",
    "region",
    "choices"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: 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/compliance/center/consent-receipts' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "receiptId": "string",
  "bannerVersion": "string",
  "packVersion": "string",
  "region": "string",
  "choices": {}
}'
```
