> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vultlocal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Check Compliance

> Validate a transaction against compliance rules

<Info>
  Internal endpoint called by Gateway services to verify if a transaction is permissible under current rules.
</Info>

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer olive_default_xxx` (Internal Service Token)
</ParamField>

### Body Parameters

<ParamField body="subscriber_id" type="string" required>
  Subscriber UUID
</ParamField>

<ParamField body="amount" type="integer" required>
  Amount in cents
</ParamField>

<ParamField body="transaction_type" type="string" required>
  Type: `P2P`, `CASH_OUT`, `PAYMENT`
</ParamField>

<ParamField body="recent_transaction_count" type="integer">
  Velocity check (last 24h count)
</ParamField>

<ParamField body="is_new_location" type="boolean">
  Geo-velocity check
</ParamField>

***

## Response

<ResponseField name="allowed" type="boolean">
  Transaction allowed?
</ResponseField>

<ResponseField name="risk_level" type="string">
  `LOW`, `MEDIUM`, `HIGH`, `CRITICAL`
</ResponseField>

<ResponseField name="violation" type="string">
  Rule violated (if allowed=false)
</ResponseField>

***

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://demo.api.vultlocal.com/api/v1/compliance/check" \
    -H "Authorization: Bearer olive_internal_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "subscriber_id": "sub_abc123",
      "amount": 5000000,
      "transaction_type": "CASH_OUT",
      "recent_transaction_count": 5
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Allowed theme={null}
  {
    "allowed": true,
    "risk_level": "LOW"
  }
  ```

  ```json 200 Blocked theme={null}
  {
    "allowed": false,
    "risk_level": "CRITICAL",
    "violation": "DAILY_LIMIT_EXCEEDED",
    "limit": 1000000,
    "current": 1500000
  }
  ```
</ResponseExample>

***

## Checks Performed

| Check             | Description                           |
| ----------------- | ------------------------------------- |
| **Limit Check**   | Is amount within daily/single limits? |
| **Balance Check** | Does wallet max balance exceed tier?  |
| **Velocity**      | Too many transactions in short time?  |
| **Watchlist**     | Is user on sanctions list?            |

***

## Errors

| Status | Code            | Description            |
| ------ | --------------- | ---------------------- |
| 400    | `INVALID_INPUT` | Bad request parameters |
| 500    | `rule_error`    | rule evaluation failed |


## OpenAPI

````yaml olive-openapi.json POST /compliance/check
openapi: 3.0.0
info:
  description: >-
    API Gateway for OLIVE NFC Card Payment System - Comprehensive payment, card
    management, agent operations, and admin authentication. All /api/v1 routes
    require authentication using either API Key or JWT token.
  title: OLIVE NFC Card Payment API
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    email: support@olive.sl
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://olive-gateway-a6ba.onrender.com/api/v1
security: []
paths:
  /compliance/check:
    post:
      tags:
        - Compliance
      summary: Check Compliance
      description: Validate a transaction against compliance rules
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                subscriber_id:
                  type: string
                amount:
                  type: integer
                transaction_type:
                  type: string
                recent_transaction_count:
                  type: integer
                is_new_location:
                  type: boolean
              required:
                - subscriber_id
                - amount
                - transaction_type
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      description: >-
        JWT token from admin login for administrative operations. Format:
        'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
      type: apiKey
      name: Authorization
      in: header

````