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

# Block a wallet

> Blocks a wallet: it can no longer move money until it is unblocked.

Every balance the wallet holds — except `BLOCKED` and `CASHBACK`, which stay in it — is first moved to the organization's main wallet; unblocking it later does not bring the balances back. Blocking a wallet that is already `BLOCKED` succeeds and changes nothing. Only `ACTIVE` wallets can be blocked.

Organization admins can block every wallet; other users only the wallets shared with them as `OWNER` or `USER`.


## OpenAPI

````yaml /api-reference/banking.openapi.json post /realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/block
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=262 copied:manual=1 unknown=35.
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 (DICT)
  - name: PIX Charges
  - name: PIX Automatic
  - name: PIX Initiation (Open Finance)
  - name: PIX Infractions (MED)
  - name: Boleto Payments
  - name: Boleto Charges
  - name: TED
  - name: Transactions
  - name: Cashback
  - name: Currency Codes
  - name: Reversals
paths:
  /realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/block:
    post:
      tags:
        - Wallets
      summary: Block a wallet
      description: 'Blocks a wallet: it can no longer move money until it is unblocked.'
      operationId: >-
        postRealmsByRealmIdOrganizationsByOrganizationIdAccountsByAccountIdWalletsByWalletIdBlock
      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).
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
          example: 66f2a3d1b4d3e80012c9a0d2
        - 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:
                  _id:
                    type: string
                    description: ID of the wallet.
                    example: 66f2a3d1b4d3e80012c9a0d2
                  realmId:
                    type: string
                    description: ID of the realm the wallet belongs to.
                    example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                    format: uuid
                  organizationId:
                    type: string
                    description: ID of the organization the wallet belongs to.
                    example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                    format: uuid
                  accountId:
                    type: string
                    description: ID of the account the wallet belongs to.
                    example: 66f2a1c7b4d3e80012c9a0b4
                  environment:
                    type: string
                    enum:
                      - LIVE
                      - TEST
                    description: >-
                      Environment the wallet lives in: `LIVE` (production) or
                      `TEST` (sandbox).
                    example: LIVE
                  external:
                    type: object
                    properties:
                      balanceAccountGroupId:
                        type: string
                        description: >-
                          Internal identifier of the wallet at the bank. Absent
                          while the wallet is being created.
                        example: 4f6b0e1d-2b3a-4c5d-8e9f-0a1b2c3d4e5f
                      accountNumber:
                        type: number
                        nullable: true
                        description: >-
                          Number of the wallet's bank account. Absent, or
                          `null`, while the wallet is being created.
                        example: 10023456
                      branch:
                        type: string
                        description: Branch of the wallet's bank account.
                        example: '0001'
                      accountType:
                        type: string
                        nullable: true
                        enum:
                          - PREPAID
                          - CCLG
                          - null
                        description: >-
                          Type of the wallet's bank account: `PREPAID` (a
                          prepaid payment account) or `CCLG` (a postpaid
                          account).
                        example: PREPAID
                    description: >-
                      The wallet's bank account. Absent on a few wallets created
                      before it was recorded.
                  currency:
                    type: string
                    description: >-
                      Currency of the wallet, as an ISO 4217 numeric code.
                      Always `986` (Brazilian real).
                    example: '986'
                  customFields:
                    type: object
                    additionalProperties: {}
                    description: >-
                      Values of the organization's wallet custom fields, keyed
                      by each field's `slug`. Absent when the wallet has none.


                      ---


                      Example: `{"cost-center":"CC-1020"}`
                    example:
                      cost-center: CC-1020
                  status:
                    type: string
                    enum:
                      - PENDING
                      - ACTIVE
                      - CANCELLING
                      - CANCELLED
                      - BLOCKED
                      - REPROVED
                      - FRAUD_ANALYSIS
                      - FRAUD_CONFIRMED
                    description: >-
                      Status of the wallet: `PENDING`, `ACTIVE`, `BLOCKED`,
                      `CANCELLING`, `CANCELLED`, `REPROVED`, `FRAUD_ANALYSIS` or
                      `FRAUD_CONFIRMED` — see the wallet's own read for what
                      each means.
                    example: BLOCKED
                  role:
                    type: string
                    description: >-
                      Role of the wallet in the account: `DEFAULT` for the
                      organization's main wallet and `CHECKING` for every other
                      wallet. A few older wallets carry another value.
                    example: CHECKING
                  walletProduct:
                    type: string
                    description: >-
                      Card product of the wallet, inherited from the account.
                      Absent on older wallets.
                    example: NORMAL
                  isSuper:
                    type: boolean
                    description: >-
                      Whether the wallet's cards are on the premium card
                      product.
                    example: false
                  createdBy:
                    type: string
                    nullable: true
                    description: >-
                      ID of the user who created the wallet. Absent, or `null`,
                      on older wallets.
                    example: e3553bc1-5e20-4e17-b22a-a796fda0aa99
                    format: uuid
                  updatedBy:
                    type: string
                    nullable: true
                    description: >-
                      ID of the user who created the wallet; editing it doesn't
                      change this field. Absent, or `null`, on older wallets.
                    example: e3553bc1-5e20-4e17-b22a-a796fda0aa99
                    format: uuid
                  accountType:
                    type: string
                    enum:
                      - PREPAID
                      - CCLG
                    description: >-
                      Type of the wallet's bank account, on older wallets only:
                      the same as `external.accountType`.
                    example: PREPAID
                  createdAt:
                    type: string
                    description: When the wallet was created.
                    example: '2024-10-01T12:30:05.000Z'
                    format: date-time
                  updatedAt:
                    type: string
                    description: When the wallet last changed.
                    example: '2024-10-01T12:34:41.000Z'
                    format: date-time
                  __v:
                    type: number
                    description: Internal revision counter of the wallet.
                    example: 0
                  totalBalance:
                    type: number
                    description: >-
                      Total balance of the wallet across all of its categories,
                      in cents. Only when the wallet already had the requested
                      status.
                    example: 0
                  balances:
                    type: array
                    items:
                      type: object
                      properties:
                        category:
                          type: string
                          enum:
                            - FLEX_NATIONAL
                            - FLEX_INTERNATIONAL
                            - FOOD
                            - GAS
                            - MOBILITY
                            - TOLL
                            - FLEX_NATIONAL_WITHOUT_WITHDRAWALS
                            - ADS
                            - SAAS
                            - HOTEL
                            - AIRLINES
                            - TRAVEL
                            - BLOCKED
                            - CASHBACK
                          description: >-
                            Balance category. `FLEX_INTERNATIONAL` is the
                            general-purpose category most flows use; `FOOD`,
                            `GAS`, `MOBILITY`, `TOLL`, `ADS`, `SAAS`, `HOTEL`,
                            `AIRLINES` and `TRAVEL` can only be spent on their
                            kind of purchase; `BLOCKED` holds funds that can't
                            be spent; `CASHBACK` holds cashback earned.
                          example: FLEX_INTERNATIONAL
                        amount:
                          type: number
                          description: Balance of the category, in cents.
                          example: 1250000
                      required:
                        - category
                        - amount
                      description: The balance of one category of the wallet.
                    description: >-
                      Balance per category. Only when the wallet already had the
                      requested status.
                required:
                  - _id
                  - accountId
                  - createdAt
                  - currency
                  - environment
                  - isSuper
                  - organizationId
                  - realmId
                  - role
                  - status
                  - updatedAt
                description: >-
                  A wallet that was just blocked or unblocked. It leaves out the
                  wallet's name, users, settings and kind; a wallet that already
                  had the requested status also comes with its balances.
        '400':
          description: >-
            `WALLET_NOT_ACTIVE` — The wallet is not `ACTIVE` — for example, it
            is still `PENDING` or already closed.
          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:
                      - WALLET_NOT_ACTIVE
                    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: WALLET_NOT_ACTIVE
                origin: BANKING
                message: Wallet is not active
        '403':
          description: '`FORBIDDEN_WALLET` — You can''t use this wallet.'
          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, or the organization has no main wallet to receive
            the balance.
          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
                    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 not a valid ID; `fields` lists
            each one.


            `ACCOUNT_BLOCKED` — The main wallet couldn't receive the balance, so
            the wallet wasn't blocked.


            `INSUFFICIENT_FUNDS` — A balance changed while it was being moved,
            so the wallet wasn't blocked. 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:
                      - BAD_REQUEST
                      - ACCOUNT_BLOCKED
                      - INSUFFICIENT_FUNDS
                    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
        '500':
          description: >-
            `ERROR_CLEAR_WALLET_BALANCE` — A balance couldn't be moved, so the
            wallet wasn't blocked. Categories already moved stay in the main
            wallet.
          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:
                      - ERROR_CLEAR_WALLET_BALANCE
                    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: ERROR_CLEAR_WALLET_BALANCE
                origin: BANKING
                message: Error to clear wallet balance
        '503':
          description: >-
            `BANKING_PROVIDER_UNAVAILABLE` — The bank is unavailable; the status
            is the bank's own (`500`, `502`, `503` or `504`). Retry.
          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:
                      - BANKING_PROVIDER_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: BANKING_PROVIDER_UNAVAILABLE
                origin: BANKING
                message: Banking provider temporarily unavailable, please retry

````

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