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

# List an organization's spend review policy conditions

> Lists the condition fields a `SPEND_REVIEW` business policy can use, with the operators and values each accepts.

A `SPEND_REVIEW` policy decides what happens when a transaction that already happened — a card purchase, a Pix, a boleto, a transfer, a fee — is sent for review: approve it, deny it, or ask its `approvals`. This catalog is what its conditions are checked against on create and update: a `field` that is not listed here, an operator a field does not accept, or a value of the wrong type is refused.

There is one subject, `TRANSACTION`. `amount` is the transaction's absolute value in centavos — whether money came in or went out is the separate `financialImpactType` field — and `instrument` tells a card transaction from a Pix or a boleto. A field marked `conditional` exists only on some transactions (the card fields only on card transactions, for example); a condition on a field the transaction does not carry is false. The operators are the same as in the payment catalog.

The fixed fields come first, followed by one field for each active custom field of the organization on transactions (`customFields.<slug>`), wallets (`wallet.customFields.<slug>`), vehicles (`vehicle.customFields.<slug>`), users (`requester.customFields.<slug>`) and cards (`card.customFields.<slug>`) — text, number, boolean, date and selection fields; file and customer fields cannot be used in a condition. Labels and descriptions are in Portuguese.

Any member of the organization can read the catalog.


## OpenAPI

````yaml /api-reference/ruleengine.openapi.json get /realms/{realmId}/organizations/{organizationId}/business-policies/spend-review-conditions
openapi: 3.0.3
info:
  title: Ruleengine
  version: 1.0.0
  description: >-
    Portão 3 ruleengine API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). Confidence tiers:
    generated:typed=26 copied:manual=0 unknown=0.
servers:
  - url: https://api.ruleengine.v2.portao3.com.br/
    description: production
  - url: https://api.ruleengine.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Business Policies
  - name: Policy Requests
paths:
  /realms/{realmId}/organizations/{organizationId}/business-policies/spend-review-conditions:
    get:
      tags:
        - Business Policies
      summary: List an organization's spend review policy conditions
      description: >-
        Lists the condition fields a `SPEND_REVIEW` business policy can use,
        with the operators and values each accepts.
      operationId: >-
        getRealmsByRealmIdOrganizationsByOrganizationIdBusinessPoliciesSpendReviewConditions
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: >-
            ID of the organization. Its active custom fields are added to the
            catalog.


            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  context:
                    type: string
                    enum:
                      - SPEND_REVIEW
                    description: Always `SPEND_REVIEW`.
                    example: SPEND_REVIEW
                  subjects:
                    type: array
                    items:
                      type: string
                      example: TRANSACTION
                    description: |-
                      What a `SPEND_REVIEW` policy governs: `TRANSACTION`.

                      ---

                      Example: `["TRANSACTION"]`
                  logic:
                    type: array
                    items:
                      type: string
                      example: AND
                    description: >-
                      The values `conditions.logic` and each group's `logic`
                      accept.


                      ---


                      Example: `["AND","OR"]`
                  operators:
                    type: array
                    items:
                      type: object
                      properties:
                        operator:
                          type: string
                          description: The `operator` to use in a condition.
                          example: GREATER_THAN
                        valueKind:
                          type: string
                          enum:
                            - single
                            - array
                            - none
                            - criteria-string
                          description: >-
                            `single`: one value. `array`: a non-empty array of
                            values. `none`: no value — the number is part of the
                            operator, as in `DATE_WITHIN(3)`. `criteria-string`:
                            a sentence in natural language.
                          example: single
                        label:
                          type: string
                          description: Display label, in Portuguese.
                          example: maior que
                        description:
                          type: string
                          description: >-
                            What the operator does and its pitfalls, in
                            Portuguese.
                          example: O campo é maior que o valor informado.
                      required:
                        - operator
                        - valueKind
                        - label
                        - description
                      description: One operator, and the kind of value it takes.
                    description: Every operator, with the kind of value it takes.
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            The `field` to use in a condition: a dot path into
                            the transaction.
                          example: amount
                        type:
                          type: string
                          enum:
                            - integer
                            - number
                            - string
                            - boolean
                            - enum
                            - date
                          description: >-
                            How the condition `value` is typed: `integer`
                            (amounts are integer centavos — see `unit`),
                            `number` (a decimal, for number custom fields),
                            `string`, `boolean`, `enum` (one of `enumValues`,
                            sent in an array) or `date` (`YYYY-MM-DD`).
                          example: integer
                        unit:
                          type: string
                          enum:
                            - centavos
                          description: >-
                            `centavos` on amounts: `500000` is R$ 5,000.00.
                            Absent on other fields.
                          example: centavos
                        enumValues:
                          type: array
                          items:
                            type: string
                          description: >-
                            Every accepted value, for `type: "enum"`. Absent on
                            other types.
                        operators:
                          type: array
                          items:
                            type: string
                            example: EQUALS
                          description: >-
                            Every operator the field accepts — `viewOperator`
                            plus, on some fields, `DATE_WITHIN(n)` or
                            `LLM_EVALUATE`.


                            ---


                            Example:
                            `["EQUALS","NOT_EQUALS","LESS_THAN","GREATER_THAN","GTE","LTE"]`
                        viewOperator:
                          type: array
                          items:
                            type: string
                            example: EQUALS
                          description: >-
                            The operators to offer in a condition editor.


                            ---


                            Example:
                            `["EQUALS","NOT_EQUALS","LESS_THAN","GREATER_THAN","GTE","LTE"]`
                        viewType:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - MONEY
                                - NUMBER
                                - TEXT
                                - BOOLEAN
                                - DATE
                                - MULTI_SELECT
                              description: >-
                                `MONEY`, `NUMBER`, `TEXT`, `BOOLEAN`, `DATE` or
                                `MULTI_SELECT`.
                              example: MONEY
                            prefix:
                              type: string
                              description: '`NUMBER` only: text shown before the number.'
                            suffix:
                              type: string
                              description: '`NUMBER` only: text shown after the number.'
                            options:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    description: >-
                                      The value to put in the condition's
                                      `value` array.
                                    example: PIX
                                  label:
                                    type: string
                                    description: Display label, in Portuguese.
                                    example: PIX
                                  icon:
                                    type: string
                                    description: >-
                                      Name of an icon to show next to the
                                      option. Absent on most options.
                                required:
                                  - id
                                  - label
                                description: One selectable value of a multi-select field.
                              description: '`MULTI_SELECT` only: the values to pick from.'
                            dynamicOptions:
                              type: string
                              enum:
                                - WALLETS
                                - CURRENCIES
                                - USERS
                              description: >-
                                `MULTI_SELECT` only: where the values come from
                                instead of `options`.
                          required:
                            - type
                          description: Which input to render for the value.
                        label:
                          type: string
                          description: Display label, in Portuguese.
                          example: Valor
                        description:
                          type: string
                          description: >-
                            What the field holds and how to use it, in
                            Portuguese.
                          example: Valor absoluto da transação, em centavos.
                        availability:
                          type: string
                          enum:
                            - always
                            - conditional
                          description: >-
                            `always`: every transaction carries the field.
                            `conditional`: only some do (see
                            `availabilityNote`); a condition on a field the
                            transaction does not carry is false.
                          example: always
                        availabilityNote:
                          type: string
                          description: >-
                            When the field is `conditional`, when it is present
                            — in Portuguese. Absent otherwise.
                        dateKind:
                          type: string
                          enum:
                            - CALENDAR_DATE
                            - INSTANT
                            - CLIENT_DAY
                          description: >-
                            `date` fields only: which day a condition compares —
                            `INSTANT` (the São Paulo day of a moment in time) or
                            `CLIENT_DAY` (the day as written in a custom field).
                        customField:
                          type: object
                          properties:
                            id:
                              type: string
                              description: ID of the custom field.
                              example: f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4a5b
                            slug:
                              type: string
                              description: >-
                                Slug of the custom field — the last segment of
                                `field`.
                              example: cost-center
                            type:
                              type: string
                              description: >-
                                Type of the custom field: `TEXT`, `NUMBER`,
                                `BOOLEAN`, `DATE`, `SELECT` or `MULTI_SELECT`.
                              example: SELECT
                            required:
                              type: boolean
                              description: Whether the custom field is required.
                              example: false
                            mask:
                              type: string
                              description: >-
                                Display mask of the custom field. Absent when it
                                has none.
                            entity:
                              type: string
                              description: >-
                                Whose custom field it is: `transaction` (the
                                payment's own, `customFields.<slug>`), `wallet`,
                                `vehicle`, `requester` or `card`.
                              example: transaction
                            location:
                              type: string
                              description: >-
                                Where the custom field is defined:
                                `TRANSACTION`, `WALLET`, `VEHICLE`, `USER` or
                                `CARD`.
                              example: TRANSACTION
                          required:
                            - id
                            - slug
                            - type
                            - required
                            - entity
                            - location
                          description: >-
                            Present only on a field built from one of the
                            organization's custom fields. Absent on the fixed
                            fields.
                      required:
                        - field
                        - type
                        - operators
                        - viewOperator
                        - viewType
                        - label
                        - description
                        - availability
                      description: One field a `SPEND_REVIEW` policy's conditions can test.
                    description: >-
                      Every field a condition can test: the fixed fields, then
                      one per active custom field of the organization (text,
                      number, boolean, date and selection custom fields only).
                required:
                  - context
                  - subjects
                  - logic
                  - operators
                  - fields
                description: The condition catalog of `SPEND_REVIEW` business policies.
        '403':
          description: >-
            `BUSINESS_POLICY_FORBIDDEN` — You are not a member of the
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BUSINESS_POLICY_FORBIDDEN
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - RULE_ENGINE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BUSINESS_POLICY_FORBIDDEN
                origin: RULE_ENGINE
                message: You do not have permission to manage business policies
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is not a valid ID; `fields` names
            it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - RULE_ENGINE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BAD_REQUEST
                origin: RULE_ENGINE
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: organizationId
                    message: Invalid UUID
                    code: ORGANIZATIONID_UUID
        '503':
          description: >-
            `CUSTOM_FIELD_CATALOG_UNAVAILABLE` — The organization's custom
            fields could not be loaded in time; try again.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - CUSTOM_FIELD_CATALOG_UNAVAILABLE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - RULE_ENGINE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: CUSTOM_FIELD_CATALOG_UNAVAILABLE
                origin: RULE_ENGINE
                message: Could not load the organization's custom fields — try again

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.