> ## 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.

# Preview a transaction's spend review

> Says where the transaction stands with spend review — the after-the-fact approval of an expense under the organization's `SPEND_REVIEW` business policies — and what submitting it would do, without submitting it.

`spendReview` is the transaction's review (`null` when it was never submitted). `policy` is the policy that matches the transaction as it stands now, with its custom fields: `autoAction` `NONE` means it needs the approvers in `approvals` (submit it with `POST .../spend-review/request` — unless a policy once approved it automatically: such a transaction can only be approved automatically again), `APPROVE` with a policy `id` that submitting approves it at once, `DENY` that submitting is refused, and `APPROVE` with no other field that no policy matches — it needs no review. `policy` is `null` when there is nothing to evaluate: the review is already `PENDING_APPROVAL` or `APPROVED`, or the transaction moved no money (`financialImpactType` `NONE`). A review still pending past its deadline is settled first with the approval request's final outcome — `APPROVED`, or `DECLINED` with its `declineOutcome` (`EXPIRED` when nobody decided).

The transaction's stored custom fields are checked first: a required transaction custom field with no value is a 422 — set it with `PUT .../custom-fields`. The policies are never skipped: when they can't be evaluated, the answer is a 503.

On the organization's main wallet, only organization admins can do this; on another wallet, organization admins and the users it is shared with as `OWNER` or `USER`. Use `default` as `walletId` for the main wallet, and send `x-environment: LIVE` for production wallets.


## OpenAPI

````yaml /api-reference/banking.openapi.json get /realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/transactions/{transactionId}/spend-review
openapi: 3.0.3
info:
  title: Banking
  version: 1.0.0
  description: >-
    Portão 3 banking 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). Banking attaches a zod
    validationSchema at the route; request bodies are resolved from it (object +
    array roots). Responses have no presenter layer, so they stay tier=unknown.
    Confidence tiers: generated:typed=300 copied:manual=0 unknown=20.
servers:
  - url: https://api.banking.v2.portao3.com.br/
    description: production
  - url: https://api.banking.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Accounts
  - name: Account Limits
  - name: Wallets
  - name: Transaction Limits
  - name: Transfers
  - name: Cards
  - name: Card Limits
  - name: Cards 3DS
  - name: Pix Payments
  - name: Pix Keys
  - name: PIX Charges
  - name: PIX Automatic
  - name: PIX Initiation (Open Finance)
  - name: PIX Infractions (MED)
  - name: Boleto Payments
  - name: Boleto Charges
  - name: TED Payments
  - name: Transactions
  - name: Transaction Reversals
  - name: Spend Review
  - name: Cashback
  - name: Currency Codes
paths:
  /realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/transactions/{transactionId}/spend-review:
    get:
      tags:
        - Spend Review
      summary: Preview a transaction's spend review
      description: >-
        Says where the transaction stands with spend review — the after-the-fact
        approval of an expense under the organization's `SPEND_REVIEW` business
        policies — and what submitting it would do, without submitting it.
      operationId: >-
        getRealmsByRealmIdOrganizationsByOrganizationIdAccountsByAccountIdWalletsByWalletIdTransactionsByTransactionIdSpendReview
      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 the wallet belongs to.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: accountId
          in: path
          required: true
          description: ID of the organization's account (24 hexadecimal characters).
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
          example: 66f2a1c7b4d3e80012c9a0b4
        - name: walletId
          in: path
          required: true
          description: >-
            ID of the wallet (24 hexadecimal characters), or `default` for the
            organization's main wallet.
          schema:
            type: string
            pattern: ^([0-9a-fA-F]{24}|default)$
          example: 66f2a3d1b4d3e80012c9a0d2
        - name: transactionId
          in: path
          required: true
          description: ID of the transaction (24 hexadecimal characters).
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
          example: 66f2a7e9b4d3e80012c9a112
        - name: x-environment
          in: header
          required: false
          description: >-
            Environment of the wallet: `LIVE` (production) or `TEST` (sandbox).
            When you omit it, the request runs in `TEST`; any other value is
            rejected.
          schema:
            type: string
            enum:
              - LIVE
              - TEST
          example: LIVE
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  spendReview:
                    description: >-
                      The transaction's review, or `null` when it was never
                      submitted (or its review was reset by a change of its
                      custom fields).
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - PENDING_APPROVAL
                          - APPROVED
                          - DECLINED
                        description: >-
                          `PENDING_APPROVAL` (waiting for the approvers),
                          `APPROVED` or `DECLINED`.
                        example: PENDING_APPROVAL
                      policyId:
                        type: string
                        description: ID of the business policy that governs the review.
                        example: 3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f
                      policyRequestId:
                        type: string
                        description: ID of the approval request.
                        example: 4d2c1b0a-9f8e-4d7c-8b6a-5f4e3d2c1b0a
                      autoApproved:
                        type: boolean
                        description: >-
                          `true` when the policy approved it without an
                          approver.
                        example: false
                      requester:
                        type: object
                        properties:
                          userId:
                            type: string
                            description: ID of the user.
                            example: e3553bc1-5e20-4e17-b22a-a796fda0aa99
                          name:
                            type: string
                            description: >-
                              Name of the user (their e-mail or ID when they
                              have none).
                            example: Mariana Costa
                          email:
                            type: string
                            description: E-mail of the user.
                            example: mariana.costa@acme.com.br
                        required:
                          - userId
                          - name
                          - email
                        description: Who submitted the transaction for review.
                      requestedAt:
                        type: string
                        description: When it was submitted.
                        example: '2026-11-02T18:02:11.000Z'
                        format: date-time
                      approvalExpiresAt:
                        type: string
                        description: >-
                          Deadline for the approvers: a month after it was
                          submitted. A review still pending then ends `DECLINED`
                          with `declineOutcome` `EXPIRED`.
                        example: '2026-12-02T18:02:11.000Z'
                        format: date-time
                      decidedAt:
                        type: string
                        description: When it was approved or declined.
                        example: '2026-11-03T10:15:00.000Z'
                        format: date-time
                      declineOutcome:
                        type: string
                        enum:
                          - DENIED
                          - CANCELED
                          - EXPIRED
                        description: >-
                          Why a `DECLINED` review ended: `DENIED` (an approver
                          refused it), `CANCELED` (the request was cancelled) or
                          `EXPIRED` (nobody decided in time).
                        example: DENIED
                      decisionReason:
                        type: string
                        description: >-
                          The approver's reason, when one was given (up to 500
                          characters).
                        example: Falta o comprovante
                    required:
                      - status
                      - policyId
                      - policyRequestId
                      - requester
                      - requestedAt
                    nullable: true
                  policy:
                    description: >-
                      What the organization's spend-review policies say about
                      the transaction as it stands now. `null` when there is
                      nothing to evaluate: the review is `PENDING_APPROVAL` or
                      `APPROVED`, or the transaction moved no money
                      (`financialImpactType` `NONE`).
                    type: object
                    properties:
                      actions:
                        type: object
                        properties:
                          autoAction:
                            type: string
                            enum:
                              - APPROVE
                              - DENY
                              - NONE
                            description: >-
                              `NONE` — the transaction needs approval from
                              `approvals`: submit it; `APPROVE` — it is approved
                              as soon as it is submitted, with no approver;
                              `DENY` — submitting it is refused. When no policy
                              matches, this is `APPROVE` and no other field of
                              the policy is present: the transaction needs no
                              review (submitting it is refused with
                              `SPEND_REVIEW_APPROVAL_NOT_REQUIRED`).
                            example: NONE
                          hierarchy:
                            type: boolean
                            description: >-
                              Whether the approvers decide one after the other,
                              in the order of `approvals`, instead of all at
                              once.
                            example: false
                          moveBalance:
                            type: object
                            properties:
                              addBalance:
                                type: boolean
                                description: >-
                                  Whether the policy adds the transaction's
                                  amount to the wallet, from another wallet,
                                  when the review is approved.
                                example: true
                              fromAccountId:
                                type: string
                                description: >-
                                  Account the money comes from. Present when
                                  `addBalance` is `true`.
                                example: 66f2a1c7b4d3e80012c9a0b4
                              fromWalletId:
                                type: string
                                description: >-
                                  Wallet the money comes from. Present when
                                  `addBalance` is `true`.
                                example: 66f2a1d0b4d3e80012c9a0b9
                            required:
                              - addBalance
                            description: >-
                              Whether the policy moves money to the wallet once
                              the expense is approved.
                          approvals:
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - USER
                                    - GROUP
                                  description: >-
                                    `USER` for a user, `GROUP` for a group of
                                    users.
                                  example: USER
                                id:
                                  type: string
                                  description: ID of the user or of the group.
                                  example: 0b6f2c1e-8d4a-4f3b-9a7e-5c2d1e0f9a8b
                                name:
                                  type: string
                                  description: >-
                                    Name of the user or of the group. Absent
                                    when it can't be read at that moment.
                                  example: Rafael Lima
                              required:
                                - type
                                - id
                              description: An approver named by a spend-review policy.
                            description: >-
                              Who must approve. Present when `autoAction` is
                              `NONE`.
                        required:
                          - autoAction
                        description: What the policy decides.
                      id:
                        type: string
                        description: ID of the policy.
                        example: 3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f
                      realmId:
                        type: string
                        description: ID of the realm.
                        example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                        format: uuid
                      organizationId:
                        type: string
                        description: ID of the organization.
                        example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                        format: uuid
                      context:
                        type: string
                        description: 'Kind of policy: `SPEND_REVIEW`.'
                        example: SPEND_REVIEW
                      name:
                        type: string
                        description: Name of the policy.
                        example: Despesas acima de R$ 500
                      description:
                        type: string
                        description: Description of the policy.
                        example: >-
                          Pede aprovação do gestor para despesas acima de R$
                          500.
                      order:
                        type: number
                        description: >-
                          Position of the policy in the organization's
                          evaluation order; the first that matches wins.
                        example: 1
                      status:
                        type: string
                        description: Status of the policy.
                        example: ACTIVE
                      conditions:
                        type: object
                        properties:
                          logic:
                            type: string
                            enum:
                              - AND
                              - OR
                            description: >-
                              `AND` — every group must match; `OR` — any one is
                              enough.
                            example: AND
                          groups:
                            type: array
                            items:
                              type: object
                              properties:
                                logic:
                                  type: string
                                  enum:
                                    - AND
                                    - OR
                                  description: >-
                                    `AND` — every condition must match; `OR` —
                                    any one is enough.
                                  example: AND
                                dependsOn:
                                  type: array
                                  items:
                                    type: string
                                  description: |-
                                    Other groups this group depends on.

                                    ---

                                    Example: `[]`
                                  example: []
                                items:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      operator:
                                        type: string
                                        description: >-
                                          How the field is compared, such as
                                          `GREATER_THAN` or `EQUALS`.
                                        example: GREATER_THAN
                                      field:
                                        type: string
                                        description: >-
                                          Field of the transaction the condition
                                          reads, such as `amount`,
                                          `enrichment.category` or
                                          `customFields.<slug>`.
                                        example: amount
                                      maskType:
                                        type: string
                                        description: >-
                                          Format the value is compared in, when
                                          the field needs one.
                                        example: CURRENCY
                                      dynamicFieldValue:
                                        type: string
                                        description: >-
                                          Another field whose value is compared
                                          instead of `value`.
                                        example: customFields.cost-center
                                      value:
                                        description: Value the field is compared with.
                                        example: 50000
                                    required:
                                      - operator
                                      - field
                                    description: One condition of a spend-review policy.
                                  description: The conditions of the group.
                              required:
                                - logic
                                - items
                              description: A group of conditions of a spend-review policy.
                            description: >-
                              The groups of conditions. With none, the policy
                              matches every transaction.
                        required:
                          - logic
                          - groups
                        description: The conditions the policy matches.
                      createdAt:
                        type: string
                        description: When the policy was created.
                        example: '2026-09-15T14:00:00.000Z'
                        format: date-time
                      updatedAt:
                        type: string
                        description: When the policy last changed.
                        example: '2026-10-01T09:30:00.000Z'
                        format: date-time
                    required:
                      - actions
                    nullable: true
                required:
                  - spendReview
                  - policy
                description: >-
                  Where the transaction stands with spend review, and what
                  submitting it would do.
        '403':
          description: >-
            `FORBIDDEN_WALLET` — On the organization's main wallet you aren't an
            organization admin; on another wallet you aren't an organization
            admin and it isn't shared with you as `OWNER` or `USER`.
          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:
                      - FORBIDDEN_WALLET
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BANKING
                    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: FORBIDDEN_WALLET
                origin: BANKING
                message: >-
                  You do not have permission to perform this action on this
                  wallet
        '404':
          description: >-
            `ACCOUNT_NOT_FOUND` — No account with this ID exists in the
            organization.


            `WALLET_NOT_FOUND` — No wallet with this ID exists in the account
            and environment.


            `TRANSACTION_NOT_FOUND` — The wallet has no transaction with this ID
            in this environment.
          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:
                      - ACCOUNT_NOT_FOUND
                      - WALLET_NOT_FOUND
                      - TRANSACTION_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BANKING
                    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: ACCOUNT_NOT_FOUND
                origin: BANKING
                message: Account not found
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is invalid; `fields` lists each
            one.


            `CUSTOM_FIELD_IS_REQUIRED` — A required transaction custom field has
            no value on the transaction; `fields` names it. Set it with `PUT
            .../custom-fields`.


            `CUSTOM_FIELD_INVALID_VALUE` — A custom field value stored on the
            transaction doesn't fit its field's type or options; `fields` names
            it. Fix it with `PUT .../custom-fields`.
          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
                      - CUSTOM_FIELD_IS_REQUIRED
                      - CUSTOM_FIELD_INVALID_VALUE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BANKING
                    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: BANKING
                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: >-
            `POLICY_EVALUATION_UNAVAILABLE` — The spend-review policies couldn't
            be evaluated. Nothing changed — retry shortly.
          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:
                      - POLICY_EVALUATION_UNAVAILABLE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BANKING
                    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: POLICY_EVALUATION_UNAVAILABLE
                origin: BANKING
                message: The policy evaluation service is unavailable — please retry

````

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